-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
497 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: v2 | ||
name: executor | ||
description: Chart for deploying the executor | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "0.33.0" | ||
home: https://wandb.ai | ||
icon: https://wandb.ai/logo.svg | ||
maintainers: | ||
- name: wandb | ||
email: support@wandb.com | ||
url: https://wandb.com |
129 changes: 129 additions & 0 deletions
129
charts/operator-wandb/charts/executor/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "executor.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "executor.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "executor.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "executor.labels" -}} | ||
helm.sh/chart: {{ include "executor.chart" . }} | ||
{{ include "executor.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Returns the extraEnv keys and values to inject into containers. | ||
Global values will override any chart-specific values. | ||
*/}} | ||
{{- define "executor.extraEnv" -}} | ||
{{- $allExtraEnv := merge (default (dict) .local.extraEnv) .global.extraEnv -}} | ||
{{- range $key, $value := $allExtraEnv }} | ||
- name: {{ $key }} | ||
value: {{ $value | quote }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Returns a list of _common_ labels to be shared across all | ||
executor deployments and other shared objects. | ||
*/}} | ||
{{- define "executor.commonLabels" -}} | ||
{{- $commonLabels := default (dict) .Values.common.labels -}} | ||
{{- if $commonLabels }} | ||
{{- range $key, $value := $commonLabels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Returns a list of _pod_ labels to be shared across all | ||
executor deployments. | ||
*/}} | ||
{{- define "executor.podLabels" -}} | ||
{{- range $key, $value := .Values.pod.labels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end -}} | ||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "executor.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "executor.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "executor.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "executor.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "executor.redis" -}} | ||
{{- $cs := include "wandb.redis.connectionString" . }} | ||
{{- $ca := include "wandb.redis.caCert" . }} | ||
{{- if $ca }} | ||
{{- printf "%s?tls=true&caCertPath=/etc/ssl/certs/redis_ca.pem&ttlInSeconds=604800" $cs -}} | ||
{{- else }} | ||
{{- print $cs -}} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "executor.bucket" -}} | ||
{{- $bucketValues := .Values.global.defaultBucket }} | ||
{{- if .Values.global.bucket.provider }} | ||
{{- $bucketValues = .Values.global.bucket }} | ||
{{- end }} | ||
{{- $bucket := "" -}} | ||
{{- if eq $bucketValues.provider "az" -}} | ||
{{- $bucket = printf "az://%s/%s" $bucketValues.name (default "" $bucketValues.path) -}} | ||
{{- end -}} | ||
{{- if eq $bucketValues.provider "gcs" -}} | ||
{{- $bucket = printf "gs://%s/%s" $bucketValues.name (default "" $bucketValues.path) -}} | ||
{{- end -}} | ||
{{- if eq $bucketValues.provider "s3" -}} | ||
{{- if and $bucketValues.accessKey $bucketValues.secretKey -}} | ||
{{- $bucket = printf "s3://%s:%s@%s/%s" $bucketValues.accessKey $bucketValues.secretKey $bucketValues.name (default "" $bucketValues.path) -}} | ||
{{- else -}} | ||
{{- $bucket = printf "s3://%s/%s" $bucketValues.name (default "" $bucketValues.path) -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- trimSuffix "/" $bucket -}} | ||
{{- end -}} |
172 changes: 172 additions & 0 deletions
172
charts/operator-wandb/charts/executor/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{{- if .Values.install }} | ||
{{- $imageCfg := dict "global" $.Values.global.image "local" $.Values.image -}} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "executor.fullname" . }} | ||
labels: | ||
{{- include "wandb.commonLabels" . | nindent 4 }} | ||
{{- include "executor.commonLabels" . | nindent 4 }} | ||
{{- include "executor.labels" . | nindent 4 }} | ||
{{- if .Values.deployment.labels -}} | ||
{{- toYaml .Values.deployment.labels | nindent 4 }} | ||
{{- end }} | ||
annotations: | ||
{{- include "wandb.deploymentAnnotations" . | nindent 4 }} | ||
{{- if .Values.deployment.annotations -}} | ||
{{- toYaml .Values.deployment.annotations | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if not .Values.autoscaling.enabled }} | ||
replicas: {{ .Values.replicaCount }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "wandb.selectorLabels" $ | nindent 6 }} | ||
{{- include "executor.labels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.pod.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "wandb.podLabels" . | nindent 8 }} | ||
{{- include "executor.labels" . | nindent 8 }} | ||
{{- include "executor.commonLabels" . | nindent 8 }} | ||
{{- include "executor.podLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "executor.serviceAccountName" . }} | ||
{{- include "wandb.nodeSelector" . | nindent 6 }} | ||
{{- include "wandb.priorityClassName" . | nindent 6 }} | ||
{{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} | ||
# needed to ensure ensure Kafka consumers handle pod termination gracefully and avoid data loss | ||
terminationGracePeriodSeconds: 60 | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
{{- include "wandb.containerSecurityContext" .Values.container.securityContext | nindent 10 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
volumeMounts: | ||
{{- if ne (include "wandb.redis.caCert" .) "" }} | ||
- name: {{ include "executor.fullname" . }}-redis-ca | ||
mountPath: /etc/ssl/certs/redis_ca.pem | ||
subPath: redis_ca.pem | ||
{{- end }} | ||
env: | ||
- name: GOMEMLIMIT | ||
valueFrom: | ||
resourceFieldRef: | ||
resource: limits.memory | ||
{{- if ne .Values.traceRatio 0.0 }} | ||
- name: GORILLA_TRACER | ||
value: "otlp+grpc://{{ .Release.Name }}-otel-daemonset:4317?trace_ratio={{ .Values.traceRatio }}" | ||
{{- end }} | ||
- name: ONLY_SERVICE | ||
value: gorilla-executor | ||
- name: LOGGING_ENABLED | ||
value: 'true' | ||
- name: MYSQL_PORT | ||
value: "{{ include "wandb.mysql.port" . }}" | ||
- name: MYSQL_HOST | ||
value: "{{ include "wandb.mysql.host" . }}" | ||
- name: MYSQL_DATABASE | ||
value: "{{ include "wandb.mysql.database" . }}" | ||
- name: MYSQL_USER | ||
value: "{{ include "wandb.mysql.user" . }}" | ||
- name: MYSQL_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "wandb.mysql.passwordSecret" . }} | ||
key: {{ .Values.global.mysql.passwordSecret.passwordKey }} | ||
- name: MYSQL | ||
value: "mysql://$(MYSQL_USER):$(MYSQL_PASSWORD)@$(MYSQL_HOST):$(MYSQL_PORT)/$(MYSQL_DATABASE)" | ||
- name: REDIS_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "wandb.redis.passwordSecret" . }} | ||
optional: true | ||
key: REDIS_PASSWORD | ||
- name: REDIS_PORT | ||
value: "{{ include "wandb.redis.port" . }}" | ||
- name: REDIS_HOST | ||
value: "{{ include "wandb.redis.host" . }}" | ||
- name: REDIS | ||
value: "{{ include "executor.redis" . | trim }}" | ||
|
||
- name: GORILLA_SETTINGS_CACHE | ||
value: "{{ include "executor.redis" . | trim }}" | ||
- name: GORILLA_TASK_QUEUE | ||
value: "{{ include "executor.redis" . | trim }}" | ||
|
||
- name: BUCKET | ||
value: "{{ include "executor.bucket" . }}" | ||
- name: AWS_REGION | ||
value: {{ .Values.global.bucket.region | default .Values.global.defaultBucket.region }} | ||
- name: AWS_S3_KMS_ID | ||
value: "{{ .Values.global.bucket.kmsKey | default .Values.global.defaultBucket.kmsKey }}" | ||
- name: AZURE_STORAGE_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: "{{ include "wandb.bucket.secret" . }}" | ||
key: {{ .Values.global.bucket.accessKeyName }} | ||
optional: true | ||
|
||
- name: G_HOST_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.hostIP | ||
|
||
{{- if ne .Values.global.email.smtp.host "" }} | ||
- name: GORILLA_EMAIL_SINK | ||
value: "smtp://{{ .Values.global.email.smtp.user }}:{{ .Values.global.email.smtp.password }}@{{ .Values.global.email.smtp.host }}:{{ .Values.global.email.smtp.port }}" | ||
{{- end }} | ||
|
||
{{- include "executor.extraEnv" (dict "global" .Values.global "local" .Values) | nindent 12 }} | ||
{{- include "wandb.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }} | ||
|
||
livenessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 8087 | ||
initialDelaySeconds: 30 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 3 | ||
successThreshold: 1 | ||
|
||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 8087 | ||
initialDelaySeconds: 30 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 3 | ||
successThreshold: 1 | ||
|
||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
{{- if ne (include "wandb.redis.caCert" .) "" }} | ||
- name: {{ include "executor.fullname" . }}-redis-ca | ||
secret: | ||
secretName: "{{ .Release.Name }}-redis" | ||
items: | ||
- key: REDIS_CA_CERT | ||
path: redis_ca.pem | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.