Skip to content

Commit

Permalink
Merge 680444e into c47b082
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk authored Jan 13, 2025
2 parents c47b082 + 680444e commit 02cda80
Show file tree
Hide file tree
Showing 20 changed files with 688 additions and 114 deletions.
12 changes: 9 additions & 3 deletions charts/operator-wandb/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ dependencies:
- name: app
repository: file://charts/app
version: 0.1.0
- name: wandb-base
repository: file://../wandb-base
version: 0.3.0
- name: console
repository: file://charts/console
version: 0.1.0
Expand Down Expand Up @@ -55,6 +58,9 @@ dependencies:
version: 0.1.0
- name: wandb-base
repository: file://../wandb-base
version: 0.1.1
digest: sha256:49d1e4088513e55b9824284c9f5a80d3c70c9fab0195e6cc5650731fb2670a06
generated: "2025-01-13T09:43:24.543619-08:00"
version: 0.3.0
- name: wandb-base
repository: file://../wandb-base
version: 0.3.0
digest: sha256:c0bbd695dffdd8b72a2453d6eb113bc048f7c89a31d2b929baa77cf5e77f6d63
generated: "2025-01-13T12:35:58.707616-06:00"
12 changes: 11 additions & 1 deletion charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: operator-wandb
description: A Helm chart for deploying W&B to Kubernetes
type: application
version: 0.22.5
version: 0.23.0
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand All @@ -16,6 +16,11 @@ dependencies:
version: "*.*.*"
repository: file://charts/app
condition: app.install
- name: wandb-base
alias: api
condition: global.beta.api.enabled
repository: file://../wandb-base
version: "*.*.*"
- name: console
version: "*.*.*"
repository: file://charts/console
Expand Down Expand Up @@ -89,3 +94,8 @@ dependencies:
condition: global.beta.glue.enabled
repository: file://../wandb-base
version: "*.*.*"
- name: wandb-base
alias: settingsMigrationHook
condition: settingsMigrationHook.install
repository: file://../wandb-base
version: "*.*.*"
31 changes: 31 additions & 0 deletions charts/operator-wandb/charts/app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ spec:
resource: limits.memory
- name: GLUE_ENABLED
value: "{{ not .Values.global.beta.glue.enabled }}"
## TODO: Turn this on when we are ready to remove the gorilla service from wandb/local
# {{- if .Values.global.beta.api.enabled }}
# - name: GORILLA_ENABLED
# value: "{{ not .Values.global.beta.api.enabled }}"
# - name: PROXY_PASS_BACKEND_HOST
# value: "$({{.Release.Name | upper | replace "-" "_" }}_API_SERVICE_HOST):$({{.Release.Name | upper | replace "-" "_" }}_API_SERVICE_PORT)"
# {{- end }}
- name: BUCKET_ACCESS_KEY
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -309,6 +316,8 @@ spec:

{{- include "app.extraEnv" (dict "global" $.Values.global "local" .Values) | nindent 12 }}
{{- include "wandb.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
## TODO: If we want to remove the api service from wandb/local, we can uncomment this if else block
# {{- if not .Values.global.beta.api.enabled }}
livenessProbe:
httpGet:
path: /healthz
Expand All @@ -326,6 +335,28 @@ spec:
initialDelaySeconds: 20
periodSeconds: 5
failureThreshold: 120
# {{- else }}
# # If we disabled the api, we still want to have a healthcheck fror the frontend/nginx
# # We also can't just disable the migrations which would make the health endpint return 200
# # because glue, parquet, and filemeta are still running in the local container.
# livenessProbe:
# httpGet:
# path: /proxy/healthz
# port: http
# readinessProbe:
# httpGet:
# path: /proxy/healthz
# port: http
# initialDelaySeconds: 20
# periodSeconds: 5
# startupProbe:
# httpGet:
# path: /proxy/healthz
# port: http
# initialDelaySeconds: 20
# periodSeconds: 5
# failureThreshold: 120
# {{- end }}
# Increase the sleep before SIGTERM to 25s. I had this as 5s previously and it wasn't enough.
lifecycle:
preStop:
Expand Down
18 changes: 17 additions & 1 deletion charts/operator-wandb/templates/_ingress.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,27 @@ It expects a dictionary with two entries:
port:
number: 8080
{{- end }}
{{- if .Values.global.beta.api.enabled }}
- pathType: Prefix
path: /api
backend:
service:
name: {{ $.Release.Name }}-api
port:
number: 8080
- pathType: Prefix
path: /graphql
backend:
service:
name: {{ $.Release.Name }}-api
port:
number: 8080
{{- end }}
- pathType: Prefix
path: /console
backend:
service:
name: {{ $.Release.Name }}-console
port:
number: 8082
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/operator-wandb/templates/bucket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ metadata:
name: {{ include "wandb.bucket.config" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- if .Values.settingsMigrationHook.install }}
{{- with .Values.global.settingsMigrationHook.helmHookAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
data:
{{- with include "wandb.bucket" . | fromYaml }}
BUCKET_NAME: "{{ .name }}"
Expand All @@ -19,6 +25,12 @@ metadata:
name: {{ include "wandb.bucket.secret" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- if .Values.settingsMigrationHook.install }}
{{- with .Values.global.settingsMigrationHook.helmHookAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
data:
{{- with include "wandb.bucket" . | fromYaml }}
{{- if .accessKey }}
Expand Down
10 changes: 3 additions & 7 deletions charts/operator-wandb/templates/gorilla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ stringData:
{{- else }}
GORILLA_EMAIL_SINK: "https://api.wandb.ai/email/dispatch"
{{- end }}
SLACK_SECRET: {{ default "" .Values.global.slack.secret | b64enc }}
SLACK_SECRET: {{ default "" .Values.global.slack.secret }}
{{- if and (not .Values.global.licenseSecret.name) (not .Values.global.licenseSecret.key) .Values.global.license }}
LICENSE: {{ .Values.global.license | b64enc }}
GORILLA_LICENSE: {{ .Values.global.license | b64enc }}
LICENSE: {{ .Values.global.license }}
GORILLA_LICENSE: {{ .Values.global.license }}
{{- end }}
{{- if ne .Values.global.auth.oidc.clientId "" }}
OIDC_CLIENT_SECRET: {{ .Values.global.auth.oidc.secret }}
Expand Down Expand Up @@ -86,7 +86,3 @@ data:
GORILLA_TASK_QUEUE: "noop://"
GORILLA_TASK_QUEUE_WORKER_ENABLED: "false"
{{- end }}
{{- with include "wandb.bucket" . | fromYaml }}
GORILLA_FILE_STORE: "{{ .url }}"
GORILLA_STORAGE_BUCKET: "{{ .url }}"
{{- end }}
16 changes: 16 additions & 0 deletions charts/operator-wandb/templates/session-key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-gorilla-session-key
annotations:
"helm.sh/resource-policy": "keep"
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
type: Opaque
data:
# Retrieve the secret data using lookup function and when not exists, return an empty dictionary / map as result
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace (printf "%s-gorilla-session-key" .Release.Name)) | default dict }}
{{- $secretData := (get $secretObj "data") | default dict }}
# Set $gorillaSessionKey to existing secret data or generate a random one when not exists
{{- $gorillaSessionKey := (get $secretData "GORILLA_SESSION_KEY") | default (randAlphaNum 32 | b64enc) }}
GORILLA_SESSION_KEY: {{ $gorillaSessionKey | quote }}
20 changes: 20 additions & 0 deletions charts/operator-wandb/templates/settings-migration-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.settingsMigrationHook.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 }}
{{- with include "wandb.bucket" . | fromYaml }}
AWS_REGION: "{{ .region }}"
AWS_S3_KMS_ID: "{{ .kmsKey }}"
{{- end }}
{{- end }}

Loading

0 comments on commit 02cda80

Please sign in to comment.