From 1b60a948a545beeb08f77ec1b6978e41cb914780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Fri, 1 Sep 2023 10:01:26 +0200 Subject: [PATCH] chore: bump WWS to 1.5.0 --- Makefile | 4 +- containerd-shim-wws-v1/Cargo.lock | 361 ++++++++++++++++++++++--- containerd-shim-wws-v1/Cargo.toml | 4 +- containerd-shim-wws-v1/src/executor.rs | 17 +- containerd-shim-wws-v1/src/main.rs | 30 +- 5 files changed, 354 insertions(+), 62 deletions(-) diff --git a/Makefile b/Makefile index a710b3af..68b5acbb 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ update-deps: test/out_%/img.tar: images/%/Dockerfile mkdir -p $(@D) - docker buildx build --platform=wasi/wasm --load -t $(TEST_IMG_NAME_$*) ./images/$* + docker buildx build --provenance=false --platform=wasi/wasm --load -t $(TEST_IMG_NAME_$*) ./images/$* docker save -o $@ $(TEST_IMG_NAME_$*) load: $(foreach shim,$(SHIMS),test/out_$(shim)/img.tar) @@ -110,4 +110,4 @@ clean: $(addprefix clean-,$(SHIMS)) .PHONY: clean-% clean-%: - cargo clean --manifest-path containerd-shim-$*-v1/Cargo.toml \ No newline at end of file + cargo clean --manifest-path containerd-shim-$*-v1/Cargo.toml diff --git a/containerd-shim-wws-v1/Cargo.lock b/containerd-shim-wws-v1/Cargo.lock index d03b3ce2..8ce7a0b8 100644 --- a/containerd-shim-wws-v1/Cargo.lock +++ b/containerd-shim-wws-v1/Cargo.lock @@ -285,6 +285,54 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.75" @@ -326,6 +374,17 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -577,6 +636,46 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "clap" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "clap_lex" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + [[package]] name = "clone3" version = "0.2.3" @@ -587,6 +686,12 @@ dependencies = [ "uapi", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "command-fds" version = "0.2.2" @@ -706,10 +811,14 @@ dependencies = [ "serde_json", "tokio", "tokio-util", +<<<<<<< HEAD "utils", "wws-config", "wws-router", "wws-server", +======= + "wasm-workers-server", +>>>>>>> 5288576 (chore: bump WWS to 1.5.0) ] [[package]] @@ -957,6 +1066,27 @@ dependencies = [ "typenum", ] +[[package]] +name = "csv" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + [[package]] name = "darling" version = "0.14.4" @@ -1095,6 +1225,16 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" version = "0.3.7" @@ -1123,6 +1263,12 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "encoding_rs" version = "0.8.33" @@ -1132,13 +1278,26 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime 1.3.0", + "log", + "regex", + "termcolor", +] + [[package]] name = "env_logger" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ - "humantime", + "humantime 2.1.0", "is-terminal", "log", "regex", @@ -1201,7 +1360,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a3cc21c33af89af0930c8cae4ade5e6fdc17b5d2c97b3d2e2edb67a1cf683f3" dependencies = [ - "env_logger", + "env_logger 0.10.0", "log", ] @@ -1509,6 +1668,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.2" @@ -1561,6 +1729,15 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + [[package]] name = "humantime" version = "2.1.0" @@ -1693,7 +1870,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -1716,7 +1893,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "rustix 0.38.11", "windows-sys 0.48.0", ] @@ -1858,6 +2035,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + [[package]] name = "libssh2-sys" version = "0.3.0" @@ -2155,7 +2342,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "libc", ] @@ -2253,6 +2440,39 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "openvino" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc731d9a7805dd533b69de3ee33062d5ea1dfa9fca1c19f8fd165b62e2cdde7" +dependencies = [ + "openvino-finder", + "openvino-sys", + "thiserror", +] + +[[package]] +name = "openvino-finder" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bbd80eea06c2b9ec3dce85900ff3ae596c01105b759b38a005af69bbeb4d07" +dependencies = [ + "cfg-if 1.0.0", + "log", +] + +[[package]] +name = "openvino-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "318ed662bdf05a3f86486408159e806d53363171621a8000b81366fab5158713" +dependencies = [ + "libloading", + "once_cell", + "openvino-finder", + "pretty_env_logger", +] + [[package]] name = "os_pipe" version = "1.1.4" @@ -2361,6 +2581,30 @@ dependencies = [ "nix 0.27.1", ] +[[package]] +name = "pretty_env_logger" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d" +dependencies = [ + "env_logger 0.7.1", + "log", +] + +[[package]] +name = "prettytable-rs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a" +dependencies = [ + "csv", + "encode_unicode", + "is-terminal", + "lazy_static", + "term", + "unicode-width", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2546,6 +2790,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.33" @@ -2825,6 +3075,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.15" @@ -3130,6 +3386,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "termcolor" version = "1.2.0" @@ -3491,12 +3758,19 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "utils" version = "0.9.0" dependencies = [ "anyhow", "oci-spec", ] +======= +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +>>>>>>> 5288576 (chore: bump WWS to 1.5.0) [[package]] name = "utoipa" @@ -3700,6 +3974,22 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-workers-server" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" +dependencies = [ + "actix-web", + "anyhow", + "clap", + "env_logger 0.10.0", + "prettytable-rs", + "wws-config", + "wws-project", + "wws-router", + "wws-server", +] + [[package]] name = "wasmparser" version = "0.107.0" @@ -4006,6 +4296,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wasmtime-wasi-nn" +version = "10.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a74375e57624b24d790b8d1427bdde6c4ef9a76e4148b5b73998353dc973c24e" +dependencies = [ + "anyhow", + "openvino", + "thiserror", + "walkdir", + "wiggle", +] + [[package]] name = "wasmtime-winch" version = "10.0.1" @@ -4463,8 +4766,8 @@ dependencies = [ [[package]] name = "wws-api-manage" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ "actix-web", "serde", @@ -4476,10 +4779,9 @@ dependencies = [ [[package]] name = "wws-config" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ - "anyhow", "serde", "serde_json", "toml 0.7.6", @@ -4488,18 +4790,17 @@ dependencies = [ [[package]] name = "wws-data-kv" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ - "anyhow", "serde", "serde_json", ] [[package]] name = "wws-panel" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ "actix-web", "mime_guess", @@ -4508,10 +4809,9 @@ dependencies = [ [[package]] name = "wws-project" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ - "anyhow", "git2", "reqwest", "serde", @@ -4525,8 +4825,8 @@ dependencies = [ [[package]] name = "wws-router" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ "lazy_static", "regex", @@ -4539,10 +4839,9 @@ dependencies = [ [[package]] name = "wws-runtimes" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ - "anyhow", "serde", "serde_json", "wasmtime-wasi", @@ -4553,12 +4852,11 @@ dependencies = [ [[package]] name = "wws-server" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ "actix-files", "actix-web", - "anyhow", "wws-api-manage", "wws-data-kv", "wws-panel", @@ -4568,20 +4866,18 @@ dependencies = [ [[package]] name = "wws-store" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ - "anyhow", "blake3", ] [[package]] name = "wws-worker" -version = "1.4.0" -source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.4.0#0f5404b445e2ffef282a6f7d4a29693f33b31e6b" +version = "1.5.0" +source = "git+https://github.com/vmware-labs/wasm-workers-server?tag=v1.5.0#748e02c21a35df3560f961983fcd281160785bec" dependencies = [ "actix-web", - "anyhow", "base64", "reqwest", "serde", @@ -4592,6 +4888,7 @@ dependencies = [ "wasi-common", "wasmtime", "wasmtime-wasi", + "wasmtime-wasi-nn", "wit-bindgen-wasmtime", "wws-config", "wws-data-kv", diff --git a/containerd-shim-wws-v1/Cargo.toml b/containerd-shim-wws-v1/Cargo.toml index b9f97cec..49fe5af7 100644 --- a/containerd-shim-wws-v1/Cargo.toml +++ b/containerd-shim-wws-v1/Cargo.toml @@ -16,9 +16,7 @@ Containerd shim for running Wasm Workers Server workloads. containerd-shim = "0.5.0" containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", rev = "7e978edeaf34b54efb895738357c805cf888b76d", features = ["cgroupsv2"] } libcontainer = { git = "https://github.com/containers/youki", rev = "09e67372a892f22a89eeef62ff429c3cbcac6d41", features = ["v2"], default-features = false } -wws-config = { git = "https://github.com/vmware-labs/wasm-workers-server", tag = "v1.4.0" } -wws-server = { git = "https://github.com/vmware-labs/wasm-workers-server", tag = "v1.4.0" } -wws-router = { git = "https://github.com/vmware-labs/wasm-workers-server", tag = "v1.4.0" } +wasm-workers-server = { git = "https://github.com/vmware-labs/wasm-workers-server", tag = "v1.5.0" } log = "0.4" tokio = { version = "1", features = [ "full" ] } tokio-util = { version = "0.7", features = [ "codec" ]} diff --git a/containerd-shim-wws-v1/src/executor.rs b/containerd-shim-wws-v1/src/executor.rs index e2edc56d..6d1a1289 100644 --- a/containerd-shim-wws-v1/src/executor.rs +++ b/containerd-shim-wws-v1/src/executor.rs @@ -7,9 +7,11 @@ use containerd_shim_wasm::{libcontainer_instance::LinuxContainerExecutor, sandbo use libcontainer::workload::{Executor, ExecutorError, ExecutorValidationError}; use oci_spec::runtime::Spec; use utils::is_linux_executable; -use wws_config::Config; -use wws_router::Routes; -use wws_server::serve; +use wasm_workers_server::{ + wws_config::Config, + wws_router::Routes, + wws_server::{serve, Panel, ServeOptions}, +}; /// URL to listen to in wws const WWS_ADDR: &str = "0.0.0.0"; @@ -50,7 +52,14 @@ impl WwsExecutor { } async fn wasm_exec_async(&self, root: &Path, routes: Routes) -> Result<()> { - let server = serve(root, routes, WWS_ADDR, WWS_PORT, false, None).await?; + let server = serve(ServeOptions { + root_path: path, + base_routes: routes, + hostname: WWS_ADDR.to_string(), + port: WWS_PORT, + panel: Panel::Disabled, + cors_origins: None, + }).await?; info!(" >>> notifying main thread we are about to start"); Ok(server.await?) } diff --git a/containerd-shim-wws-v1/src/main.rs b/containerd-shim-wws-v1/src/main.rs index 5ec878ff..18af69c2 100644 --- a/containerd-shim-wws-v1/src/main.rs +++ b/containerd-shim-wws-v1/src/main.rs @@ -18,11 +18,6 @@ static DEFAULT_CONTAINER_ROOT_DIR: &str = "/run/containerd/wws"; pub struct Workers { exit_code: ExitCode, id: String, - // TODO: set the stdio to redirect the logs to the pod. Currently, we only set the - // stderr as Wasm Workers use stdin/stdout to pass and receive data. This behavior - // will change in the future. - // stdin: String, - // stdout: String, stdio: Stdio, bundle: String, rootdir: PathBuf, @@ -44,11 +39,6 @@ impl LibcontainerInstance for Workers { Workers { exit_code: Default::default(), id, - // TODO: set the stdio to redirect the logs to the pod. Currently, we only set the - // stderr as Wasm Workers use stdin/stdout to pass and receive data. This behavior - // will change in the future. - // stdin: cfg.get_stdin().unwrap_or_default(), - // stdout: cfg.get_stdout().unwrap_or_default(), stdio: Stdio::init_from_cfg(cfg).expect("failed to open stdio"), bundle, rootdir, @@ -70,17 +60,15 @@ impl LibcontainerInstance for Workers { fn build_container(&self) -> std::result::Result { let err_others = |err| Error::Others(format!("failed to create container: {}", err)); let wws_executor = WwsExecutor::new(self.stdio.take()); - - let container = ContainerBuilder::new(self.id.clone(), SyscallType::Linux) - .with_executor(wws_executor) - .with_root_path(self.rootdir.clone()) - .map_err(err_others)? - .as_init(&self.bundle) - .with_systemd(false) - .with_detach(true) - .build() - .map_err(err_others)?; - Ok(container) + Ok(ContainerBuilder::new(self.id.clone(), SyscallType::Linux) + .with_executor(wws_executor) + .with_root_path(self.rootdir.clone()) + .map_err(err_others)? + .as_init(&self.bundle) + .with_systemd(false) + .with_detach(true) + .build() + .map_err(err_others)?) } }