Skip to content

Commit

Permalink
SMH job
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk committed Jan 14, 2025
1 parent 12fc44e commit a4d892e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 35 deletions.
4 changes: 2 additions & 2 deletions charts/operator-wandb/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ dependencies:
- name: wandb-base
repository: file://../wandb-base
version: 0.3.0
digest: sha256:c0bbd695dffdd8b72a2453d6eb113bc048f7c89a31d2b929baa77cf5e77f6d63
generated: "2025-01-13T12:35:58.707616-06:00"
digest: sha256:3ee5e247e2de8e6911c512fc5c1ef58a463d545365f1c5d3c0f4be28e2ee29fd
generated: "2025-01-13T18:23:28.474058-06:00"
4 changes: 2 additions & 2 deletions charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ dependencies:
repository: file://../wandb-base
version: "*.*.*"
- name: wandb-base
alias: settingsMigrationHook
condition: settingsMigrationHook.install
alias: settingsMigrationJob
condition: settingsMigrationJob.install
repository: file://../wandb-base
version: "*.*.*"
10 changes: 3 additions & 7 deletions charts/operator-wandb/templates/settings-migration-hook.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{{- if .Values.settingsMigrationHook.install }}
{{- if .Values.settingsMigrationJob.install }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-smh-secret
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- with .Values.global.settingsMigrationHook.helmHookAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
stringData:
SMH_DEBUG: {{ .Values.global.settingsMigrationHook.debug | quote }}
SMH_DRY_RUN: {{ .Values.global.settingsMigrationHook.dryRun | quote }}
SMH_DEBUG: {{ .Values.global.settingsMigrationJob.debug | quote }}
SMH_DRY_RUN: {{ .Values.global.settingsMigrationJob.dryRun | quote }}
{{- with include "wandb.bucket" . | fromYaml }}
AWS_REGION: "{{ .region }}"
AWS_S3_KMS_ID: "{{ .kmsKey }}"
Expand Down
9 changes: 1 addition & 8 deletions charts/operator-wandb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ api:
path: redis_ca.pem
optional: true

settingsMigrationHook:
settingsMigrationJob:
install: false
service:
enabled: false
Expand Down Expand Up @@ -816,16 +816,9 @@ settingsMigrationHook:
"{{ .Release.Name }}-bucket-configmap": "configMapRef"
"{{ .Release.Name }}-bucket": "secretRef"
kind: Job
helmHookAnnotations: &helmHookAnnotations
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
jobs:
smh:
ttlSecondsAfterFinished: 3600
annotations:
<<: *helmHookAnnotations
# This ensures that the job is created last
"helm.sh/hook-weight": "10"
containers:
smh:
image:
Expand Down
4 changes: 0 additions & 4 deletions charts/wandb-base/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ metadata:
name: {{ include "wandb-base.fullname" .}}
labels:
{{- include "wandb-base.labels" . | nindent 4 }}
{{- with .Values.helmHookAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
{{- with .Values.role.rules }}
{{- toYaml . | nindent 4 }}
Expand Down
4 changes: 0 additions & 4 deletions charts/wandb-base/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ metadata:
name: {{ include "wandb-base.fullname" . }}
labels:
{{- include "wandb-base.labels" . | nindent 4 }}
{{- with .Values.helmHookAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ include "wandb-base.serviceAccountName" . }}
Expand Down
6 changes: 0 additions & 6 deletions charts/wandb-base/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ metadata:
name: {{ include "wandb-base.serviceAccountName" . }}
labels:
{{- include "wandb-base.labels" . | nindent 4 }}
{{- if or .Values.helmHookAnnotations .Values.serviceAccount.annotations }}
annotations:
{{- with .Values.serviceAccount.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.helmHookAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
2 changes: 0 additions & 2 deletions charts/wandb-base/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

helmHookAnnotations: {}

env: {}
envFrom: {}

Expand Down

0 comments on commit a4d892e

Please sign in to comment.