From 570a9fe9dd2ceecce0525952601389051f05b1bf Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Tue, 28 Jan 2025 23:31:31 +0000 Subject: [PATCH 1/4] feat(*): use published images instead of locally built ones - Replaced `make load` with `sudo make pull` - Updated documents to pull images from `ghcr.io` instead of building them locally Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/workflows/action-test-smoke.yml | 2 +- .github/workflows/benchmarks.yml | 6 +-- Makefile | 44 ++++++++++---------- README.md | 12 ++---- benches/containerd-shim-benchmarks/README.md | 7 +--- crates/containerd-shim-wasmtime/README.md | 4 +- docs/windows-getting-started.md | 3 +- test/k3s/bootstrap.sh | 1 - test/k8s/deploy.oci.yaml | 2 - test/k8s/deploy.yaml | 1 - 10 files changed, 35 insertions(+), 47 deletions(-) diff --git a/.github/workflows/action-test-smoke.yml b/.github/workflows/action-test-smoke.yml index d71045a6c..4f73f8bc8 100644 --- a/.github/workflows/action-test-smoke.yml +++ b/.github/workflows/action-test-smoke.yml @@ -44,8 +44,8 @@ jobs: run: | ls -alh dist ls -alh dist/bin - make load sudo cp -f dist/bin/* /usr/local/bin + sudo make pull-app sudo ctr run --rm --runtime=io.containerd.${{ inputs.runtime }}.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello' - name: Verify Jaeger traces run: | diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index be6988eb5..18cf1de3b 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -28,7 +28,7 @@ jobs: - name: Build and load shims and wasi-demo-app shell: bash run: | - make OPT_PROFILE=release build install test-image load test-image/oci load/oci + make OPT_PROFILE=release build install pull - name: Run Benchmarks shell: bash run: | @@ -69,7 +69,7 @@ jobs: - name: Build and load shims and wasi-demo-app shell: bash run: | - make OPT_PROFILE=release build install test-image load test-image/oci load/oci + make OPT_PROFILE=release build install pull - name: Run Benchmarks shell: bash run: | @@ -113,7 +113,7 @@ jobs: - name: Build and load shims and wasi-demo-app shell: bash run: | - make OPT_PROFILE=release build install test-image/http load/http + make OPT_PROFILE=release build install pull - name: Start wasmtime shim shell: bash run: | diff --git a/Makefile b/Makefile index 1099645c5..45ef554c6 100644 --- a/Makefile +++ b/Makefile @@ -215,27 +215,30 @@ dist/img-oci-artifact.tar: target/wasm32-wasip1/$(OPT_PROFILE)/img-oci-artifact. @mkdir -p "dist/" cp "$<" "$@" -load: dist/img.tar - sudo ctr -n $(CONTAINERD_NAMESPACE) image import --all-platforms $< +.PHONY: pull pull-app pull-oci pull-oci-artifact pull-http +pull: pull-app pull-oci pull-oci-artifact pull-http + echo "Pulled all images" + +pull-app: + ctr image pull ghcr.io/containerd/runwasi/wasi-demo-app:latest + +pull-oci: + ctr image pull ghcr.io/containerd/runwasi/wasi-demo-oci:latest + +pull-oci-artifact: + ctr image pull ghcr.io/containerd/runwasi/wasi-demo-oci-artifact:latest + +pull-http: + ctr image pull ghcr.io/containerd/runwasi/wasi-http:latest docker/load: dist/img.tar docker load -i $< -CTR_VERSION := $(shell sudo ctr version | sed -n -e '/Version/ {s/.*: *//p;q;}') -load/oci: dist/img-oci.tar dist/img-oci-artifact.tar - @echo $(CTR_VERSION)\\nv1.7.7 | sort -crV || @echo $(CTR_VERSION)\\nv1.6.25 | sort -crV || (echo "containerd version must be 1.7.7+ or 1.6.25+ was $(CTR_VERSION)" && exit 1) - @echo using containerd $(CTR_VERSION) - sudo ctr -n $(CONTAINERD_NAMESPACE) image import --all-platforms $< - sudo ctr -n $(CONTAINERD_NAMESPACE) image import --all-platforms dist/img-oci-artifact.tar - docker/load/oci: dist/img-oci.tar dist/img-oci-artifact.tar docker load -i dist/img-oci.tar docker load -i dist/img-oci-artifact.tar -.PHONY: load/http -load/http: dist/http-img-oci.tar - sudo ctr -n $(CONTAINERD_NAMESPACE) image import --all-platforms $< - +.PHONY: docker/load/http docker/load/http: dist/http-img-oci.tar docker load -i $< @@ -276,9 +279,8 @@ test/nginx: mkdir -p $@/out && docker save -o $@/out/img.tar docker.io/nginx:latest .PHONY: test/k8s/cluster-% -test/k8s/cluster-%: dist/img.tar bin/kind test/k8s/_out/img-% - bin/kind create cluster --name $(KIND_CLUSTER_NAME) --image="$(shell cat test/k8s/_out/img-$*)" && \ - bin/kind load image-archive --name $(KIND_CLUSTER_NAME) $(<) +test/k8s/cluster-%: bin/kind test/k8s/_out/img-% + bin/kind create cluster --name $(KIND_CLUSTER_NAME) --image="$(shell cat test/k8s/_out/img-$*)" .PHONY: test/k8s/deploy-workload-% @@ -290,9 +292,7 @@ test/k8s/deploy-workload-%: test/k8s/clean test/k8s/cluster-% kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=5s .PHONY: test/k8s/deploy-workload-oci-% -test/k8s/deploy-workload-oci-%: test/k8s/clean test/k8s/cluster-% dist/img-oci.tar dist/img-oci-artifact.tar test/k8s/cluster-% - bin/kind load image-archive --name $(KIND_CLUSTER_NAME) dist/img-oci.tar - bin/kind load image-archive --name $(KIND_CLUSTER_NAME) dist/img-oci-artifact.tar +test/k8s/deploy-workload-oci-%: test/k8s/clean test/k8s/cluster-% kubectl --context=kind-$(KIND_CLUSTER_NAME) apply -f test/k8s/deploy.oci.yaml kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=300s # verify that we are still running after some time @@ -333,7 +333,7 @@ bin/k3s/clean: .PHONY: test/k3s-% test/k3s-%: dist/img.tar bin/k3s dist-% - sudo bash -c -- 'while ! timeout 40 test/k3s/bootstrap.sh "$*" dist/img.tar; do $(MAKE) bin/k3s/clean bin/k3s; done' + sudo bash -c -- 'while ! timeout 40 test/k3s/bootstrap.sh "$*"; do $(MAKE) bin/k3s/clean bin/k3s; done' sudo bin/k3s kubectl get pods --all-namespaces sudo bin/k3s kubectl apply -f test/k8s/deploy.yaml sudo bin/k3s kubectl get pods --all-namespaces @@ -346,8 +346,8 @@ test/k3s-%: dist/img.tar bin/k3s dist-% sudo bin/k3s kubectl wait deployment wasi-demo --for delete --timeout=60s .PHONY: test/k3s-oci-% -test/k3s-oci-%: dist/img-oci.tar bin/k3s dist-% - sudo bash -c -- 'while ! timeout 40 test/k3s/bootstrap.sh "$*" dist/img-oci.tar; do $(MAKE) bin/k3s/clean bin/k3s; done' +test/k3s-oci-%: bin/k3s dist-% + sudo bash -c -- 'while ! timeout 40 test/k3s/bootstrap.sh "$*"; do $(MAKE) bin/k3s/clean bin/k3s; done' sudo bin/k3s kubectl get pods --all-namespaces sudo bin/k3s kubectl apply -f test/k8s/deploy.oci.yaml sudo bin/k3s kubectl get pods --all-namespaces diff --git a/README.md b/README.md index 10fb86d9f..e134b50de 100644 --- a/README.md +++ b/README.md @@ -146,11 +146,10 @@ sudo make install > Note: `make build` will only build one binary. The `make install` command copies the binary to $PATH and uses symlinks to create all the component described above. -Build the test image and load it into containerd: +Pull the test image: ``` -make test-image -make load +sudo make pull-app ``` ### Demo 1 using container image that contains a Wasm module. @@ -185,11 +184,10 @@ To learn more about this approach checkout the [design document](https://docs.go > **Note**: This requires containerd 1.7.7+ and 1.6.25+. If you do not have these patches for both `containerd` and `ctr` you will end up with an error message such as `mismatched image rootfs and manifest layers` at the import and run steps. Latest versions of k3s and kind have the necessary containerd versions. -Build and import the OCI image with WASM layers image: +Pull the OCI image with WASM layers image: ``` -make test-image/oci -make load/oci +sudo make pull ``` Run the image with `sudo ctr run --rm --runtime=io.containerd.[ wasmedge | wasmtime | wasmer | wamr ].v1 ghcr.io/containerd/runwasi/wasi-demo-oci:latest testwasmoci` @@ -205,8 +203,6 @@ exiting The [CNCF tag-runtime wasm working group](https://tag-runtime.cncf.io/wgs/wasm/charter/) has a [OCI Artifact format for Wasm](https://tag-runtime.cncf.io/wgs/wasm/deliverables/wasm-oci-artifact/). This is a new Artifact type that enable the usage across projects beyond just runwasi, see the https://tag-runtime.cncf.io/wgs/wasm/deliverables/wasm-oci-artifact/#implementations ``` -make test-image/oci -make load/oci make test/k8s-oci-wasmtime ``` diff --git a/benches/containerd-shim-benchmarks/README.md b/benches/containerd-shim-benchmarks/README.md index 7f051161a..e26abe004 100644 --- a/benches/containerd-shim-benchmarks/README.md +++ b/benches/containerd-shim-benchmarks/README.md @@ -10,12 +10,9 @@ make build sudo make install ``` -Then, build and load the wasi-demo-app: +Then, pull the wasi-demo-app: ```bash -make test-image -make load -make test-image/oci -make load/oci +sudo make pull ``` To run all benchmarks: diff --git a/crates/containerd-shim-wasmtime/README.md b/crates/containerd-shim-wasmtime/README.md index 21d6f7dbb..5333c1409 100644 --- a/crates/containerd-shim-wasmtime/README.md +++ b/crates/containerd-shim-wasmtime/README.md @@ -57,10 +57,10 @@ cargo run --bin oci-tar-builder -- \ -o ./dist/wasi-http-img-oci.tar ``` -- Import the image: +- Pull the image: ```shell -sudo ctr image import --all-platforms ./dist/wasi-http-img-oci.tar +sudo make pull-http ``` - Run the image: diff --git a/docs/windows-getting-started.md b/docs/windows-getting-started.md index 3cbf154bf..aa7fa4270 100644 --- a/docs/windows-getting-started.md +++ b/docs/windows-getting-started.md @@ -15,8 +15,7 @@ To finish off installing pre-requisites, install Rust following [this](https://w After following these steps and navigating to the runwasi directory in your terminal: - run `make build`, - run `make install`, -- run `make test-image`, and -- run `make load`. +- run `sudo make pull-app`. After this, you can execute an example, like: `ctr run --rm --runtime=io.containerd.wasmtime.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm`. diff --git a/test/k3s/bootstrap.sh b/test/k3s/bootstrap.sh index 046191255..aa0a131a0 100755 --- a/test/k3s/bootstrap.sh +++ b/test/k3s/bootstrap.sh @@ -16,6 +16,5 @@ EOF systemctl daemon-reload systemctl restart k3s-runwasi while ! bin/k3s ctr version; do sleep 1; done -bin/k3s ctr image import --all-platforms $2 while [ "$(bin/k3s kubectl get pods --all-namespaces --no-headers | wc -l)" == "0" ]; do sleep 1; done while [ "$(bin/k3s kubectl get pods --all-namespaces --no-headers | grep -vE "Completed|Running" | wc -l)" != "0" ]; do sleep 1; done diff --git a/test/k8s/deploy.oci.yaml b/test/k8s/deploy.oci.yaml index 31f79bcad..3f7edf064 100644 --- a/test/k8s/deploy.oci.yaml +++ b/test/k8s/deploy.oci.yaml @@ -24,10 +24,8 @@ spec: containers: - name: demo image: ghcr.io/containerd/runwasi/wasi-demo-oci:latest - imagePullPolicy: Never - name: demo-artifact image: ghcr.io/containerd/runwasi/wasi-demo-oci-artifact:latest - imagePullPolicy: Never command: ["wasi-demo.wasm"] - name: nginx image: docker.io/nginx:latest diff --git a/test/k8s/deploy.yaml b/test/k8s/deploy.yaml index 6c833ce5f..d102568bd 100644 --- a/test/k8s/deploy.yaml +++ b/test/k8s/deploy.yaml @@ -24,7 +24,6 @@ spec: containers: - name: demo image: ghcr.io/containerd/runwasi/wasi-demo-app:latest - imagePullPolicy: Never - name: nginx image: docker.io/nginx:latest ports: From 8341062dcbe139701b6d6a8672ef445c2592941e Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Wed, 29 Jan 2025 01:56:01 +0000 Subject: [PATCH 2/4] fix(ci): give root permission to pull images Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/workflows/benchmarks.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 18cf1de3b..0c00bd5f5 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -28,7 +28,8 @@ jobs: - name: Build and load shims and wasi-demo-app shell: bash run: | - make OPT_PROFILE=release build install pull + make OPT_PROFILE=release build install + sudo make pull - name: Run Benchmarks shell: bash run: | @@ -69,7 +70,8 @@ jobs: - name: Build and load shims and wasi-demo-app shell: bash run: | - make OPT_PROFILE=release build install pull + make OPT_PROFILE=release build install + sudo make pull - name: Run Benchmarks shell: bash run: | @@ -113,7 +115,8 @@ jobs: - name: Build and load shims and wasi-demo-app shell: bash run: | - make OPT_PROFILE=release build install pull + make OPT_PROFILE=release build install + sudo make pull - name: Start wasmtime shim shell: bash run: | From 9116a9132bd5d66c32d44c757efda18798da624b Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Wed, 29 Jan 2025 06:34:53 +0000 Subject: [PATCH 3/4] refactor(ci): extract setup-env and build actions out to composite actions for code reuse Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/actions/build/action.yml | 11 +++++++ .github/actions/setup-env/action.yml | 9 ++++++ .github/workflows/action-build.yml | 6 +--- .github/workflows/action-check.yml | 6 +--- .github/workflows/action-test-k3s.yml | 4 +-- .github/workflows/action-test-kind.yml | 4 +-- .github/workflows/action-test-smoke.yml | 4 +-- .github/workflows/benchmarks.yml | 36 ++++----------------- .github/workflows/ci.yml | 4 +-- .github/workflows/release-wasi-demo-app.yml | 3 +- .github/workflows/release.yml | 3 +- 11 files changed, 34 insertions(+), 56 deletions(-) create mode 100644 .github/actions/build/action.yml create mode 100644 .github/actions/setup-env/action.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 000000000..53b408157 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,11 @@ +name: Build artifacts and pull images +description: 'Build artifacts and pull images' + +runs: + using: composite + steps: + - name: Build and pull + shell: bash + run: | + make OPT_PROFILE=release build install + sudo make pull \ No newline at end of file diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml new file mode 100644 index 000000000..11d36d565 --- /dev/null +++ b/.github/actions/setup-env/action.yml @@ -0,0 +1,9 @@ +name: Setup Environment +description: 'Common environment setup' + +runs: + using: composite + steps: + - name: Setup OS dependencies + shell: bash + run: ./scripts/setup-$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]').sh \ No newline at end of file diff --git a/.github/workflows/action-build.yml b/.github/workflows/action-build.yml index 23f70a279..c8ef09bcb 100644 --- a/.github/workflows/action-build.yml +++ b/.github/workflows/action-build.yml @@ -41,11 +41,7 @@ jobs: run: | echo "::notice::Running job with os: '${{ inputs.os }}', arch: '${{ inputs.arch }}', slug: '${{ inputs.slug }}', runtime: '${{ inputs.runtime }}', target: '${{ inputs.target }}'" - uses: actions/checkout@v4 - - name: Setup build env - run: | - os=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]') - ./scripts/setup-$os.sh - shell: bash + - uses: ./.github/actions/setup-env - uses: actions-rust-lang/setup-rust-toolchain@v1 env: RUST_CACHE_KEY_OS: rust-cache-${{ inputs.os }}-${{ inputs.slug }} diff --git a/.github/workflows/action-check.yml b/.github/workflows/action-check.yml index 692650726..e9d6d05c5 100644 --- a/.github/workflows/action-check.yml +++ b/.github/workflows/action-check.yml @@ -22,11 +22,7 @@ jobs: with: components: rustfmt, clippy rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile - - name: Setup build env - run: | - os=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]') - ./scripts/setup-$os.sh - shell: bash + - uses: ./.github/actions/setup-env - run: # needed to run rustfmt in nightly toolchain rustup toolchain install nightly --component rustfmt diff --git a/.github/workflows/action-test-k3s.yml b/.github/workflows/action-test-k3s.yml index 300eef4c4..8ab6137ec 100644 --- a/.github/workflows/action-test-k3s.yml +++ b/.github/workflows/action-test-k3s.yml @@ -18,9 +18,7 @@ jobs: runs-on: ${{ inputs.os }} steps: - uses: actions/checkout@v4 - - name: Setup build env - run: ./scripts/setup-linux.sh - shell: bash + - uses: ./.github/actions/setup-env - name: Download artifacts uses: actions/download-artifact@master with: diff --git a/.github/workflows/action-test-kind.yml b/.github/workflows/action-test-kind.yml index 60539e1dd..01e0cf391 100644 --- a/.github/workflows/action-test-kind.yml +++ b/.github/workflows/action-test-kind.yml @@ -24,9 +24,7 @@ jobs: runs-on: ${{ inputs.os }} steps: - uses: actions/checkout@v4 - - name: Setup build env - run: ./scripts/setup-linux.sh - shell: bash + - uses: ./.github/actions/setup-env - name: Download artifacts uses: actions/download-artifact@master with: diff --git a/.github/workflows/action-test-smoke.yml b/.github/workflows/action-test-smoke.yml index 4f73f8bc8..62d244d03 100644 --- a/.github/workflows/action-test-smoke.yml +++ b/.github/workflows/action-test-smoke.yml @@ -18,9 +18,7 @@ jobs: runs-on: ${{ inputs.os }} steps: - uses: actions/checkout@v4 - - name: Setup build env - run: ./scripts/setup-linux.sh - shell: bash + - uses: ./.github/actions/setup-env - name: Download artifacts uses: actions/download-artifact@master with: diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 0c00bd5f5..ab2dc77e9 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -20,16 +20,8 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile - - name: Setup build environment - shell: bash - run: | - os=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]') - ./scripts/setup-$os.sh - - name: Build and load shims and wasi-demo-app - shell: bash - run: | - make OPT_PROFILE=release build install - sudo make pull + - uses: ./.github/actions/setup-env + - uses: ./.github/actions/build - name: Run Benchmarks shell: bash run: | @@ -62,16 +54,8 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile - - name: Setup build environment - shell: bash - run: | - os=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]') - ./scripts/setup-$os.sh - - name: Build and load shims and wasi-demo-app - shell: bash - run: | - make OPT_PROFILE=release build install - sudo make pull + - uses: ./.github/actions/setup-env + - uses: ./.github/actions/build - name: Run Benchmarks shell: bash run: | @@ -107,16 +91,8 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile - - name: Setup build environment - shell: bash - run: | - os=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]') - ./scripts/setup-$os.sh - - name: Build and load shims and wasi-demo-app - shell: bash - run: | - make OPT_PROFILE=release build install - sudo make pull + - uses: ./.github/actions/setup-env + - uses: ./.github/actions/build - name: Start wasmtime shim shell: bash run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d01dcd07e..24f12f6dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,9 +161,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Setup build env - run: ./scripts/setup-linux.sh - shell: bash + - uses: ./.github/actions/setup-env - uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: Swatinem/rust-cache@v2 - name: Check documentation diff --git a/.github/workflows/release-wasi-demo-app.yml b/.github/workflows/release-wasi-demo-app.yml index a25882087..043d35ccf 100644 --- a/.github/workflows/release-wasi-demo-app.yml +++ b/.github/workflows/release-wasi-demo-app.yml @@ -31,8 +31,7 @@ jobs: wasi_http: ${{ steps.get_digests.outputs.wasi_http }} steps: - uses: actions/checkout@v4 - - name: Setup build env - run: ./scripts/setup-linux.sh + - uses: ./.github/actions/setup-env - name: Install Rust and wasm32-wasi target uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c16b426c..f8ea3bcce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,8 +127,7 @@ jobs: run: | echo "::notice::Running job with dry_run: '${{ inputs.dry_run }}', crate: '${{ matrix.crate }}', version: '${{ matrix.version }}', runtime: '${{ matrix.runtime }}', and is_shim: '${{ matrix.is_shim }}'." - uses: actions/checkout@v4 - - name: Setup build env - run: ./scripts/setup-linux.sh + - uses: ./.github/actions/setup-env - name: Download artifacts if: ${{ matrix.is_shim == 'true' }} uses: actions/download-artifact@master From b0f439b4096ae18e087b061dbaec0680bd191f3a Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Wed, 29 Jan 2025 19:00:31 +0000 Subject: [PATCH 4/4] refactor(ci): add 'sudo' to 'pull' in the Makefile Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/actions/build/action.yml | 4 ++-- .github/workflows/action-test-smoke.yml | 2 +- Makefile | 8 ++++---- README.md | 4 ++-- benches/containerd-shim-benchmarks/README.md | 2 +- crates/containerd-shim-wasmtime/README.md | 2 +- docs/windows-getting-started.md | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 53b408157..403b6023a 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -7,5 +7,5 @@ runs: - name: Build and pull shell: bash run: | - make OPT_PROFILE=release build install - sudo make pull \ No newline at end of file + set -euxo pipefail + make OPT_PROFILE=release build install pull \ No newline at end of file diff --git a/.github/workflows/action-test-smoke.yml b/.github/workflows/action-test-smoke.yml index 62d244d03..7025ac4a2 100644 --- a/.github/workflows/action-test-smoke.yml +++ b/.github/workflows/action-test-smoke.yml @@ -43,7 +43,7 @@ jobs: ls -alh dist ls -alh dist/bin sudo cp -f dist/bin/* /usr/local/bin - sudo make pull-app + make pull-app sudo ctr run --rm --runtime=io.containerd.${{ inputs.runtime }}.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello' - name: Verify Jaeger traces run: | diff --git a/Makefile b/Makefile index 45ef554c6..9ed5b6a26 100644 --- a/Makefile +++ b/Makefile @@ -220,16 +220,16 @@ pull: pull-app pull-oci pull-oci-artifact pull-http echo "Pulled all images" pull-app: - ctr image pull ghcr.io/containerd/runwasi/wasi-demo-app:latest + sudo ctr image pull ghcr.io/containerd/runwasi/wasi-demo-app:latest pull-oci: - ctr image pull ghcr.io/containerd/runwasi/wasi-demo-oci:latest + sudo ctr image pull ghcr.io/containerd/runwasi/wasi-demo-oci:latest pull-oci-artifact: - ctr image pull ghcr.io/containerd/runwasi/wasi-demo-oci-artifact:latest + sudo ctr image pull ghcr.io/containerd/runwasi/wasi-demo-oci-artifact:latest pull-http: - ctr image pull ghcr.io/containerd/runwasi/wasi-http:latest + sudo ctr image pull ghcr.io/containerd/runwasi/wasi-http:latest docker/load: dist/img.tar docker load -i $< diff --git a/README.md b/README.md index e134b50de..d659cd480 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ sudo make install Pull the test image: ``` -sudo make pull-app +make pull-app ``` ### Demo 1 using container image that contains a Wasm module. @@ -187,7 +187,7 @@ To learn more about this approach checkout the [design document](https://docs.go Pull the OCI image with WASM layers image: ``` -sudo make pull +make pull ``` Run the image with `sudo ctr run --rm --runtime=io.containerd.[ wasmedge | wasmtime | wasmer | wamr ].v1 ghcr.io/containerd/runwasi/wasi-demo-oci:latest testwasmoci` diff --git a/benches/containerd-shim-benchmarks/README.md b/benches/containerd-shim-benchmarks/README.md index e26abe004..34e9e76fb 100644 --- a/benches/containerd-shim-benchmarks/README.md +++ b/benches/containerd-shim-benchmarks/README.md @@ -12,7 +12,7 @@ sudo make install Then, pull the wasi-demo-app: ```bash -sudo make pull +make pull ``` To run all benchmarks: diff --git a/crates/containerd-shim-wasmtime/README.md b/crates/containerd-shim-wasmtime/README.md index 5333c1409..ab953fe3a 100644 --- a/crates/containerd-shim-wasmtime/README.md +++ b/crates/containerd-shim-wasmtime/README.md @@ -60,7 +60,7 @@ cargo run --bin oci-tar-builder -- \ - Pull the image: ```shell -sudo make pull-http +make pull-http ``` - Run the image: diff --git a/docs/windows-getting-started.md b/docs/windows-getting-started.md index aa7fa4270..dcae470db 100644 --- a/docs/windows-getting-started.md +++ b/docs/windows-getting-started.md @@ -15,7 +15,7 @@ To finish off installing pre-requisites, install Rust following [this](https://w After following these steps and navigating to the runwasi directory in your terminal: - run `make build`, - run `make install`, -- run `sudo make pull-app`. +- run `make pull-app`. After this, you can execute an example, like: `ctr run --rm --runtime=io.containerd.wasmtime.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm`.