Skip to content

Commit

Permalink
update Cargo.lock and fix some bugs in Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
  • Loading branch information
Mossaka committed Nov 7, 2023
1 parent cd15936 commit a3ccec0
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions containerd-shim-lunatic/Cargo.lock

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

2 changes: 1 addition & 1 deletion containerd-shim-lunatic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
10 changes: 5 additions & 5 deletions containerd-shim-slight/Cargo.lock

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

2 changes: 1 addition & 1 deletion containerd-shim-slight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion containerd-shim-slight/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use containerd_shim_wasm::sandbox::cli::{revision, shim_main, version};
mod engine;

fn main() {
shim_main::<Instance<engine::SlightEngine>>("slight", version!(), revision!(), None);
shim_main::<Instance<engine::SlightEngine>>("slight", version!(), revision!(), None, None);
}
4 changes: 2 additions & 2 deletions containerd-shim-spin/Cargo.lock

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

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 = { 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" }
Expand Down
2 changes: 1 addition & 1 deletion containerd-shim-spin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use containerd_shim_wasm::sandbox::cli::{revision, shim_main, version};
mod engine;

fn main() {
shim_main::<Instance<engine::SpinEngine>>("spin", version!(), revision!(), None);
shim_main::<Instance<engine::SpinEngine>>("spin", version!(), revision!(), Some("v2"), None);
}
6 changes: 3 additions & 3 deletions containerd-shim-wws/Cargo.lock

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

2 changes: 1 addition & 1 deletion containerd-shim-wws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ] }
Expand Down
2 changes: 1 addition & 1 deletion containerd-shim-wws/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use containerd_shim_wasm::sandbox::cli::{revision, shim_main, version};
mod engine;

fn main() {
shim_main::<Instance<engine::WwsEngine>>("wws", version!(), revision!(), None);
shim_main::<Instance<engine::WwsEngine>>("wws", version!(), revision!(), None, None);
}
8 changes: 5 additions & 3 deletions deployments/k3d/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SHIMS = spin slight wws lunatic

SPIN_VERSION = v2
IMAGE_NAME ?= k3swithshims
CLUSTER_NAME ?= k3s-default
PLATFORM ?= linux/amd64
Expand All @@ -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 .
Expand Down
21 changes: 11 additions & 10 deletions scripts/move-bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a3ccec0

Please sign in to comment.