Skip to content

Commit 2734502

Browse files
committed
ci(.github): add helm chart smoketest workflow
Signed-off-by: Vaughn Dice <[email protected]>
1 parent 3c90630 commit 2734502

File tree

3 files changed

+143
-0
lines changed

3 files changed

+143
-0
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ permissions:
1717
checks: write
1818

1919
jobs:
20+
helm_install_smoke_test:
21+
uses: ./.github/workflows/helm-install-smoke-test.yml
22+
2023
unit_tests:
2124
name: Test
2225
runs-on: ubuntu-latest
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Helm Chart Smoketest
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
SPIN_OPERATOR_VERSION: 0.3.0
8+
9+
jobs:
10+
helm-install-smoke-test:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install helm
16+
uses: Azure/setup-helm@v4
17+
with:
18+
version: v3.15.4
19+
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v3
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Build RCM
27+
uses: docker/build-push-action@v6
28+
with:
29+
context: .
30+
file: ./Dockerfile
31+
platforms: linux/amd64
32+
cache-from: type=gha
33+
cache-to: type=gha,mode=max
34+
tags: |
35+
runtime-class-manager:latest
36+
37+
- name: Build node installer
38+
uses: docker/build-push-action@v6
39+
with:
40+
context: .
41+
file: ./images/installer/Dockerfile
42+
platforms: linux/amd64
43+
cache-from: type=gha
44+
cache-to: type=gha,mode=max
45+
tags: |
46+
node-installer:latest
47+
48+
- name: Build shim downloader
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: ./images/downloader
52+
file: ./images/downloader/Dockerfile
53+
platforms: linux/amd64
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max
56+
tags: |
57+
shim-downloader:latest
58+
59+
- name: create kind cluster
60+
uses: helm/kind-action@v1
61+
62+
- name: import images into kind cluster
63+
run: |
64+
kind load docker-image runtime-class-manager:latest
65+
kind load docker-image node-installer:latest
66+
kind load docker-image shim-downloader:latest
67+
68+
- name: helm install runtime-class-manager
69+
run: |
70+
helm install rcm \
71+
--namespace rcm \
72+
--create-namespace \
73+
--debug \
74+
--set image.repository=runtime-class-manager \
75+
--set image.tag=latest \
76+
--set rcm.nodeInstallerImage.repository=node-installer \
77+
--set rcm.nodeInstallerImage.tag=latest \
78+
--set rcm.shimDownloaderImage.repository=shim-downloader \
79+
--set rcm.shimDownloaderImage.tag=latest \
80+
deploy/helm
81+
82+
- name: apply Spin shim
83+
run: kubectl apply -f config/samples/test_shim_spin.yaml
84+
85+
- name: label nodes
86+
run: kubectl label node --all spin=true
87+
88+
- name: run Spin App
89+
run: |
90+
kubectl apply -f testdata/apps/spin-app.yaml
91+
kubectl rollout status deployment wasm-spin --timeout 90s
92+
kubectl get pods -A
93+
kubectl port-forward svc/wasm-spin 8083:80 &
94+
timeout 15s bash -c 'until curl -f -vvv http://localhost:8083/hello; do sleep 2; done'
95+
96+
- name: debug
97+
if: failure()
98+
run: |
99+
kubectl get pods -A
100+
kubectl describe shim spin-v2
101+
kubectl describe runtimeclass wasmtime-spin-v2
102+
kubectl logs -n rcm -l app.kubernetes.io/name=runtime-class-manager || true
103+
kubectl describe -n rcm pod -l app.kubernetes.io/name=runtime-class-manager || true
104+
kubectl logs -l app=wasm-spin || true
105+
kubectl describe pod -l app=wasm-spin || true
106+
107+
- name: Verify curl
108+
run: curl localhost:8083/hello

testdata/apps/spin-app.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: wasm-spin
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: wasm-spin
11+
template:
12+
metadata:
13+
labels:
14+
app: wasm-spin
15+
spec:
16+
runtimeClassName: wasmtime-spin-v2
17+
containers:
18+
- name: spin-hello
19+
image: ghcr.io/spinkube/spin-operator/hello-world:20240909-145818-g30def7d
20+
command: ["/"]
21+
---
22+
apiVersion: v1
23+
kind: Service
24+
metadata:
25+
name: wasm-spin
26+
spec:
27+
ports:
28+
- protocol: TCP
29+
port: 80
30+
targetPort: 80
31+
selector:
32+
app: wasm-spin

0 commit comments

Comments
 (0)