- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10
ci(.github): update helm-chart-smoketest with more k8s variations #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            5 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      6d866f3
              
                ci(.github): update helm-chart-smoketest with more k8s variations
              
              
                vdice 8c15226
              
                chore(helm-chart-smoketest): bump versions
              
              
                vdice 828fb13
              
                add debug info to the download_shim.sh script
              
              
                vdice 99fb2b1
              
                smoketest: bump timeout to 180s for wasm-spin deployment status
              
              
                vdice 84a0f28
              
                chore(helm-chart-smoketest): pin to k8s v1.32.1
              
              
                vdice File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -4,71 +4,138 @@ on: | |
| workflow_call: | ||
|  | ||
| env: | ||
| SHIM_SPIN_VERSION: v0.15.1 | ||
| # TODO: bump to a more recent K8S_VERSION once rcm supports containerd 2.0+ | ||
| # see https://github.com/spinframework/runtime-class-manager/issues/371 | ||
| # For k3d in particular, containerd 2.0 is used starting with k3s image tag v1.32.2-k3s1 | ||
| K8S_VERSION: v1.32.1 | ||
| MICROK8S_CHANNEL: 1.32/stable | ||
| SHIM_SPIN_VERSION: v0.18.0 | ||
| DOCKER_BUILD_SUMMARY: false | ||
|  | ||
| jobs: | ||
| helm-install-smoke-test: | ||
| build-images: | ||
| runs-on: ubuntu-22.04 | ||
| strategy: | ||
| matrix: | ||
| config: | ||
| - { | ||
| name: "runtime-class-manager", | ||
| context: ".", | ||
| file: "./Dockerfile" | ||
| } | ||
| - { | ||
| name: "shim-downloader", | ||
| context: "./images/downloader", | ||
| file: "./images/downloader/Dockerfile" | ||
| } | ||
| - { | ||
| name: "node-installer", | ||
| context: ".", | ||
| file: "./images/installer/Dockerfile" | ||
| } | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|  | ||
| - name: Install helm | ||
| uses: Azure/setup-helm@v4 | ||
| with: | ||
| version: v3.15.4 | ||
|  | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|  | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|  | ||
| - name: Build RCM | ||
| - name: Build ${{ matrix.config.name }} | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile | ||
| context: ${{ matrix.config.context }} | ||
| file: ${{ matrix.config.file }} | ||
| platforms: linux/amd64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| load: true | ||
| tags: | | ||
| runtime-class-manager:chart-test | ||
| outputs: type=docker,dest=/tmp/${{ matrix.config.name }}.tar | ||
| tags: ${{ matrix.config.name }}:chart-test | ||
|  | ||
| - name: Build node installer | ||
| uses: docker/build-push-action@v6 | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
|         
                  vdice marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| with: | ||
| context: . | ||
| file: ./images/installer/Dockerfile | ||
| platforms: linux/amd64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| load: true | ||
| tags: | | ||
| node-installer:chart-test | ||
| name: image-${{ matrix.config.name }} | ||
| path: /tmp/${{ matrix.config.name }}.tar | ||
|  | ||
| - name: Build shim downloader | ||
| uses: docker/build-push-action@v6 | ||
| helm-install-smoke-test: | ||
| runs-on: ubuntu-22.04 | ||
| needs: build-images | ||
| strategy: | ||
| matrix: | ||
| config: | ||
| - { | ||
| type: "kind", | ||
| import_cmd: "kind load image-archive" | ||
| } | ||
| - { | ||
| type: "minikube", | ||
| import_cmd: "minikube image load" | ||
| } | ||
| - { | ||
| type: "microk8s", | ||
| import_cmd: "sudo microk8s ctr images import" | ||
| } | ||
| - { | ||
| type: "k3d", | ||
| import_cmd: "k3d image import" | ||
| } | ||
|  | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|  | ||
| - name: Install helm | ||
| uses: Azure/setup-helm@v4 | ||
| with: | ||
| context: ./images/downloader | ||
| file: ./images/downloader/Dockerfile | ||
| platforms: linux/amd64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| load: true | ||
| tags: | | ||
| shim-downloader:chart-test | ||
| version: v3.17.2 | ||
|  | ||
| - name: create kind cluster | ||
| - name: Download artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: image-* | ||
| merge-multiple: true | ||
| path: /tmp | ||
|  | ||
| # Note: 'uses' doesn't support variable interpolation, hence the | ||
| # k8s-specific steps below. | ||
| # Ref: https://github.com/orgs/community/discussions/25824 | ||
| - name: Create kind cluster | ||
| if: matrix.config.type == 'kind' | ||
| uses: helm/kind-action@v1 | ||
| with: | ||
| cluster_name: kind | ||
| # Versions lower than v0.27.0 encounter https://github.com/kubernetes-sigs/kind/issues/3795 | ||
| version: v0.27.0 | ||
| node_image: kindest/node:${{ env.K8S_VERSION }} | ||
|  | ||
| - name: Create minikube cluster | ||
| if: matrix.config.type == 'minikube' | ||
| uses: medyagh/[email protected] | ||
| with: | ||
| container-runtime: containerd | ||
| kubernetes-version: ${{ env.K8S_VERSION }} | ||
|  | ||
| - name: Create microk8s cluster | ||
| if: matrix.config.type == 'microk8s' | ||
| uses: balchua/[email protected] | ||
| with: | ||
| channel: ${{ env.MICROK8S_CHANNEL }} | ||
|  | ||
| - name: Create k3d cluster | ||
| if: matrix.config.type == 'k3d' | ||
| uses: AbsaOSS/k3d-action@v2 | ||
| with: | ||
| cluster-name: k3s-default | ||
| k3d-version: v5.8.3 | ||
| args: | | ||
| --image docker.io/rancher/k3s:${{ env.K8S_VERSION }}-k3s1 | ||
|  | ||
| - name: import images into kind cluster | ||
| - name: Import images | ||
| run: | | ||
| kind load docker-image runtime-class-manager:chart-test | ||
| kind load docker-image node-installer:chart-test | ||
| kind load docker-image shim-downloader:chart-test | ||
| for image in $(ls /tmp/*.tar); do | ||
| ${{ matrix.config.import_cmd }} $image | ||
| done | ||
|  | ||
| - name: helm install runtime-class-manager | ||
| run: | | ||
|  | @@ -94,23 +161,45 @@ jobs: | |
| - name: label nodes | ||
| run: kubectl label node --all spin=true | ||
|  | ||
| # MicroK8s runs directly on the host, so both the host's containerd process and MicroK8s' would | ||
| # otherwise be detected by runtime-class-manager. As of writing, rcm will fail if more than one | ||
| # containerd process is detected when attempting to restart. So, we stop the host process until | ||
| # the shim has been installed and the test app has been confirmed to run. | ||
| - name: stop system containerd | ||
| if: matrix.config.type == 'microk8s' | ||
| run: sudo systemctl stop containerd | ||
|  | ||
| - name: run Spin App | ||
| run: | | ||
| kubectl apply -f testdata/apps/spin-app.yaml | ||
| kubectl rollout status deployment wasm-spin --timeout 90s | ||
| kubectl rollout status deployment wasm-spin --timeout 180s | ||
| kubectl get pods -A | ||
| kubectl port-forward svc/wasm-spin 8083:80 & | ||
| timeout 15s bash -c 'until curl -f -vvv http://localhost:8083/hello; do sleep 2; done' | ||
| timeout 60s bash -c 'until curl -f -vvv http://localhost:8083/hello; do sleep 2; done' | ||
|  | ||
| - name: restart system containerd | ||
| if: matrix.config.type == 'microk8s' | ||
| run: sudo systemctl start containerd | ||
|  | ||
| - name: debug | ||
| if: failure() | ||
| run: | | ||
| kubectl get pods -A | ||
| kubectl describe shim spin-v2 | ||
| kubectl describe runtimeclass wasmtime-spin-v2 | ||
| kubectl describe -n rcm pod -l job-name=kind-control-plane-spin-v2-install || true | ||
|  | ||
| # Get install pod logs | ||
| # Note: there may be multiple pods pending fix in https://github.com/spinkube/runtime-class-manager/issues/140 | ||
| install_pod=$(kubectl get pods -n rcm --no-headers -o name | awk '{if ($1 ~ "-spin-v2-install") print $0}' | tail -n 1) | ||
| kubectl describe -n rcm $install_pod || true | ||
| kubectl logs -n rcm -c downloader $install_pod || true | ||
| kubectl logs -n rcm -c provisioner $install_pod || true | ||
|  | ||
| # RCM pod logs | ||
| kubectl logs -n rcm -l app.kubernetes.io/name=runtime-class-manager || true | ||
| kubectl describe -n rcm pod -l app.kubernetes.io/name=runtime-class-manager || true | ||
|  | ||
| # App logs | ||
| kubectl logs -l app=wasm-spin || true | ||
| kubectl describe pod -l app=wasm-spin || true | ||
|  | ||
|  | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.