From a3ccec0714da3001aead521b8bbd0883fa959756 Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Tue, 7 Nov 2023 03:05:29 +0000 Subject: [PATCH] update Cargo.lock and fix some bugs in Makefile Signed-off-by: jiaxiao zhou --- Cargo.lock | 4 ++-- containerd-shim-lunatic/Cargo.lock | 10 +++++----- containerd-shim-lunatic/Cargo.toml | 2 +- containerd-shim-slight/Cargo.lock | 10 +++++----- containerd-shim-slight/Cargo.toml | 2 +- containerd-shim-slight/src/main.rs | 2 +- containerd-shim-spin/Cargo.lock | 4 ++-- containerd-shim-spin/Cargo.toml | 2 +- containerd-shim-spin/src/main.rs | 2 +- containerd-shim-wws/Cargo.lock | 6 +++--- containerd-shim-wws/Cargo.toml | 2 +- containerd-shim-wws/src/main.rs | 2 +- deployments/k3d/Makefile | 8 +++++--- scripts/move-bins.sh | 21 +++++++++++---------- 14 files changed, 40 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc39b1bd..43ec825f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -762,9 +762,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libz-sys" diff --git a/containerd-shim-lunatic/Cargo.lock b/containerd-shim-lunatic/Cargo.lock index e8bc223c..005e9110 100644 --- a/containerd-shim-lunatic/Cargo.lock +++ b/containerd-shim-lunatic/Cargo.lock @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "containerd-shim-wasm" version = "0.4.0" -source = "git+https://github.com/containerd/runwasi?tag=containerd-shim-wasm/v0.4.0#5788ced8525a0d2831718f4a24d06fb4d5af6afb" +source = "git+https://github.com/mossaka/runwasi?rev=25ff925e9b2c50d1d72b79a3003b381a599c0b65#25ff925e9b2c50d1d72b79a3003b381a599c0b65" dependencies = [ "anyhow", "caps", @@ -1765,9 +1765,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libcgroups" @@ -2450,9 +2450,9 @@ dependencies = [ [[package]] name = "oci-spec" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e7c5a234613dd98d240891270925718736701c2dbce9c5587567133cf8220f" +checksum = "8384f8eff13954bafafba991f1910779020456f9694de25e81a13da5b7de6309" dependencies = [ "derive_builder", "getset", diff --git a/containerd-shim-lunatic/Cargo.toml b/containerd-shim-lunatic/Cargo.toml index b929894e..04a5442b 100644 --- a/containerd-shim-lunatic/Cargo.toml +++ b/containerd-shim-lunatic/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", tag = "containerd-shim-wasm/v0.4.0" } +containerd-shim-wasm = { git = "https://github.com/mossaka/runwasi", rev = "25ff925e9b2c50d1d72b79a3003b381a599c0b65" } log = "~0.4" anyhow = "1.0.72" chrono = { version = "0.4.26", features = ["std"] } diff --git a/containerd-shim-slight/Cargo.lock b/containerd-shim-slight/Cargo.lock index cd291d73..50358864 100644 --- a/containerd-shim-slight/Cargo.lock +++ b/containerd-shim-slight/Cargo.lock @@ -1475,7 +1475,7 @@ dependencies = [ [[package]] name = "containerd-shim-wasm" version = "0.4.0" -source = "git+https://github.com/containerd/runwasi?tag=containerd-shim-wasm/v0.4.0#5788ced8525a0d2831718f4a24d06fb4d5af6afb" +source = "git+https://github.com/mossaka/runwasi?rev=25ff925e9b2c50d1d72b79a3003b381a599c0b65#25ff925e9b2c50d1d72b79a3003b381a599c0b65" dependencies = [ "anyhow", "caps", @@ -3039,9 +3039,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libcgroups" @@ -3538,9 +3538,9 @@ dependencies = [ [[package]] name = "oci-spec" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e7c5a234613dd98d240891270925718736701c2dbce9c5587567133cf8220f" +checksum = "8384f8eff13954bafafba991f1910779020456f9694de25e81a13da5b7de6309" dependencies = [ "derive_builder", "getset", diff --git a/containerd-shim-slight/Cargo.toml b/containerd-shim-slight/Cargo.toml index 8a261592..b9251e51 100644 --- a/containerd-shim-slight/Cargo.toml +++ b/containerd-shim-slight/Cargo.toml @@ -11,7 +11,7 @@ Containerd shim for running Slight workloads. """ [dependencies] -containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", tag = "containerd-shim-wasm/v0.4.0" } +containerd-shim-wasm = { git = "https://github.com/mossaka/runwasi", rev = "25ff925e9b2c50d1d72b79a3003b381a599c0b65" } log = "0.4" tokio = { version = "1", features = [ "full" ] } slight = { git = "https://github.com/deislabs/spiderlightning", version = "0.5.1" } diff --git a/containerd-shim-slight/src/main.rs b/containerd-shim-slight/src/main.rs index e34ae1e9..f20bfd0e 100644 --- a/containerd-shim-slight/src/main.rs +++ b/containerd-shim-slight/src/main.rs @@ -4,5 +4,5 @@ use containerd_shim_wasm::sandbox::cli::{revision, shim_main, version}; mod engine; fn main() { - shim_main::>("slight", version!(), revision!(), None); + shim_main::>("slight", version!(), revision!(), None, None); } diff --git a/containerd-shim-spin/Cargo.lock b/containerd-shim-spin/Cargo.lock index 09aa0dfe..51ed1e1c 100644 --- a/containerd-shim-spin/Cargo.lock +++ b/containerd-shim-spin/Cargo.lock @@ -1000,7 +1000,7 @@ dependencies = [ [[package]] name = "containerd-shim-wasm" version = "0.4.0" -source = "git+https://github.com/containerd/runwasi?tag=containerd-shim-wasm/v0.4.0#70af32086cfa9e93b75950bc8fb740017f452559" +source = "git+https://github.com/mossaka/runwasi?rev=25ff925e9b2c50d1d72b79a3003b381a599c0b65#25ff925e9b2c50d1d72b79a3003b381a599c0b65" dependencies = [ "anyhow", "caps", @@ -6092,7 +6092,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if 1.0.0", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] diff --git a/containerd-shim-spin/Cargo.toml b/containerd-shim-spin/Cargo.toml index 0672eca0..40454fc1 100644 --- a/containerd-shim-spin/Cargo.toml +++ b/containerd-shim-spin/Cargo.toml @@ -11,7 +11,7 @@ Containerd shim for running Spin workloads. """ [dependencies] -containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", tag = "containerd-shim-wasm/v0.4.0" } +containerd-shim-wasm = { git = "https://github.com/mossaka/runwasi", rev = "25ff925e9b2c50d1d72b79a3003b381a599c0b65" } log = "0.4" spin-app = { git = "https://github.com/fermyon/spin", tag = "v2.0.0" } spin-core = { git = "https://github.com/fermyon/spin", tag = "v2.0.0" } diff --git a/containerd-shim-spin/src/main.rs b/containerd-shim-spin/src/main.rs index 3fb84c5c..ffb766c8 100644 --- a/containerd-shim-spin/src/main.rs +++ b/containerd-shim-spin/src/main.rs @@ -4,5 +4,5 @@ use containerd_shim_wasm::sandbox::cli::{revision, shim_main, version}; mod engine; fn main() { - shim_main::>("spin", version!(), revision!(), None); + shim_main::>("spin", version!(), revision!(), Some("v2"), None); } diff --git a/containerd-shim-wws/Cargo.lock b/containerd-shim-wws/Cargo.lock index abac7f02..10ad7103 100644 --- a/containerd-shim-wws/Cargo.lock +++ b/containerd-shim-wws/Cargo.lock @@ -819,7 +819,7 @@ dependencies = [ [[package]] name = "containerd-shim-wasm" version = "0.4.0" -source = "git+https://github.com/containerd/runwasi?tag=containerd-shim-wasm/v0.4.0#5788ced8525a0d2831718f4a24d06fb4d5af6afb" +source = "git+https://github.com/mossaka/runwasi?rev=25ff925e9b2c50d1d72b79a3003b381a599c0b65#25ff925e9b2c50d1d72b79a3003b381a599c0b65" dependencies = [ "anyhow", "caps", @@ -2043,9 +2043,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libcgroups" diff --git a/containerd-shim-wws/Cargo.toml b/containerd-shim-wws/Cargo.toml index 80191d17..3a728f55 100644 --- a/containerd-shim-wws/Cargo.toml +++ b/containerd-shim-wws/Cargo.toml @@ -14,7 +14,7 @@ Containerd shim for running Wasm Workers Server workloads. [dependencies] anyhow = "1.0" -containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", tag = "containerd-shim-wasm/v0.4.0" } +containerd-shim-wasm = { git = "https://github.com/mossaka/runwasi", rev = "25ff925e9b2c50d1d72b79a3003b381a599c0b65" } wasm-workers-server = { git = "https://github.com/vmware-labs/wasm-workers-server", tag = "v1.7.0" } log = "0.4" tokio = { version = "1", features = [ "full" ] } diff --git a/containerd-shim-wws/src/main.rs b/containerd-shim-wws/src/main.rs index 30be93a4..646518d4 100644 --- a/containerd-shim-wws/src/main.rs +++ b/containerd-shim-wws/src/main.rs @@ -4,5 +4,5 @@ use containerd_shim_wasm::sandbox::cli::{revision, shim_main, version}; mod engine; fn main() { - shim_main::>("wws", version!(), revision!(), None); + shim_main::>("wws", version!(), revision!(), None, None); } diff --git a/deployments/k3d/Makefile b/deployments/k3d/Makefile index 433995d1..bc737a7e 100644 --- a/deployments/k3d/Makefile +++ b/deployments/k3d/Makefile @@ -1,5 +1,5 @@ SHIMS = spin slight wws lunatic - +SPIN_VERSION = v2 IMAGE_NAME ?= k3swithshims CLUSTER_NAME ?= k3s-default PLATFORM ?= linux/amd64 @@ -15,8 +15,10 @@ compile-musl-%: move-musl-to-tmp: $(addprefix compile-musl-,$(SHIMS)) mkdir -p ./.tmp - $(foreach shim,$(SHIMS),cp ../../containerd-shim-$(shim)-v1/target/$(TARGET)/release/containerd-shim-*-v1 ./.tmp/;) - + cp ../../containerd-shim-spin/target/$(TARGET)/release/containerd-shim-spin-$(SPIN_VERSION) ./.tmp/ + cp ../../containerd-shim-slight/target/$(TARGET)/release/containerd-shim-slight-v1 ./.tmp/ + cp ../../containerd-shim-wws/target/$(TARGET)/release/containerd-shim-wws-v1 ./.tmp/ + cp ../../containerd-shim-lunatic/target/$(TARGET)/release/containerd-shim-lunatic-v1 ./.tmp/ build-multi-k3d-image: move-musl-to-tmp docker buildx build -t $(IMAGE_NAME) --platform linux/amd64,linux/arm64 . diff --git a/scripts/move-bins.sh b/scripts/move-bins.sh index 18822362..0620351d 100755 --- a/scripts/move-bins.sh +++ b/scripts/move-bins.sh @@ -20,28 +20,29 @@ set -euo pipefail target="${2:-x86_64-unknown-linux-musl}" -release_pattern="${1:-containerd-shim-%s-v1/target/$target/release}" +release_pattern="${1:-containerd-shim-%s/target/$target/release}" dockerfile_path="deployments/k3d" bin_path="${dockerfile_path}/.tmp/" cluster_name="test-cluster" -default_shim_path="${bin_path}containerd-shim-" declare -A shims=( - [slight]="${default_shim_path}slight-v1" - [spin]="${default_shim_path}spin-v2" - [wws]="${default_shim_path}wws-v1" - [lunatic]="${default_shim_path}lunatic-v1" + [slight]="v1" + [spin]="v2" + [wws]="v1" + [lunatic]="v1" ) mkdir -p "$bin_path" for shim_key in "${!shims[@]}"; do - shim_path=${shims[$shim_key]} + version=${shims[$shim_key]} + release_bin="containerd-shim-${shim_key}-${version}" + shim_path="${bin_path}${release_bin}" release_path=$(printf "$release_pattern" "$shim_key") if [ ! -f "$shim_path" ]; then - echo ">>> install containerd-shim-${shim_key}-v1 from $release_path" - cp "$(eval echo $release_path)/containerd-shim-${shim_key}-v1" "${bin_path}containerd-shim-${shim_key}-v1" + echo ">>> install $release_bin from $release_path" + cp "$release_path/$release_bin" "$shim_path" fi -done +done \ No newline at end of file