diff --git a/.github/workflows/action-test-k3s.yml b/.github/workflows/action-test-k3s.yml index 7a5d53836..bd3bd0bf9 100644 --- a/.github/workflows/action-test-k3s.yml +++ b/.github/workflows/action-test-k3s.yml @@ -43,6 +43,18 @@ jobs: run: | sudo bin/k3s kubectl get pods --all-namespaces sudo bin/k3s kubectl describe pods --all-namespaces + - name: tar logs + if: failure() + run: | + sudo journalctl -u k3s-runwasi > k3s.log + sudo tar czf k3s-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz -C . k3s.log -C /var/log/pods . -C /var/lib/rancher/k3s/agent/containerd/ containerd.log + sudo chown ${USER}:${USER} k3s-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz + - name: upload logs + if: failure() + uses: actions/upload-artifact@master + with: + name: k3s-logs-${{ inputs.runtime }}-${{ inputs.os }} + path: k3s-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz - name: cleanup if: always() run: make test/k3s/clean diff --git a/.github/workflows/action-test-kind.yml b/.github/workflows/action-test-kind.yml index dbd2ed240..2e48f7b97 100644 --- a/.github/workflows/action-test-kind.yml +++ b/.github/workflows/action-test-kind.yml @@ -43,6 +43,17 @@ jobs: run: | kubectl get pods --all-namespaces kubectl describe pods --all-namespaces + - name: tar logs + if: failure() + run: | + bin/kind export logs ./kind-logs --name containerd-wasm + tar czf kind-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz -C ./kind-logs . + - name: upload logs + if: failure() + uses: actions/upload-artifact@master + with: + name: kind-logs-${{ inputs.runtime }}-${{ inputs.os }} + path: kind-logs-${{ inputs.runtime }}-${{ inputs.os }}.tar.gz - name: cleanup if: always() run: make test/k8s/clean diff --git a/Makefile b/Makefile index 57b281654..bb458e5f3 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ INSTALL ?= install LN ?= ln -sf TEST_IMG_NAME ?= wasmtest:latest RUNTIMES ?= wasmedge wasmtime wasmer -export CONTAINERD_NAMESPACE ?= default +CONTAINERD_NAMESPACE ?= default TARGET ?= debug RELEASE_FLAG := @@ -24,6 +24,8 @@ DOCKER_BUILD ?= docker buildx build KIND_CLUSTER_NAME ?= containerd-wasm +export + .PHONY: build build-common build-wasm build-% build: build-wasm $(RUNTIMES:%=build-%); @@ -109,9 +111,11 @@ target/wasm32-wasi/$(TARGET)/wasi-demo-app.wasm: target/wasm32-wasi/$(TARGET)/img.tar: target/wasm32-wasi/$(TARGET)/wasi-demo-app.wasm cd crates/wasi-demo-app && cargo build $(RELEASE_FLAG) --features oci-v1-tar -dist/img.tar: target/wasm32-wasi/$(TARGET)/img.tar +.PHONY: dist/img.tar +dist/img.tar: @mkdir -p "dist/" - cp "$<" "$@" + [ -f $(PWD)/dist/img.tar ] || $(MAKE) target/wasm32-wasi/$(TARGET)/img.tar + [ -f $(PWD)/dist/img.tar ] || cp target/wasm32-wasi/$(TARGET)/img.tar "$@" load: dist/img.tar sudo ctr -n $(CONTAINERD_NAMESPACE) image import --all-platforms $<