Skip to content

Commit

Permalink
Merge branch 'main' into otel
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks authored Oct 16, 2023
2 parents b8dfb1d + c117330 commit f9b29df
Show file tree
Hide file tree
Showing 40 changed files with 125 additions and 1,807 deletions.
2 changes: 1 addition & 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.10.13
version: 0.10.21
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
21 changes: 13 additions & 8 deletions charts/operator-wandb/charts/app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ spec:
{{- toYaml .Values.pod.annotations | nindent 4 }}
{{- end }}
spec:
serviceAccountName: {{ include "app.serviceAccountName" . }}
{{- if .tolerations }}
tolerations:
{{- toYaml .tolerations | nindent 8 }}
Expand Down Expand Up @@ -100,6 +101,13 @@ spec:
- name: MYSQL
value: "mysql://$(MYSQL_USER):$(MYSQL_PASSWORD)@$(MYSQL_HOST):$(MYSQL_PORT)/$(MYSQL_DATABASE)"

- name: WEAVE_SERVICE
value: "{{ .Release.Name }}-weave:9994"
- name: PARQUET_HOST
value: "http://{{ .Release.Name }}-parquet:8087"
- name: PARQUET_ENABLED
value: "true"

{{- if ne (include "wandb.redis.password" .) "" }}
- name: REDIS_PASSWORD
valueFrom:
Expand All @@ -114,14 +122,6 @@ spec:
- name: REDIS
value: "{{ include "app.redis" . | trim }}"

- name: WEAVE_SERVICE
value: "{{ .Release.Name }}-weave:9994"

- name: PARQUET_HOST
value: "http://{{ .Release.Name }}-parquet:8087"
- name: PARQUET_ENABLED
value: "true"

- name: SLACK_CLIENT_ID
value: {{ .Values.global.slack.clientId }}
- name: SLACK_SECRET
Expand Down Expand Up @@ -175,6 +175,11 @@ spec:
name: "{{ include "wandb.bucket.secret" . }}"
key: ACCESS_KEY
optional: true

- name: GORILLA_CUSTOMER_SECRET_STORE_K8S_CONFIG_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace

{{- include "app.extraEnv" (dict "global" $.Values.global "local" .Values) | nindent 12 }}
{{- include "wandb.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
Expand Down
23 changes: 23 additions & 0 deletions charts/operator-wandb/charts/app/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "app.fullname" . }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "app.commonLabels" . | nindent 4 }}
{{- include "app.labels" . | nindent 4 }}
{{- if .Values.role.labels -}}
{{- toYaml .Values.role.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.role.annotations -}}
{{- toYaml .Values.role.annotations | nindent 4 }}
{{- end }}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "create", "update", "delete"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get"]
23 changes: 23 additions & 0 deletions charts/operator-wandb/charts/app/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "app.fullname" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "app.commonLabels" . | nindent 4 }}
{{- include "app.labels" . | nindent 4 }}
{{- if .Values.role.labels -}}
{{- toYaml .Values.role.labels | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.role.annotations -}}
{{- toYaml .Values.role.annotations | nindent 4 }}
{{- end }}
roleRef:
kind: ClusterRole
apiGroup: rbac.authorization.k8s.io
name: {{ include "app.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "app.fullname" . }}
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "prometheus.fullname" . }}
name: {{ include "app.serviceAccountName" . }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "prometheus.commonLabels" . | nindent 4 }}
{{- include "prometheus.labels" . | nindent 4 }}
{{- include "app.commonLabels" . | nindent 4 }}
{{- include "app.labels" . | nindent 4 }}
{{- if .Values.serviceAccount.labels -}}
{{- toYaml .Values.serviceAccount.labels | nindent 4 }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions charts/operator-wandb/charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ resources:
limits:
cpu: 4000m
memory: 8Gi

serviceAccount:
create: true

role: {}
roleBinding: {}
14 changes: 14 additions & 0 deletions charts/operator-wandb/charts/parquet/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{- define "parquet.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 }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down Expand Up @@ -108,6 +118,10 @@ app deployments.
{{- printf "gs://%s" .Values.global.bucket.name -}}
{{- end }}
{{- if eq .Values.global.bucket.provider "s3" }}
{{- if and .Values.global.bucket.accessKey .Values.global.bucket.secretKey}}
{{- printf "s3://%s:%s@%s" .Values.global.bucket.accessKey .Values.global.bucket.secretKey .Values.global.bucket.name -}}
{{- else }}
{{- printf "s3://%s" .Values.global.bucket.name -}}
{{- end }}
{{- end }}
{{- end }}
38 changes: 38 additions & 0 deletions charts/operator-wandb/charts/parquet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
volumeMounts:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "parquet.fullname" . }}-redis-ca
mountPath: /etc/ssl/certs/redis_ca.pem
subPath: redis_ca.pem
{{- end }}
ports:
- name: parquet
containerPort: 8087
Expand Down Expand Up @@ -71,6 +77,23 @@ spec:
- name: MYSQL
value: "mysql://$(MYSQL_USER):$(MYSQL_PASSWORD)@$(MYSQL_HOST):$(MYSQL_PORT)/$(MYSQL_DATABASE)"

{{- if ne (include "wandb.redis.password" .) "" }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
key: REDIS_PASSWORD
{{- end }}
- name: REDIS_PORT
value: "{{ include "wandb.redis.port" . }}"
- name: REDIS_HOST
value: "{{ include "wandb.redis.host" . }}"
- name: REDIS
value: "{{ include "parquet.redis" . | trim }}"

- name: GORILLA_SETTINGS_CACHE
value: "{{ include "parquet.redis" . | trim }}"

- name: BUCKET
value: "{{ include "parquet.bucket" . }}"
- name: BUCKET_QUEUE
Expand All @@ -79,10 +102,25 @@ spec:
value: {{ .Values.global.bucket.region }}
- name: AWS_S3_KMS_ID
value: "{{ .Values.global.bucket.kmsKey }}"
- name: AZURE_STORAGE_KEY
valueFrom:
secretKeyRef:
name: "{{ include "wandb.bucket.secret" . }}"
key: ACCESS_KEY
optional: true

{{- include "parquet.extraEnv" (dict "global" .Values.global "local" .Values) | nindent 12 }}
{{- include "wandb.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}

resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "parquet.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
{{- end }}
{{- end }}
10 changes: 4 additions & 6 deletions charts/operator-wandb/charts/parquet/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{- if .Values.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "weave.fullname" . }}
name: {{ include "parquet.fullname" . }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "weave.labels" . | nindent 4 }}
{{- include "weave.commonLabels" . | nindent 4 }}
{{- include "parquet.labels" . | nindent 4 }}
{{- include "parquet.commonLabels" . | nindent 4 }}
{{- if .Values.service.labels -}}
{{- toYaml .Values.service.labels | nindent 4 }}
{{- end }}
Expand All @@ -21,5 +20,4 @@ spec:
protocol: TCP
name: parquet
selector:
{{- include "weave.labels" . | nindent 4 }}
{{- end }}
{{- include "parquet.labels" . | nindent 4 }}
23 changes: 0 additions & 23 deletions charts/operator-wandb/old/prometheus/.helmignore

This file was deleted.

25 changes: 0 additions & 25 deletions charts/operator-wandb/old/prometheus/Chart.yaml

This file was deleted.

87 changes: 0 additions & 87 deletions charts/operator-wandb/old/prometheus/README.md

This file was deleted.

Loading

0 comments on commit f9b29df

Please sign in to comment.