Skip to content

Commit 1fc9984

Browse files
committed
add a rosters job
1 parent e43f052 commit 1fc9984

File tree

6 files changed

+116
-3
lines changed

6 files changed

+116
-3
lines changed

charts/thub/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type: application
66
# This is the chart version. This version number should be incremented each time you make changes
77
# to the chart and its templates, including the app version.
88
# Versions are expected to follow Semantic Versioning (https://semver.org/)
9-
version: 1.7.3
9+
version: 1.7.4
1010

1111
# This is the version number of the application being deployed. This version number should be
1212
# incremented each time you make changes to the application. Versions are not expected to
@@ -23,7 +23,7 @@ dependencies:
2323
- name: keycloak-config
2424
version: 0.1.1
2525
- name: lms-data-service
26-
version: 1.5.1
26+
version: 1.5.2
2727
- name: ojt
2828
version: 1.4.13
2929
- name: user-service

charts/thub/charts/lms-data-service/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 1.5.1
10+
version: 1.5.2
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to

charts/thub/charts/lms-data-service/templates/_helpers.tpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,22 @@ Create the name of the JSON file used by the learning-history-upload-job
218218
{{ print "./temp/start-lms-learning-history-job.json" }}
219219
{{- end }}
220220
{{- end }}
221+
222+
{{/*
223+
Create the name of the CronJob rosters-scheduler-job
224+
*/}}
225+
{{- define "lms-data-service.rostersSchedulerJobName" -}}
226+
{{ include "lms-data-service.name" . }}-rosters-scheduler-job
227+
{{- end }}
228+
229+
{{/*
230+
Create the name of the JSON file used by the rosters-scheduler-job
231+
This job is currently used only when integrating with Workday
232+
*/}}
233+
{{- define "lms-data-service.rostersSchedulerJobInputFile" -}}
234+
{{- if .Values.rostersSchedulerJob.jsonInputFile -}}
235+
{{ print .Values.rostersSchedulerJob.jsonInputFile }}
236+
{{- else -}}
237+
{{ print "./temp/start-rosters-web-job.json" }}
238+
{{- end }}
239+
{{- end }}

charts/thub/charts/lms-data-service/templates/event-scheduler-job-input-files-configmap.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ data:
7474
"instruction": "START",
7575
"communicationType": "WEBSERVICE"
7676
}
77+
start-rosters-web-job.json: |
78+
{
79+
"type": "ROSTERS",
80+
"instruction": "START",
81+
"communicationType": "WEBSERVICE"
82+
}
7783
7884
{{/*
7985
Could use this code if we want to load them from files rather than have them here.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{{- if .Values.rostersSchedulerJob.enabled -}}
2+
apiVersion: batch/v1
3+
kind: CronJob
4+
metadata:
5+
name: {{ include "lms-data-service.rostersSchedulerJobName" . }}
6+
# These labels do not also get added to the pods created by this job
7+
labels:
8+
{{- include "lms-data-service.labels" . | nindent 4 }}
9+
jobCommonName: lms-rosters-scheduler-job
10+
annotations:
11+
description: >
12+
Sends a message to the LMS Data Service application via ActiveMQ notifying it to
13+
load rosters (aka Learning Enrollments) from the LMS.
14+
spec:
15+
schedule: {{ .Values.rostersSchedulerJob.schedule | quote }}
16+
concurrencyPolicy: {{ .Values.rostersSchedulerJob.concurrencyPolicy | quote }}
17+
jobTemplate:
18+
spec:
19+
template:
20+
metadata:
21+
annotations:
22+
{{- with .Values.rostersSchedulerJob.podAnnotations }}
23+
{{- toYaml . | nindent 12 }}
24+
{{- end }}
25+
labels:
26+
{{- with .Values.rostersSchedulerJob.podLabels }}
27+
{{- toYaml . | nindent 12 }}
28+
{{- end }}
29+
spec:
30+
containers:
31+
- name: thub-event-scheduler-job
32+
image: "{{ .Values.rostersSchedulerJob.image.repository }}:{{ .Values.rostersSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}"
33+
imagePullPolicy: {{ .Values.rostersSchedulerJob.image.pullPolicy }}
34+
command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.rostersSchedulerJobInputFile" . }}"]
35+
ports:
36+
- containerPort: {{ .Values.rostersSchedulerJob.port }}
37+
name: http-server
38+
resources:
39+
{{- toYaml .Values.global.eventSchedulerResources | nindent 14 }}
40+
env:
41+
- name: server.port
42+
value: {{ .Values.rostersSchedulerJob.port | quote }}
43+
- name: hclabs.scheduler.destinationQueue
44+
value: {{ include "thub.sfLmsDataJobQueueName" . }}
45+
- name: micronaut.jms.activemq.classic.connection-string
46+
valueFrom:
47+
configMapKeyRef:
48+
name: mq-broker-config
49+
key: spring.activemq.brokerUrl
50+
- name: micronaut.jms.activemq.classic.username
51+
valueFrom:
52+
configMapKeyRef:
53+
name: mq-broker-config
54+
key: spring.activemq.user
55+
- name: micronaut.jms.activemq.classic.password
56+
valueFrom:
57+
configMapKeyRef:
58+
name: mq-broker-config
59+
key: spring.activemq.password
60+
volumeMounts:
61+
- name: message-file
62+
mountPath: /home/app/temp
63+
readOnly: true
64+
volumes:
65+
- name: message-file
66+
configMap:
67+
# Provide the name of the ConfigMap containing the files you want
68+
# to add to the container
69+
name: {{ include "lms-data-service.eventSchedulerInputFilesConfigmapName" . }}
70+
restartPolicy: {{ .Values.rostersSchedulerJob.restartPolicy }}
71+
{{- end }}

charts/thub/charts/lms-data-service/values.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,23 @@ learningHistoryUploadJob:
251251
podAnnotations: {}
252252
podLabels: {}
253253

254+
rostersSchedulerJob:
255+
enabled: false
256+
# Run on the 27th minute of every hour from 14 thru 23 and 5
257+
schedule: "27 14-23,5 * * *"
258+
concurrencyPolicy: "Replace"
259+
# Overrides the default JSON file used by the job
260+
jsonInputFile: ""
261+
image:
262+
repository: 342628741687.dkr.ecr.us-west-2.amazonaws.com/thub-event-scheduler-cli-job
263+
pullPolicy: IfNotPresent
264+
# Overrides the image tag whose default is the helper "thub.eventSchedulerJobTag".
265+
tag: ""
266+
port: 8099
267+
restartPolicy: Never
268+
podAnnotations: {}
269+
podLabels: {}
270+
254271
global:
255272
# Resources for the thub-event-scheduler-job container
256273
eventSchedulerResources: {}

0 commit comments

Comments
 (0)