Skip to content

Commit

Permalink
Merge 60526d8 into 15c1c31
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpanzella authored Feb 3, 2025
2 parents 15c1c31 + 60526d8 commit ee34aea
Show file tree
Hide file tree
Showing 11 changed files with 364 additions and 19 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Lint Charts

on:
pull_request:
paths: charts/**

jobs:
lint-test:
runs-on: ubuntu-latest
environment: Helm Charts
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.16.3

# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.11.0

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
70 changes: 70 additions & 0 deletions .github/workflows/test-operator-wandb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test operator-wandb Chart

on:
pull_request:
paths: charts/operator-wandb/**

jobs:
test:
name: Test Chart
strategy:
matrix:
k8s-version: ["v1.32.1", "v1.31.4", "v1.30.8"]
configuration: ["default", "separate-pods"]
runs-on: ubuntu-latest
environment: Helm Charts
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.16.3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.11.0

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Create kind cluster
uses: helm/[email protected]
with:
version: v0.26.0
cluster_name: chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }}
node_image: kindest/node:${{ matrix.k8s-version }}
if: env.ACT || steps.list-changed.outputs.changed == 'true'

- name: Install Minio
run: kubectl --context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} apply -f test-configs/minio/default.yaml
if: env.ACT || steps.list-changed.outputs.changed == 'true'

- name: Wait for Minio to be Ready
run: kubectl --context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} -n minio wait --for=condition=Ready pod/minio --timeout=300s
if: env.ACT || steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
env:
LICENSE: ${{ secrets.LICENSE }}
if: steps.list-changed.outputs.changed == 'true'
run: |
ct install \
--charts ./charts/operator-wandb \
--config ct.yaml \
--helm-extra-args '--kube-context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }}' \
--helm-extra-set-args '--values test-configs/operator-wandb/${{ matrix.configuration }}.yaml --set=license=$LICENSE'
54 changes: 54 additions & 0 deletions .github/workflows/test-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# TODO(dpanzella): Uncomment this file when the ready for automated tests of the operator chart

#name: Test operator Chart
#
#on:
# pull_request:
# paths: charts/operator/**
#
#jobs:
# test:
# runs-on: ubuntu-latest
# environment: Helm Charts
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
#
# - name: Set up Helm
# uses: azure/[email protected]
# with:
# version: v3.16.3
#
# # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# # yamllint (https://github.com/adrienverge/yamllint) which require Python
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"
#
# - name: Set up chart-testing
# uses: helm/[email protected]
# with:
# version: v3.11.0
#
# - name: Run chart-testing (list-changed)
# id: list-changed
# run: |
# changed=$(ct list-changed --config ct.yaml)
# if [[ -n "$changed" ]]; then
# echo "::set-output name=changed::true"
# fi
#
# - name: Create kind cluster
# uses: helm/[email protected]
# with:
# version: v0.20.0
# if: env.ACT || steps.list-changed.outputs.changed == 'true'
#
# - name: Run chart-testing (install)
# env:
# LICENSE: ${{ secrets.LICENSE }}
# if: steps.list-changed.outputs.changed == 'true'
# run: ct install --charts ./charts/operator --config ct.yaml --helm-extra-set-args --set=license=$LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Lint and Test Charts
name: Test wandb Chart

on: pull_request
on:
pull_request:
paths: charts/wandb/**

jobs:
lint-test:
test:
runs-on: ubuntu-latest
environment: Helm Charts
steps:
Expand Down Expand Up @@ -37,9 +39,6 @@ jobs:
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml

- name: Create kind cluster
uses: helm/[email protected]
with:
Expand Down
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.24.8
version: 0.24.9
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
20 changes: 10 additions & 10 deletions charts/operator-wandb/charts/mysql/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ spec:
{{- include "mysql.extraEnv" (dict "global" .Values.global "local" .Values) | nindent 12 }}
{{- include "wandb.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
livenessProbe:
exec:
command:
- sh
- -c
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
tcpSocket:
port: 3306
readinessProbe:
exec:
command:
- sh
- -c
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
tcpSocket:
port: 3306
startupProbe:
initialDelaySeconds: 20
periodSeconds: 5
failureThreshold: 60
tcpSocket:
port: 3306
volumeMounts:
- name: data
mountPath: /var/lib/mysql
Expand Down
4 changes: 2 additions & 2 deletions charts/operator-wandb/charts/mysql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pod:
annotations: {}
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsUser: 999
runAsGroup: 0
fsGroup: 1000
fsGroup: 999
fsGroupChangePolicy: "OnRootMismatch"
seccompProfile:
type: ""
Expand Down
23 changes: 23 additions & 0 deletions charts/operator-wandb/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "wandb.fullname" . }}-test-connection"
labels:
{{- include "wandb.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wandb-verify
image: python:3.10
env:
- name: WANDB_BASE_URL
value: "http://{{ .Release.Name }}-app:8080"
- name: WANDB_API_KEY
value: "test-api-key"
# wandb verify is terribly flaky, there's a PR up to fix it until then we try 3 times
command:
- sh
- -c
- "pip install wandb==0.17.8 && (wandb verify || (sleep 10 && wandb verify) || (sleep 10 && wandb verify))"
restartPolicy: Never
51 changes: 51 additions & 0 deletions test-configs/minio/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: v1
kind: Namespace
metadata:
name: minio # Change this value if you want a different namespace name
labels:
name: minio # Change this value to match metadata.name
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: minio
name: minio
namespace: minio
spec:
containers:
- name: minio
image: quay.io/minio/minio:latest
env:
- name: MINIO_ACCESS_KEY
value: "minio"
- name: MINIO_SECRET_KEY
value: "minio123"
command:
- /bin/bash
- -c
args:
- mkdir -p /data/bucket && minio server /data --console-address :9090
ports:
- containerPort: 9000
name: minio
volumeMounts:
- mountPath: /data
name: localvolume #
volumes:
- name: localvolume
hostPath:
path: /mnt/minio/data
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
name: minio
namespace: minio # Change this value to match the namespace metadata.name
spec:
selector:
app: minio
ports:
- port: 9000
name: minio
45 changes: 45 additions & 0 deletions test-configs/operator-wandb/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
global:
bucket:
provider: "s3"
name: "minio.minio.svc.cluster.local:9000/bucket"
region: "us-east-1"
accessKey: "minio"
secretKey: "minio123"

app:
extraEnv:
GLOBAL_ADMIN_API_KEY: "test-api-key"
GORILLA_INSECURE_ALLOW_API_KEY_ADMIN_ACCESS: "true"
resources:
requests: {}
limits: {}

parquet:
resources:
requests: {}
limits: {}

weave:
resources:
requests: {}
limits: {}

console:
resources:
requests: {}
limits: {}

ingress:
install: false
create: false

mysql:
install: true
resources:
requests: {}
limits: {}
redis:
install: true
resources:
requests: {}
limits: {}
Loading

0 comments on commit ee34aea

Please sign in to comment.