Skip to content

Commit 7fa422f

Browse files
Merge branch 'main' into aastha/restric-k8s-permissions
2 parents 6592951 + 94483a7 commit 7fa422f

27 files changed

+824
-17
lines changed

charts/launch-agent/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: launch-agent
33
icon: https://em-content.zobj.net/thumbs/240/apple/354/rocket_1f680.png
44
description: A Helm chart for running the W&B Launch Agent in Kubernetes
55
type: application
6-
version: 0.13.3
6+
version: 0.13.5
77
maintainers:
88
- name: wandb
99

charts/launch-agent/templates/deployment.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ spec:
148148
{{- toYaml .Values.agent.nodeSelector | nindent 8 }}
149149
tolerations:
150150
{{- toYaml .Values.agent.tolerations | nindent 8 }}
151+
affinity:
152+
{{- toYaml .Values.agent.affinity | nindent 8 }}
151153
---
152154
{{- if .Capabilities.APIVersions.Has "policy/v1" }}
153155
apiVersion: policy/v1
@@ -160,4 +162,4 @@ spec:
160162
matchLabels:
161163
app: launch-agent-{{ .Release.Name }}
162164
---
163-
{{- end }}
165+
{{- end }}

charts/launch-agent/values.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ agent:
55
# Providing API key can be done external to this chart
66
useExternalWandbSecret: false
77
# Container image to use for the agent.
8-
image: wandb/launch-agent:0.16.6
8+
image: wandb/launch-agent:0.17.1
99
# Image pull policy for agent image.
1010
imagePullPolicy: Always
1111
# Resources block for the agent spec.
@@ -21,6 +21,8 @@ agent:
2121
minAvailable: 1
2222
# Tolerations for the agent pod.
2323
tolerations: []
24+
# Affinites for the agent pod.
25+
affinity: {}
2426

2527
# Namespace to deploy launch agent into
2628
namespace: wandb

charts/operator-wandb/Chart.lock

+8-2
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,11 @@ dependencies:
2929
- name: flat-run-fields-updater
3030
repository: file://charts/flat-run-fields-updater
3131
version: 0.1.0
32-
digest: sha256:72ce111a55d35fac65edc81862f81dd1c0a6ad747aa2a6b2522966f91b27c814
33-
generated: "2024-03-26T20:48:42.072569696Z"
32+
- name: nginx
33+
repository: file://charts/nginx
34+
version: 0.1.0
35+
- name: stackdriver
36+
repository: file://charts/stackdriver
37+
version: 0.1.0
38+
digest: sha256:9a6c69506deb6969686d5b220a0692b53cfa29642e059bdf27c440c5d7086bdb
39+
generated: "2024-06-05T11:04:02.508473-07:00"

charts/operator-wandb/Chart.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: operator-wandb
33
description: A Helm chart for deploying W&B to Kubernetes
44
type: application
5-
version: 0.13.1
5+
version: 0.13.14
66
appVersion: 1.0.0
77
icon: https://wandb.ai/logo.svg
88

@@ -52,3 +52,11 @@ dependencies:
5252
version: "*.*.*"
5353
repository: file://charts/flat-run-fields-updater
5454
condition: flat-run-fields-updater.install
55+
- name: nginx
56+
version: "*.*.*"
57+
repository: file://charts/nginx
58+
condition: nginx.install
59+
- name: stackdriver
60+
version: "*.*.*"
61+
repository: file://charts/stackdriver
62+
condition: stackdriver.install

charts/operator-wandb/charts/app/templates/deployment.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ spec:
158158
- name: OIDC_CLIENT_ID
159159
value: {{ .Values.global.auth.oidc.clientId }}
160160
- name: OIDC_AUTH_METHOD
161-
value: {{ .Values.global.auth.oidc.method }}
161+
value: {{ .Values.global.auth.oidc.authMethod }}
162162
- name: OIDC_ISSUER
163163
value: {{ .Values.global.auth.oidc.issuer }}
164+
- name: OIDC_CLIENT_SECRET
165+
value: {{ .Values.global.auth.oidc.secret }}
164166
{{- end }}
165167

166168
- name: GORILLA_SESSION_LENGTH
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v2
2+
name: nginx
3+
type: application
4+
description: A Helm chart for Kubernetes
5+
6+
version: 0.1.0
7+
appVersion: "1.25.5"
8+
9+
home: https://wandb.ai
10+
icon: https://wandb.ai/logo.svg
11+
12+
maintainers:
13+
- name: wandb
14+
15+
url: https://wandb.com
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
3+
{{/*
4+
Expand the name of the chart.
5+
*/}}
6+
{{- define "nginx.name" -}}
7+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
8+
{{- end }}
9+
10+
{{/*
11+
Create a default fully qualified nginx name.
12+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
13+
If release name contains chart name it will be used as a full name.
14+
*/}}
15+
{{- define "nginx.fullname" -}}
16+
{{- if .Values.fullnameOverride }}
17+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
18+
{{- else }}
19+
{{- $name := default .Chart.Name .Values.nameOverride }}
20+
{{- if contains $name .Release.Name }}
21+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
22+
{{- else }}
23+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
24+
{{- end }}
25+
{{- end }}
26+
{{- end }}
27+
28+
{{/*
29+
Create chart name and version as used by the chart label.
30+
*/}}
31+
{{- define "nginx.chart" -}}
32+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
33+
{{- end }}
34+
35+
{{/*
36+
Common labels
37+
*/}}
38+
{{- define "nginx.labels" -}}
39+
helm.sh/chart: {{ include "nginx.chart" . }}
40+
{{ include "nginx.selectorLabels" . }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
wandb.com/app-name: {{ include "nginx.chart" . }}
45+
app.kubernetes.io/managed-by: {{ .Release.Service }}
46+
{{- end }}
47+
48+
{{/*
49+
Selector labels
50+
*/}}
51+
{{- define "nginx.selectorLabels" -}}
52+
app.kubernetes.io/name: {{ include "nginx.name" . }}
53+
app.kubernetes.io/instance: {{ .Release.Name }}
54+
{{- end }}
55+
56+
{{/*
57+
Create the name of the service account to use
58+
*/}}
59+
{{- define "nginx.serviceAccountName" -}}
60+
{{- if .Values.serviceAccount.create }}
61+
{{- default (include "nginx.fullname" .) .Values.serviceAccount.name }}
62+
{{- else }}
63+
{{- default "default" .Values.serviceAccount.name }}
64+
{{- end }}
65+
{{- end }}
66+
67+
68+
{{/*
69+
Returns a list of _common_ labels to be shared across all
70+
app deployments and other shared objects.
71+
*/}}
72+
{{- define "nginx.commonLabels" -}}
73+
{{- $commonLabels := default (dict) .Values.common.labels -}}
74+
{{- if $commonLabels }}
75+
{{- range $key, $value := $commonLabels }}
76+
{{ $key }}: {{ $value | quote }}
77+
{{- end }}
78+
{{- end -}}
79+
{{- end -}}
80+
81+
{{/*
82+
Returns a list of _pod_ labels to be shared across all
83+
nginx deployments.
84+
*/}}
85+
{{- define "nginx.podLabels" -}}
86+
{{- range $key, $value := .Values.pod.labels }}
87+
{{ $key }}: {{ $value | quote }}
88+
{{- end }}
89+
{{- end -}}
90+
91+
92+
{{- define "nginx.nodeSelector" -}}
93+
{{- $nodeSelector := default .Values.global.nodeSelector .Values.nodeSelector -}}
94+
{{- if $nodeSelector }}
95+
nodeSelector:
96+
{{- toYaml $nodeSelector | nindent 2 }}
97+
{{- end }}
98+
{{- end -}}
99+
100+
101+
{{/*
102+
Return a PodSecurityContext definition.
103+
104+
Usage:
105+
{{ include "nginx.podSecurityContext" .Values.pod.securityContext }}
106+
*/}}
107+
{{- define "nginx.podSecurityContext" -}}
108+
{{- $psc := . }}
109+
{{- if $psc }}
110+
securityContext:
111+
{{- if not (empty $psc.runAsUser) }}
112+
runAsUser: {{ $psc.runAsUser }}
113+
{{- end }}
114+
{{- if not (empty $psc.runAsGroup) }}
115+
runAsGroup: {{ $psc.runAsGroup }}
116+
{{- end }}
117+
{{- if not (empty $psc.fsGroup) }}
118+
fsGroup: {{ $psc.fsGroup }}
119+
{{- end }}
120+
{{- if not (empty $psc.fsGroupChangePolicy) }}
121+
fsGroupChangePolicy: {{ $psc.fsGroupChangePolicy }}
122+
{{- end }}
123+
{{- end }}
124+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "nginx.fullname" . }}
5+
labels:
6+
{{- include "nginx.commonLabels" . | nindent 4 }}
7+
{{- include "nginx.labels" . | nindent 4 }}
8+
{{- if .Values.configMap.labels -}}
9+
{{- toYaml .Values.configMap.labels | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.configMap.annotations -}}
13+
{{- toYaml .Values.configMap.annotations | nindent 4 }}
14+
{{- end }}
15+
data:
16+
nginx.conf: |
17+
worker_processes auto;
18+
19+
error_log /var/log/nginx/error.log notice;
20+
pid /tmp/nginx.pid;
21+
22+
23+
events {
24+
worker_connections 1024;
25+
}
26+
27+
http {
28+
server {
29+
listen 8080;
30+
location / {
31+
proxy_pass http://{{ .Release.Name }}-app:8080;
32+
}
33+
location /console {
34+
proxy_pass http://{{ .Release.Name }}-console:8082;
35+
}
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{{- if .Values.enabled }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
annotations:
6+
{{- if .Values.deployment.annotations -}}
7+
{{- toYaml .Values.deployment.annotations | nindent 4 }}
8+
{{- end }}
9+
labels:
10+
{{- include "nginx.commonLabels" . | nindent 4 }}
11+
{{- include "nginx.labels" . | nindent 4 }}
12+
{{- if .Values.deployment.labels -}}
13+
{{- toYaml .Values.deployment.labels | nindent 4 }}
14+
{{- end }}
15+
name: {{ include "nginx.fullname" . }}
16+
spec:
17+
replicas: 1
18+
selector:
19+
matchLabels:
20+
{{- include "nginx.labels" . | nindent 6 }}
21+
template:
22+
metadata:
23+
labels:
24+
{{- include "nginx.commonLabels" . | nindent 8 }}
25+
{{- include "nginx.podLabels" . | nindent 8 }}
26+
{{- include "nginx.labels" . | nindent 8 }}
27+
annotations:
28+
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
29+
{{- if .Values.pod.annotations -}}
30+
{{- toYaml .Values.pod.annotations | nindent 8 }}
31+
{{- end }}
32+
spec:
33+
serviceAccountName: {{ include "nginx.serviceAccountName" . }}
34+
{{- if .tolerations }}
35+
tolerations:
36+
{{- toYaml .tolerations | nindent 8 }}
37+
{{- end }}
38+
{{- include "nginx.podSecurityContext" .Values.pod.securityContext | nindent 6 }}
39+
containers:
40+
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
41+
name: {{ .Chart.Name }}
42+
resources:
43+
{{- toYaml .Values.resources | nindent 12 }}
44+
ports:
45+
- containerPort: 8080
46+
volumeMounts:
47+
- name: nginx-config
48+
mountPath: /etc/nginx/nginx.conf
49+
subPath: nginx.conf
50+
volumes:
51+
- name: nginx-config
52+
configMap:
53+
name: {{ include "nginx.fullname" . }}
54+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: {{ include "nginx.fullname" . }}
5+
namespace: {{ $.Release.Namespace }}
6+
labels:
7+
{{- include "nginx.commonLabels" . | nindent 4 }}
8+
{{- include "nginx.labels" . | nindent 4 }}
9+
spec:
10+
scaleTargetRef:
11+
apiVersion: apps/v1
12+
kind: Deployment
13+
name: {{ include "nginx.fullname" . }}
14+
minReplicas: 1
15+
maxReplicas: 1
16+
metrics:
17+
- type: Resource
18+
resource:
19+
name: cpu
20+
target:
21+
type: Utilization
22+
averageUtilization: 70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "nginx.fullname" . }}
5+
labels:
6+
{{- include "nginx.commonLabels" . | nindent 4 }}
7+
{{- include "nginx.labels" . | nindent 4 }}
8+
{{- if .Values.service.labels -}}
9+
{{- toYaml .Values.service.labels | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.service.annotations -}}
13+
{{- toYaml .Values.service.annotations | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
type: {{ .Values.service.type }}
17+
ports:
18+
- protocol: TCP
19+
port: 80
20+
targetPort: 8080
21+
selector:
22+
{{- include "nginx.labels" . | nindent 4 }}

0 commit comments

Comments
 (0)