Skip to content

Commit

Permalink
changed workload image arch to wasi/wasm (#42)
Browse files Browse the repository at this point in the history
Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka authored Oct 14, 2022
1 parent 7aa63c3 commit 903daf6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
_dist/slight_workload.yaml#example-slight-workloads
for f in ./_artifacts/*/*.tar.gz; do gh release upload ${{ env.RELEASE_VERSION }} $f; done
# Setup buildx to build multiarch image: https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: setup buildx
uses: docker/setup-buildx-action@v2
- name: login to GitHub container registry
Expand All @@ -61,6 +65,16 @@ jobs:
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:${{ env.RELEASE_VERSION }}
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:latest
context: images/spin
platforms: wasi/wasm
- name: build and push Spin DotNet
uses: docker/build-push-action@v3
with:
push: true
tags: |
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-dotnet-hello:${{ env.RELEASE_VERSION }}
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-dotnet-hello:latest
context: images/spin_dotnet
platforms: wasi/wasm
- name: build and push Slight hello world
uses: docker/build-push-action@v3
with:
Expand All @@ -69,6 +83,7 @@ jobs:
ghcr.io/deislabs/containerd-wasm-shims/examples/slight-rust-hello:${{ env.RELEASE_VERSION }}
ghcr.io/deislabs/containerd-wasm-shims/examples/slight-rust-hello:latest
context: images/slight
platforms: wasi/wasm
- name: untar x86_64 musl artifacts into ./deployments/k3d/.tmp dir
run: |
mkdir -p ./deployments/k3d/.tmp
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ update-deps:

test/out_spin/img.tar: images/spin/Dockerfile
mkdir -p $(@D)
docker build -t $(TEST_IMG_NAME_SPIN) ./images/spin
docker buildx build --platform=wasi/wasm -t $(TEST_IMG_NAME_SPIN) ./images/spin
docker save -o $@ $(TEST_IMG_NAME_SPIN)

test/out_slight/img.tar: images/slight/Dockerfile
mkdir -p $(@D)
docker build -t $(TEST_IMG_NAME_SLIGHT) ./images/slight
docker buildx build --platform=wasi/wasm -t $(TEST_IMG_NAME_SLIGHT) ./images/slight
docker save -o $@ $(TEST_IMG_NAME_SLIGHT)

load: test/out_spin/img.tar test/out_slight/img.tar
Expand Down
2 changes: 1 addition & 1 deletion images/slight/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.64 AS build
FROM --platform=${BUILDPLATFORM} rust:1.64 AS build
WORKDIR /opt/build
COPY . .
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release
Expand Down
2 changes: 1 addition & 1 deletion images/spin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.59 AS build
FROM --platform=${BUILDPLATFORM} rust:1.59 AS build
WORKDIR /opt/build
COPY . .
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release
Expand Down
2 changes: 1 addition & 1 deletion images/spin_dotnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim-amd64 AS build
FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim-amd64 AS build
WORKDIR /opt/build
COPY . .
RUN apt-get update && apt-get install xz-utils
Expand Down

0 comments on commit 903daf6

Please sign in to comment.