Skip to content

Commit

Permalink
EDIT webwork for 2.18 upgrade
Browse files Browse the repository at this point in the history
New worker, the mojo worker. I've just copied the old worker section and
renamed it. Now we have two worker sections in values, one is
worker.lti1p3 and the other is worker.mojo

The new webwork container serves on port 8080 instead of the old 80. I'm
kinda surprised we only needed to change this in one spot but since it
seems to work, not complaining.
  • Loading branch information
ionparticle committed Apr 18, 2024
1 parent 64e3d58 commit 8704d5b
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 27 deletions.
2 changes: 1 addition & 1 deletion webwork/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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: 0.1.5
version: 0.1.6

# 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
Expand Down
2 changes: 2 additions & 0 deletions webwork/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ env:
value: {{ .Values.db.auth.username | quote }}
- name: SKIP_UPLOAD_OPL_statistics
value: "true"
- name: MOJO_PUBSUB_EXPERIMENTAL
value: "1"
volumeMounts:
- name: webwork-course-data
mountPath: /opt/webwork/courses
Expand Down
74 changes: 64 additions & 10 deletions webwork/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
{{- include "webwork.app.spec" . | indent 10 }}
ports:
- name: http
containerPort: 80
containerPort: 8080
protocol: TCP
{{- if .Values.service.hostPort }}
hostPort: {{ .Values.service.hostPort }}
Expand Down Expand Up @@ -69,17 +69,17 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}

{{if .Values.worker.enabled -}}
{{if .Values.worker.lti1p3.enabled -}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "webwork.fullname" . }}-worker
name: {{ include "webwork.fullname" . }}-worker-lti1p3
labels:
{{- include "webwork.labels" . | nindent 4 }}
tier: worker
spec:
replicas: {{ .Values.worker.replicaCount }}
replicas: {{ .Values.worker.lti1p3.replicaCount }}
selector:
matchLabels:
{{- include "webwork.selectorLabels" . | nindent 6 }}
Expand All @@ -102,22 +102,76 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-worker
- name: {{ .Chart.Name }}-worker-lti1p3
{{- include "webwork.app.spec" . | indent 10 }}
args: ['./webwork2/lib/DelayedJob/Run/run_all_jobs.pl']
args: ['./lib/DelayedJob/Run/run_all_jobs.pl']
resources:
{{- toYaml .Values.worker.resources | nindent 12 }}
{{- toYaml .Values.worker.lti1p3.resources | nindent 12 }}
volumes:
{{- include "webwork.app.mounts" . | indent 8 }}
{{- with .Values.worker.nodeSelector }}
{{- with .Values.worker.lti1p3.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.worker.affinity }}
{{- with .Values.worker.lti1p3.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.worker.tolerations }}
{{- with .Values.worker.lti1p3.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

{{if .Values.worker.mojo.enabled -}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "webwork.fullname" . }}-worker-mojo
labels:
{{- include "webwork.labels" . | nindent 4 }}
tier: worker
spec:
replicas: {{ .Values.worker.mojo.replicaCount }}
selector:
matchLabels:
{{- include "webwork.selectorLabels" . | nindent 6 }}
tier: worker
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "webwork.selectorLabels" . | nindent 8 }}
tier: worker
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "webwork.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-worker-mojo
{{- include "webwork.app.spec" . | indent 10 }}
args: ['sudo', '-E', '-u', 'www-data', 'bin/webwork2', 'minion', 'worker', '-m', 'production']
resources:
{{- toYaml .Values.worker.mojo.resources | nindent 12 }}
volumes:
{{- include "webwork.app.mounts" . | indent 8 }}
{{- with .Values.worker.mojo.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.worker.mojo.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.worker.mojo.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
30 changes: 14 additions & 16 deletions webwork/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,22 +338,20 @@ r:
port: 6311

worker:
enabled: true
replicaCount: 1
nodeSelector: {}
tolerations: []
affinity: {}
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
lti1p3:
enabled: true
replicaCount: 1
nodeSelector: {}
tolerations: []
affinity: {}
resources: {}
mojo:
enabled: true
replicaCount: 1
nodeSelector: {}
tolerations: []
affinity: {}
resources: {}

cronjob:
lti_update_classlist:
Expand Down

0 comments on commit 8704d5b

Please sign in to comment.