Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .devcontainer/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# Install Rustup Installer
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Install rust and other components
readonly RUST_UP_PATH=$HOME/.cargo/bin
$RUST_UP_PATH/rustup update stable && $RUST_UP_PATH/rustup default stable && $RUST_UP_PATH/rustup component add clippy rustfmt

# Install wasm32-wasi target
$RUST_UP_PATH/rustup target add wasm32-wasi wasm32-unknown-unknown

# Install k3d
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
96 changes: 54 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ tests/clean:
# pin cross to a specific commit to avoid breaking changes
.PHONY: install-cross install-k3d check-bins pod-status-check setup
install-cross:
@if [ -z $$(which cross) ]; then cargo install cross --git https://github.com/cross-rs/cross --rev 5896ed1359642510855ca9ee50ce7fdf75c50e3c; fi
@cross -V 2>/dev/null | grep 5896ed1 || echo "WARN: unsupported version of cross found. Building containerd-shim-spin requires specific version of cross.\n\nPlease uninstall and run make install-cross to install the supported version."
@if [ -z $$(which cross) ]; then RUSTFLAGS="-A warnings" cargo install cross --git https://github.com/cross-rs/cross --rev 49338b18fdb82dedb2a813664e2e565ca73e2047; fi
@cross -V 2>/dev/null | grep 49338b1 || echo "WARN: unsupported version of cross found. Building containerd-shim-spin requires specific version of cross.\n\nPlease uninstall and run make install-cross to install the supported version."

install-k3d:
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
Expand Down
2 changes: 1 addition & 1 deletion containerd-shim-spin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Containerd shim for running Spin workloads.
"""

[dependencies]
containerd-shim-wasm = { version ="0.9.0", default-features = false, features = ["opentelemetry"]}
containerd-shim-wasm = { version ="0.10.0", default-features = false, features = ["opentelemetry"]}
http = "1"
log = "0.4"
spin-app = { git = "https://github.com/fermyon/spin", tag = "v3.1.2" }
Expand Down
12 changes: 6 additions & 6 deletions containerd-shim-spin/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ Navigate to the directory where you created the application:
cd qs-wasm-spin
```

Use `rustup` to install the `wasm32-wasi` target and `spin build` to build the application. For example:
Use `rustup` to install the `wasm32-wasip1` target and `spin build` to build the application. For example:

```bash
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
spin build
```

Expand Down Expand Up @@ -131,13 +131,13 @@ You have two choices for publishing spin apps. The steps to deploy are the same
Create a `Dockerfile` at the root of the application directory with the following:

```dockerfile
FROM --platform=${BUILDPLATFORM} rust:1.71 AS build
FROM --platform=${BUILDPLATFORM} rust:1.85 AS build
WORKDIR /opt/build
COPY . .
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release
RUN rustup target add wasm32-wasip1 && cargo build --target wasm32-wasip1 --release

FROM scratch
COPY --from=build /opt/build/target/wasm32-wasi/release/qs_wasm_spin.wasm .
COPY --from=build /opt/build/target/wasm32-wasip1/release/qs_wasm_spin.wasm .
COPY --from=build /opt/build/spin.toml .
```

Expand All @@ -153,7 +153,7 @@ source = "qs_wasm_spin.wasm"
Use `docker` to build the container image and push it to the k3d registry:

```bash
docker buildx build --platform=wasi/wasm -t localhost:12345/qs-wasm-spin .
docker buildx build --platform=wasip1/wasm -t localhost:12345/qs-wasm-spin .
docker push localhost:12345/qs-wasm-spin:latest
```

Expand Down
2 changes: 2 additions & 0 deletions images/spin-dapr/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ target/debug
target/release
target/wasm32-wasi/build
target/wasm32-wasi/deps
target/wasm32-wasip1/build
target/wasm32-wasip1/deps
.spin/
4 changes: 2 additions & 2 deletions images/spin-dapr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM scratch
COPY ./spin.toml .
COPY --chmod=0755 ./target/wasm32-wasi/release/spin_dapr.wasm /target/wasm32-wasi/release/spin_dapr.wasm
ENTRYPOINT ["/target/wasm32-wasi/release/spin_dapr.wasm"]
COPY --chmod=0755 ./target/wasm32-wasip1/release/spin_dapr.wasm /target/wasm32-wasip1/release/spin_dapr.wasm
ENTRYPOINT ["/target/wasm32-wasip1/release/spin_dapr.wasm"]
4 changes: 2 additions & 2 deletions images/spin-dapr/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ version = "0.1.0"

[[component]]
id = "spin-dapr"
source = "target/wasm32-wasi/release/spin_dapr.wasm"
source = "target/wasm32-wasip1/release/spin_dapr.wasm"
allowed_http_hosts = []
[component.trigger]
route = "/..."

[component.build]
command = "cargo build --target wasm32-wasi --release"
command = "cargo build --target wasm32-wasip1 --release"
watch = ["src/**/*.rs", "Cargo.toml"]
6 changes: 3 additions & 3 deletions images/spin-keyvalue/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM --platform=${BUILDPLATFORM} rust:1.71 AS build
FROM --platform=${BUILDPLATFORM} rust:1.85 AS build
WORKDIR /opt/build
COPY . .
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release
RUN rustup target add wasm32-wasip1 && cargo build --target wasm32-wasip1 --release

FROM scratch
COPY --from=build /opt/build/spin.toml ./spin.toml
COPY --from=build /opt/build/target/wasm32-wasi/release/spin_keyvalue.wasm ./target/wasm32-wasi/release/spin_keyvalue.wasm
COPY --from=build /opt/build/target/wasm32-wasip1/release/spin_keyvalue.wasm ./target/wasm32-wasip1/release/spin_keyvalue.wasm
4 changes: 2 additions & 2 deletions images/spin-keyvalue/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ route = "/keyvalue"
component = "keyvalue"

[component.keyvalue]
source = "target/wasm32-wasi/release/spin_keyvalue.wasm"
source = "target/wasm32-wasip1/release/spin_keyvalue.wasm"
allowed_http_hosts = []
key_value_stores = ["foo"]

[component.keyvalue.build]
command = "cargo build --target wasm32-wasi --release"
command = "cargo build --target wasm32-wasip1 --release"
watch = ["src/**/*.rs", "Cargo.toml"]
6 changes: 3 additions & 3 deletions images/spin-mqtt-message-logger/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM --platform=${BUILDPLATFORM} rust:1.73 AS build
FROM --platform=${BUILDPLATFORM} rust:1.85 AS build
WORKDIR /opt/build
COPY . .
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release
RUN rustup target add wasm32-wasip1 && cargo build --target wasm32-wasip1 --release

FROM scratch
COPY --from=build /opt/build/target/wasm32-wasi/release/mqtt_message_logger.wasm ./target/wasm32-wasi/release/mqtt_message_logger.wasm
COPY --from=build /opt/build/target/wasm32-wasip1/release/mqtt_message_logger.wasm ./target/wasm32-wasip1/release/mqtt_message_logger.wasm
COPY --from=build /opt/build/spin.toml .
Loading
Loading