-
Notifications
You must be signed in to change notification settings - Fork 73
Adding SGP-related extensible configuration to the model engine helm chart #762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a08b381
32ef0de
76a0b1e
648be45
2a720ad
bf4155c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| {{- if .Values.db.runDbInitScript }} | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: {{ include "modelEngine.fullname" . }}-database-setup-{{ .Release.Revision }} | ||
| labels: | ||
| {{- include "modelEngine.labels" . | nindent 4 }} | ||
| annotations: | ||
| "helm.sh/hook": pre-install,pre-upgrade | ||
| "helm.sh/hook-weight": "-1" | ||
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
| spec: | ||
| backoffLimit: 0 | ||
| activeDeadlineSeconds: 600 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| sidecar.istio.io/inject: "false" | ||
| {{- include "modelEngine.labels" . | nindent 8 }} | ||
| spec: | ||
| restartPolicy: Never | ||
| {{- with .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} | ||
| containers: | ||
| - name: {{ include "modelEngine.fullname" . }} | ||
| image: "{{ .Values.image.gatewayRepository }}:{{ .Values.tag}}" | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| command: | ||
| - dumb-init | ||
| - -- | ||
| args: | ||
| - python | ||
| - -m | ||
| - model_engine_server.entrypoints.init_database | ||
| {{- include "modelEngine.serviceEnvGitTagFromHelmVar" . | indent 10 }} | ||
| {{- include "modelEngine.volumeMounts" . | indent 10 }} | ||
| serviceAccountName: {{ include "modelEngine.fullname" . }} | ||
| {{- include "modelEngine.volumes" . | indent 6 }} | ||
| {{- with .Values.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.affinity }} | ||
| affinity: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,5 +21,8 @@ metadata: | |||||||||
| imagePullSecrets: | ||||||||||
| - name: egp-ecr-regcred | ||||||||||
| {{- end }} | ||||||||||
| {{- with $.Values.automountServiceAccountToken }} | ||||||||||
| automountServiceAccountToken: {{ . }} | ||||||||||
| {{- end }} | ||||||||||
|
Comment on lines
+24
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Helm's In contrast, the pod-level specs in other templates correctly use
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: charts/model-engine/templates/service_account.yaml
Line: 24-26
Comment:
**`with` skips block when value is `false`**
Helm's `with` treats `false` as falsy, so when `automountServiceAccountToken` is set to `false` (the exact scenario where you want to disable automount on the ServiceAccount), this block will be skipped entirely and `automountServiceAccountToken` won't be rendered into the YAML. Only when the value is `true` will it appear — which is the opposite of the critical behavior.
In contrast, the pod-level specs in other templates correctly use `{{ .Values.automountServiceAccountToken }}` directly without a `with` gate.
```suggestion
automountServiceAccountToken: {{ $.Values.automountServiceAccountToken }}
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||
| --- | ||||||||||
| {{- end }} | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hook weight collision with migration job
Both
database_init_job.yamlanddatabase_migration_job.yamluse"helm.sh/hook-weight": "-1"onpre-install,pre-upgrade. This means Helm does not guarantee execution order between them. Sinceinit_database.pycreates schemas (create schema if not exists) and tables (Base.metadata.create_all), and the migration job applies Alembic migrations that depend on those schemas existing, the migration could run first and fail.Consider setting this job's hook weight to
"-2"(or lower) so it is guaranteed to run before the migration job at weight"-1".Prompt To Fix With AI