|  | 
|  | 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 | +          load: true | 
|  | 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 | +          load: true | 
|  | 47 | +          tags: | | 
|  | 48 | +            node-installer:latest | 
|  | 49 | +
 | 
|  | 50 | +      - name: Build shim downloader | 
|  | 51 | +        uses: docker/build-push-action@v6 | 
|  | 52 | +        with: | 
|  | 53 | +          context: ./images/downloader | 
|  | 54 | +          file: ./images/downloader/Dockerfile | 
|  | 55 | +          platforms: linux/amd64 | 
|  | 56 | +          cache-from: type=gha | 
|  | 57 | +          cache-to: type=gha,mode=max | 
|  | 58 | +          load: true | 
|  | 59 | +          tags: | | 
|  | 60 | +            shim-downloader:latest | 
|  | 61 | +
 | 
|  | 62 | +      - name: create kind cluster | 
|  | 63 | +        uses: helm/kind-action@v1 | 
|  | 64 | +        with: | 
|  | 65 | +          cluster_name: kind | 
|  | 66 | + | 
|  | 67 | +      - name: import images into kind cluster | 
|  | 68 | +        run: | | 
|  | 69 | +          kind load docker-image runtime-class-manager:latest | 
|  | 70 | +          kind load docker-image node-installer:latest | 
|  | 71 | +          kind load docker-image shim-downloader:latest | 
|  | 72 | +
 | 
|  | 73 | +      - name: helm install runtime-class-manager | 
|  | 74 | +        run: | | 
|  | 75 | +          helm install rcm \ | 
|  | 76 | +            --namespace rcm \ | 
|  | 77 | +            --create-namespace \ | 
|  | 78 | +            --debug \ | 
|  | 79 | +            --set image.repository=runtime-class-manager \ | 
|  | 80 | +            --set image.tag=latest \ | 
|  | 81 | +            --set rcm.nodeInstallerImage.repository=node-installer \ | 
|  | 82 | +            --set rcm.nodeInstallerImage.tag=latest \ | 
|  | 83 | +            --set rcm.shimDownloaderImage.repository=shim-downloader \ | 
|  | 84 | +            --set rcm.shimDownloaderImage.tag=latest \ | 
|  | 85 | +            deploy/helm | 
|  | 86 | +
 | 
|  | 87 | +      - name: apply Spin shim | 
|  | 88 | +        run: kubectl apply -f config/samples/test_shim_spin.yaml | 
|  | 89 | + | 
|  | 90 | +      - name: label nodes | 
|  | 91 | +        run: kubectl label node --all spin=true | 
|  | 92 | + | 
|  | 93 | +      - name: run Spin App | 
|  | 94 | +        run: | | 
|  | 95 | +          kubectl apply -f testdata/apps/spin-app.yaml | 
|  | 96 | +          kubectl rollout status deployment wasm-spin --timeout 90s | 
|  | 97 | +          kubectl get pods -A | 
|  | 98 | +          kubectl port-forward svc/wasm-spin 8083:80 & | 
|  | 99 | +          timeout 15s bash -c 'until curl -f -vvv http://localhost:8083/hello; do sleep 2; done' | 
|  | 100 | +
 | 
|  | 101 | +      - name: debug | 
|  | 102 | +        if: failure() | 
|  | 103 | +        run: | | 
|  | 104 | +          kubectl get pods -A | 
|  | 105 | +          kubectl describe shim spin-v2 | 
|  | 106 | +          kubectl describe runtimeclass wasmtime-spin-v2 | 
|  | 107 | +          kubectl logs -n rcm -l app.kubernetes.io/name=runtime-class-manager || true | 
|  | 108 | +          kubectl describe -n rcm pod -l app.kubernetes.io/name=runtime-class-manager || true | 
|  | 109 | +          kubectl logs -l app=wasm-spin || true | 
|  | 110 | +          kubectl describe pod -l app=wasm-spin || true | 
|  | 111 | +
 | 
|  | 112 | +      - name: Verify curl | 
|  | 113 | +        run: curl localhost:8083/hello | 
0 commit comments