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