Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit e5e2679

Browse files
authored
chore(spin): bump spin to 2.0.0 (#177)
bump spin shim version to v2 Signed-off-by: jiaxiao zhou <[email protected]>
1 parent 372bcb3 commit e5e2679

File tree

43 files changed

+1890
-1729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1890
-1729
lines changed

.github/workflows/build.yaml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,41 @@ jobs:
1717
os: "ubuntu-latest",
1818
arch: "aarch64"
1919
}
20-
shims: [slight, spin, wws, lunatic]
20+
shims:
21+
- {
22+
name: "slight",
23+
version: "v1",
24+
}
25+
- {
26+
name: "spin",
27+
version: "v2",
28+
}
29+
- {
30+
name: "wws",
31+
version: "v1",
32+
}
33+
- {
34+
name: "lunatic",
35+
version: "v1",
36+
}
2137
env:
2238
ARCH: ${{ matrix.config.arch }}
2339
steps:
2440
- uses: actions/checkout@v3
2541
- uses: Swatinem/rust-cache@v2
2642
with:
2743
workspaces: |
28-
"containerd-shim-*-v1 -> target"
44+
"containerd-shim-* -> target"
2945
- name: "Install dependencies"
3046
run: |
3147
sudo apt-get update
3248
sudo apt-get install -y protobuf-compiler libseccomp-dev
33-
- name: build ${{ matrix.shims }}
49+
- name: build ${{ matrix.shims.name }}
3450
run: |
35-
VERBOSE=1 make build SHIMS=${{ matrix.shims }}
36-
- name: unit tests ${{ matrix.shims }}
51+
VERBOSE=1 make build SHIMS=${{ matrix.shims.name }}
52+
- name: unit tests ${{ matrix.shims.name }}
3753
run: |
38-
VERBOSE=1 make unit-tests SHIMS=${{ matrix.shims }}
54+
VERBOSE=1 make unit-tests SHIMS=${{ matrix.shims.name }}
3955
- name: lowercase the runner OS name
4056
shell: bash
4157
run: |
@@ -44,12 +60,12 @@ jobs:
4460
- name: package release assets
4561
run: |
4662
mkdir _dist
47-
cp containerd-shim-*-v1/target/${{ matrix.config.arch }}-unknown-linux-musl/release/containerd-shim-*-v1 _dist/
63+
cp containerd-shim-*/target/${{ matrix.config.arch }}-unknown-linux-musl/release/containerd-shim-*-${{ matrix.shims.version }} _dist/
4864
cd _dist
49-
tar czf containerd-wasm-shims-v1-${{ matrix.shims }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz containerd-shim-*-v1
65+
tar czf containerd-wasm-shims-${{ matrix.shims.version }}-${{ matrix.shims.name }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz containerd-shim-*-${{ matrix.shims.version }}
5066
- name: upload shim artifacts
5167
uses: actions/upload-artifact@v3
5268
with:
53-
name: containerd-wasm-shims-v1-${{ matrix.shims }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}
54-
path: _dist/containerd-wasm-shims-v1-${{ matrix.shims }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
69+
name: containerd-wasm-shims-${{ matrix.shims.version }}-${{ matrix.shims.name }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}
70+
path: _dist/containerd-wasm-shims-${{ matrix.shims.version }}-${{ matrix.shims.name }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
5571
retention-days: 5

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: Swatinem/rust-cache@v2
1313
with:
1414
workspaces: |
15-
"containerd-shim-*-v1 -> target"
15+
"containerd-shim-* -> target"
1616
- name: "Install dependencies"
1717
run: |
1818
sudo apt-get update
@@ -37,7 +37,7 @@ jobs:
3737
- name: Extract containerd-wasm-shims-v1-linux-${{ env.ARCH }}
3838
run: |
3939
mkdir -p ./bin
40-
for f in containerd-wasm-shims-v1-*-linux-${{ env.ARCH }}/containerd-wasm-shims-v1-*-linux-${{ env.ARCH }}.tar.gz
40+
for f in containerd-wasm-shims-*-*-linux-${{ env.ARCH }}/containerd-wasm-shims-*-*-linux-${{ env.ARCH }}.tar.gz
4141
do tar -xzf "$f" -C ./bin
4242
done
4343
- name: install k3d

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test: unit-tests integration-tests
2424

2525
.PHONY: unit-tests
2626
unit-tests: build
27-
$(foreach shim,$(SHIMS),cross test --release --manifest-path=containerd-shim-$(shim)-v1/Cargo.toml --target $(TARGET);)
27+
$(foreach shim,$(SHIMS),cross test --release --manifest-path=containerd-shim-$(shim)/Cargo.toml --target $(TARGET);)
2828

2929
.PHONY: check-bins
3030
check-bins:
@@ -56,8 +56,8 @@ test/clean:
5656

5757
.PHONY: fmt
5858
fmt:
59-
$(foreach shim,$(SHIMS),cargo fmt --all --manifest-path=containerd-shim-$(shim)-v1/Cargo.toml -- --check;)
60-
$(foreach shim,$(SHIMS),cargo clippy --all-targets --all-features --workspace --manifest-path=containerd-shim-$(shim)-v1/Cargo.toml -- -D warnings;)
59+
$(foreach shim,$(SHIMS),cargo fmt --all --manifest-path=containerd-shim-$(shim)/Cargo.toml -- --check;)
60+
$(foreach shim,$(SHIMS),cargo clippy --all-targets --all-features --workspace --manifest-path=containerd-shim-$(shim)/Cargo.toml -- -D warnings;)
6161
cargo fmt --all -- --check
6262
cargo clippy --all-targets --all-features --workspace -- --deny=warnings
6363

@@ -73,15 +73,15 @@ install-cross:
7373
.PHONY: $(BUILD_TARGETS)
7474
$(BUILD_TARGETS): SHIM = $(word 2,$(subst -, ,$@))
7575
$(BUILD_TARGETS): install-cross
76-
cross build --release --target $(TARGET) --manifest-path=containerd-shim-$(SHIM)-v1/Cargo.toml $(VERBOSE_FLAG)
76+
cross build --release --target $(TARGET) --manifest-path=containerd-shim-$(SHIM)/Cargo.toml $(VERBOSE_FLAG)
7777

7878
.PHONY: build-%
7979
build-%:
80-
cargo build --release --manifest-path=containerd-shim-$*-v1/Cargo.toml
80+
cargo build --release --manifest-path=containerd-shim-$*/Cargo.toml
8181

8282
.PHONY: install
8383
install: $(foreach shim,$(SHIMS),build-$(shim))
84-
sudo $(INSTALL) containerd-shim-*/target/release/containerd-shim-*-v1 $(PREFIX)/bin
84+
sudo $(INSTALL) containerd-shim-*/target/release/containerd-shim-* $(PREFIX)/bin
8585

8686
.PHONY: update-deps
8787
update-deps:
@@ -105,9 +105,9 @@ run_%: install load
105105

106106
.PHONY: clean
107107
clean: $(addprefix clean-,$(SHIMS))
108-
$(foreach shim,$(SHIMS),test -f $(PREFIX)/bin/containerd-shim-$(shim)-v1 && sudo rm -rf $(PREFIX)/bin/containerd-shim-$(proj)-v1 || true;)
108+
$(foreach shim,$(SHIMS),test -f $(PREFIX)/bin/containerd-shim-$(shim)-* && sudo rm -rf $(PREFIX)/bin/containerd-shim-$(proj)-* || true;)
109109
test -d ./test && sudo rm -rf ./test || true
110110

111111
.PHONY: clean-%
112112
clean-%:
113-
cargo clean --manifest-path containerd-shim-$*-v1/Cargo.toml
113+
cargo clean --manifest-path containerd-shim-$*/Cargo.toml

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ As mentioned above, this project uses runwasi's `containerd-shim-wasm` to build
2929
## Quickstarts
3030

3131
- [Start k3d and run a sample WASM application](./deployments/k3d/README.md#how-to-run-the-example).
32-
- [Create a Spin application on k3d](./containerd-shim-spin-v1/quickstart.md)
32+
- [Create a Spin application on k3d](./containerd-shim-spin-v2/quickstart.md)
3333
- [Deploy a SpiderLightning application with k3d](./containerd-shim-slight-v1/quickstart.md)
3434
- [Deploy a Wasm Workers Server application with k3d](./containerd-shim-slight-v1/quickstart.md)
3535

@@ -53,12 +53,12 @@ In [the deployments directory](deployments) you will find examples of deploying
5353

5454
To use one of these containerd shims in Kubernetes, you must do the following:
5555

56-
1. Install the shim binary somewhere on the path of your Kubernetes worker nodes. For example, copy `containerd-shim-spin-v1` to `/bin`.
56+
1. Install the shim binary somewhere on the path of your Kubernetes worker nodes. For example, copy `containerd-shim-spin-v2` to `/bin`.
5757
2. Add the following to the containerd config.toml that maps the runtime type to the shim binary from step 1.
5858

5959
```toml
6060
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin]
61-
runtime_type = "io.containerd.spin.v1"
61+
runtime_type = "io.containerd.spin.v2"
6262
```
6363

6464
3. Apply a runtime class that contains a handler that matches the "spin" config runtime name from step 2.

containerd-shim-lunatic-v1/Cargo.lock renamed to containerd-shim-lunatic/Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

containerd-shim-lunatic-v1/Cargo.toml renamed to containerd-shim-lunatic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", tag = "containerd-shim-wasm/v0.4.0" }
9+
containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", rev = "c768e5b0919ca02903a301bf82a390489437dabe" }
1010
log = "~0.4"
1111
anyhow = "1.0.72"
1212
chrono = { version = "0.4.26", features = ["std"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)