diff --git a/charts/thub/Chart.yaml b/charts/thub/Chart.yaml index 65d2ca5..7e9a52d 100644 --- a/charts/thub/Chart.yaml +++ b/charts/thub/Chart.yaml @@ -6,7 +6,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.10.12 +version: 1.11.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -23,7 +23,7 @@ dependencies: - name: keycloak-config version: 0.1.2 - name: lms-data-service - version: 1.8.3 + version: 1.9.0 - name: ojt version: 1.7.3 - name: user-service diff --git a/charts/thub/charts/lms-data-service/Chart.yaml b/charts/thub/charts/lms-data-service/Chart.yaml index a2177ea..a3ab23f 100644 --- a/charts/thub/charts/lms-data-service/Chart.yaml +++ b/charts/thub/charts/lms-data-service/Chart.yaml @@ -7,7 +7,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.8.3 +version: 1.9.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/thub/charts/lms-data-service/templates/_helpers.tpl b/charts/thub/charts/lms-data-service/templates/_helpers.tpl index 8d5d13c..61d3fc9 100644 --- a/charts/thub/charts/lms-data-service/templates/_helpers.tpl +++ b/charts/thub/charts/lms-data-service/templates/_helpers.tpl @@ -226,6 +226,25 @@ Create the name of the JSON file used by the learning-history-upload-job {{- end }} {{- end }} +{{/* +Create the name of the CronJob managers-scheduler-job +*/}} +{{- define "lms-data-service.managersSchedulerJobName" -}} +{{ include "lms-data-service.name" . }}-managers-scheduler-job +{{- end }} + +{{/* +Create the name of the JSON file used by the managers-scheduler-job +*/}} +{{- define "lms-data-service.managersSchedulerJobInputFile" -}} +{{- if .Values.managersSchedulerJob.jsonInputFile -}} +{{ print .Values.managersSchedulerJob.jsonInputFile }} +# The Managers data sync job can only be used by WORKDAY environments currently. +{{- else if eq .Values.global.lmsType "WORKDAY" -}} +{{ print "./temp/start-managers-web-job.json" }} +{{- end }} +{{- end }} + {{/* Create the name of the CronJob rosters-scheduler-job */}} diff --git a/charts/thub/charts/lms-data-service/templates/event-scheduler-job-input-files-configmap.yaml b/charts/thub/charts/lms-data-service/templates/event-scheduler-job-input-files-configmap.yaml index b088d8e..7a81b83 100644 --- a/charts/thub/charts/lms-data-service/templates/event-scheduler-job-input-files-configmap.yaml +++ b/charts/thub/charts/lms-data-service/templates/event-scheduler-job-input-files-configmap.yaml @@ -74,6 +74,12 @@ data: "instruction": "START", "communicationType": "WEBSERVICE" } + start-managers-web-job.json: | + { + "type": "MANAGERS", + "instruction": "START", + "communicationType": "WEBSERVICE" + } start-rosters-web-job.json: | { "type": "ROSTERS", diff --git a/charts/thub/charts/lms-data-service/templates/managers-scheduler-job.yaml b/charts/thub/charts/lms-data-service/templates/managers-scheduler-job.yaml new file mode 100644 index 0000000..9bbec6e --- /dev/null +++ b/charts/thub/charts/lms-data-service/templates/managers-scheduler-job.yaml @@ -0,0 +1,74 @@ +{{- if .Values.managersSchedulerJob.enabled -}} +{{- if ne .Values.global.lmsType "WORKDAY" -}} +{{- fail "The Managers data sync job (.Values.managersSchedulerJob.enabled) can only be enabled when .Values.global.lmsType is set to 'WORKDAY'." -}} +{{- end -}} +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ include "lms-data-service.managersSchedulerJobName" . }} + # These labels do not also get added to the pods created by this job + labels: + {{- include "lms-data-service.labels" . | nindent 4 }} + jobCommonName: lms-managers-scheduler-job + annotations: + description: > + Sends a message to the LMS Data Service application via ActiveMQ notifying it to + load managers from the LMS. +spec: + schedule: {{ .Values.managersSchedulerJob.schedule | quote }} + concurrencyPolicy: {{ .Values.managersSchedulerJob.concurrencyPolicy | quote }} + jobTemplate: + spec: + template: + metadata: + annotations: + {{- with .Values.managersSchedulerJob.podAnnotations }} + {{- toYaml . | nindent 12 }} + {{- end }} + labels: + {{- with .Values.managersSchedulerJob.podLabels }} + {{- toYaml . | nindent 12 }} + {{- end }} + spec: + containers: + - name: thub-event-scheduler-job + image: "{{ .Values.managersSchedulerJob.image.repository }}:{{ .Values.managersSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}" + imagePullPolicy: {{ .Values.managersSchedulerJob.image.pullPolicy }} + command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.managersSchedulerJobInputFile" . }}"] + ports: + - containerPort: {{ .Values.managersSchedulerJob.port }} + name: http-server + resources: + {{- toYaml .Values.global.eventSchedulerResources | nindent 14 }} + env: + - name: server.port + value: {{ .Values.managersSchedulerJob.port | quote }} + - name: hclabs.scheduler.destinationQueue + value: {{ include "thub.sfLmsDataJobQueueName" . }} + - name: micronaut.jms.activemq.classic.connection-string + valueFrom: + configMapKeyRef: + name: mq-broker-config + key: spring.activemq.brokerUrl + - name: micronaut.jms.activemq.classic.username + valueFrom: + configMapKeyRef: + name: mq-broker-config + key: spring.activemq.user + - name: micronaut.jms.activemq.classic.password + valueFrom: + configMapKeyRef: + name: mq-broker-config + key: spring.activemq.password + volumeMounts: + - name: message-file + mountPath: /home/app/temp + readOnly: true + volumes: + - name: message-file + configMap: + # Provide the name of the ConfigMap containing the files you want + # to add to the container + name: {{ include "lms-data-service.eventSchedulerInputFilesConfigmapName" . }} + restartPolicy: {{ .Values.managersSchedulerJob.restartPolicy }} +{{- end }} diff --git a/charts/thub/charts/lms-data-service/values.yaml b/charts/thub/charts/lms-data-service/values.yaml index 2579330..097a281 100644 --- a/charts/thub/charts/lms-data-service/values.yaml +++ b/charts/thub/charts/lms-data-service/values.yaml @@ -259,6 +259,23 @@ learningHistoryUploadJob: podAnnotations: {} podLabels: {} +managersSchedulerJob: + enabled: false + # Run on the eighteenth minute of every 5th hour + schedule: "18 */5 * * *" + concurrencyPolicy: "Replace" + # Overrides the default JSON file used by the job + jsonInputFile: "" + image: + repository: 342628741687.dkr.ecr.us-west-2.amazonaws.com/thub-event-scheduler-cli-job + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the helper "thub.eventSchedulerJobTag". + tag: "" + port: 8099 + restartPolicy: Never + podAnnotations: {} + podLabels: {} + rostersSchedulerJob: enabled: false # Run on the 27th minute of every hour from 14 thru 23 and 5 diff --git a/charts/thub/ci/workday-test-values.yaml b/charts/thub/ci/workday-test-values.yaml new file mode 100644 index 0000000..24d0d40 --- /dev/null +++ b/charts/thub/ci/workday-test-values.yaml @@ -0,0 +1,79 @@ +# This file has test values to use when the chart is being linted +# https://github.com/helm/chart-testing/blob/master/doc/ct_lint.md +# The values are as though the chart is being deployed for a Workday integrated system. + +lmsType: "WORKDAY" + +managersSchedulerJob: + enabled: true + +rostersSchedulerJob: + enabled: true + +# Now the rest of this file is the same as charts/thub/ci/test-values.yaml + +# AWS credentials for S3 access +awsS3keyId: "exampleId" +awsS3secretKey: "verySecretKey" + +assigned-item-service: + # The datasource info for connecting the Grails application to the database + dataSource: + username: "test_username" + password: "test_password" + url: "jdbc:mysql://example.us-east-1.rds.amazonaws.com:3306/schema_name" + +item-service: + # The datasource info for connecting the Grails application to the database + dataSource: + username: "test_username" + password: "test_password" + url: "jdbc:mysql://example.us-east-1.rds.amazonaws.com:3306/schema_name" + +lms-data-service: + # The datasource info for connecting the Grails application to the database + dataSource: + username: "test_username" + password: "test_password" + url: "jdbc:mysql://example.us-east-1.rds.amazonaws.com:3306/schema_name" + # Encryption key for storing sensitive values in the database + encryptionPassword: "test_password" + # Connection info for the SFTP that the LMS interacts with + sftp: + host: "sftp8.sapsf.com" + user: "my_test_user" + password: "test_password" + downloadDirectory: "FEED/DOWNLOAD/ROLLCALL" + uploadDirectory: "FEED/UPLOAD" + +ojt: + # The datasource info for connecting the Grails application to the database + dataSource: + username: "test_username" + password: "test_password" + url: "jdbc:mysql://example.us-east-1.rds.amazonaws.com:3306/schema_name" + +user-service: + # The datasource info for connecting the Grails application to the database + dataSource: + username: "test_username" + password: "test_password" + url: "jdbc:mysql://example.us-east-1.rds.amazonaws.com:3306/schema_name" + +keycloak-config: + # The username for the database that Keycloak connects to + databaseUsername: "example_keycloak_username" + # The password for the database that Keycloak connects to + databasePassword: "example_keycloak_password" + # Keycloak configuration values + realmName: "test-realm" + clientId: "ojt" + clientSecret: "abcdefg" + # Credentials for the admin of the Keycloak server (master realm) + masterAdminUsername: "test-admin" + # checkov:skip=CKV_SECRET_6:This entire file is just test values + masterAdminPassword: "examplePassword" + # Credentials for an admin of this realm + realmAdminUsername: "realm-admin-username" + # checkov:skip=CKV_SECRET_6:This entire file is just test values + realmAdminPassword: "anotherPassword" diff --git a/charts/thub/values.yaml b/charts/thub/values.yaml index 5764a91..b3fa382 100644 --- a/charts/thub/values.yaml +++ b/charts/thub/values.yaml @@ -239,6 +239,10 @@ lms-data-service: enabled: true # Run every 33 minutes schedule: "*/33 * * * *" + managersSchedulerJob: + enabled: false + rostersSchedulerJob: + enabled: false ojt: resources: {}