Skip to content

Commit 7c8a043

Browse files
Load test Spin image into node-installer tests
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 8edd11d commit 7c8a043

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

.github/workflows/action-docker-build-push.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ jobs:
5252
if: ${{ inputs.test }}
5353
with:
5454
context: ${{ matrix.image.context }}
55-
load: true
55+
outputs: type=docker,dest=/tmp/hello-spinapp.tar
5656
tags: containerd-shim-spin/${{ matrix.image.imageName }}:test
5757
platforms: wasi/wasm
58+
- name: Upload test image artifact
59+
if: ${{ inputs.test }}
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: hello-spinapp
63+
path: /tmp/hello-spinapp.tar
5864
- name: Build and push
5965
uses: docker/build-push-action@v5
6066
if: ${{ !inputs.test }}

.github/workflows/action-node-installer.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,24 @@ jobs:
8181
sudo chown $(id -u):$(id -g) $HOME/.kube/config
8282
until sudo microk8s status --wait-ready; do sleep 5s; echo "Try again"; done
8383
84+
- name: Set workload tag for test image
85+
if: ${{ inputs.test }}
86+
run: echo "WORKLOAD_TAG=test" >> $GITHUB_ENV
87+
88+
- name: Download test wasm image artifact
89+
uses: actions/download-artifact@v3
90+
if: ${{ inputs.test }}
91+
with:
92+
name: hello-spinapp
93+
94+
- name: Load the test wasm image from the tarball
95+
if: ${{ inputs.test }}
96+
run: |
97+
docker load -i /tmp/hello-spinapp.tar
98+
8499
- name: Update workload tag for test images
85100
if: ${{ inputs.test }}
86101
run: make update-workload-tag
87-
env:
88-
WORKLOAD_TAG: "test"
89102
working-directory: node-installer
90103

91104
- name: Run KIND test

node-installer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ test-microk8s:
5454
./tests/integration-test-microk8s.sh
5555

5656
test-k3s:
57-
./tests/integration-test-k3s.sh
57+
WORKLOAD_TAG=$(WORKLOAD_TAG) ./tests/integration-test-k3s.sh
5858

5959
test-all: test-kind test-minikube test-microk8s test-k3s

node-installer/tests/integration-test-k3s.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
: ${IMAGE_NAME:=ghcr.io/spinkube/containerd-shim-spin/node-installer:dev}
5+
: ${WORKLOAD_TAG:=v0.19.0}
56

67
echo "Installing K3s..."
78
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable=traefik --write-kubeconfig-mode=644" sh -
@@ -56,7 +57,7 @@ if ! kubectl get pods -n kwasm | grep -q "k3s-provision-kwasm.*Completed"; then
5657
fi
5758

5859
echo "=== Step 4: Apply the workload ==="
59-
sudo k3s ctr images pull ghcr.io/spinkube/containerd-shim-spin/examples/spin-rust-hello:v0.18.0
60+
sudo k3s ctr images pull ghcr.io/spinkube/containerd-shim-spin/examples/spin-rust-hello:$WORKLOAD_TAG
6061
kubectl apply -f ./tests/workloads/workload.yaml
6162

6263
echo "Waiting for deployment to be ready..."

0 commit comments

Comments
 (0)