diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ecdafc5e..f31d327b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,4 +46,7 @@ jobs: run: make install-k3d working-directory: ./deployments/k3d - name: run integration tests - run: make test \ No newline at end of file + run: make test + - name: clean up k3d + if: always() + run: make test/clean \ No newline at end of file diff --git a/Makefile b/Makefile index 556d3343..8b31649a 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,9 @@ unit-tests: build integration-tests: build $(PYTHON) tests/setup.py $(TARGET) cargo test -- --nocapture + +.PHONY: tests/clean +test/clean: $(PYTHON) tests/teardown.py .PHONY: fmt diff --git a/containerd-shim-spin-v1/Cargo.lock b/containerd-shim-spin-v1/Cargo.lock index 9ee0d244..f09b1f08 100644 --- a/containerd-shim-spin-v1/Cargo.lock +++ b/containerd-shim-spin-v1/Cargo.lock @@ -17,6 +17,15 @@ dependencies = [ "gimli", ] +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -62,9 +71,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "allocator-api2" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f263788a35611fba42eb41ff811c5d0360c58b97402570312a350736e2542e" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "ambient-authority" @@ -104,15 +113,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] @@ -138,9 +147,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "arbitrary" @@ -150,9 +159,9 @@ checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -174,9 +183,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0122885821398cc923ece939e24d1056a2384ee719432397fa9db87230ff11" +checksum = "62b74f44609f0f91493e3082d3734d98497e094777144380ea4db9f9905dd5b6" dependencies = [ "flate2", "futures-core", @@ -187,13 +196,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -234,9 +243,9 @@ dependencies = [ "rustc_version", "serde", "serde_json", - "time 0.3.22", + "time 0.3.23", "url", - "uuid 1.3.4", + "uuid", ] [[package]] @@ -253,11 +262,26 @@ dependencies = [ "log", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", - "time 0.3.22", + "time 0.3.23", "url", - "uuid 1.3.4", + "uuid", +] + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line 0.20.0", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object 0.31.1", + "rustc-demangle", ] [[package]] @@ -338,11 +362,11 @@ dependencies = [ "serde", "serde_cbor", "serde_json", - "sha2 0.10.6", + "sha2 0.10.7", "sled", "tempfile", "thiserror", - "time 0.3.22", + "time 0.3.23", "tokio", "tokio-stream", "tokio-tar", @@ -361,9 +385,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" [[package]] name = "bitvec" @@ -432,7 +456,7 @@ checksum = "58bc48200a1a0fa6fba138b1802ad7def18ec1cdd92f7b2a04e21f1bd887f7b9" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes", + "io-lifetimes 1.0.11", "windows-sys 0.48.0", ] @@ -445,12 +469,12 @@ dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes", + "io-lifetimes 1.0.11", "ipnet", "maybe-owned", - "rustix", + "rustix 0.37.23", "windows-sys 0.48.0", - "winx", + "winx 0.35.1", ] [[package]] @@ -471,8 +495,8 @@ checksum = "3373a62accd150b4fcba056d4c5f3b552127f0ec86d3c8c102d60b978174a012" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes", - "rustix", + "io-lifetimes 1.0.11", + "rustix 0.37.23", ] [[package]] @@ -483,8 +507,8 @@ checksum = "e95002993b7baee6b66c8950470e59e5226a23b3af39fc59c47fe416dd39821a" dependencies = [ "cap-primitives", "once_cell", - "rustix", - "winx", + "rustix 0.37.23", + "winx 0.35.1", ] [[package]] @@ -527,6 +551,18 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cgroups-rs" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3845d8ddaca63e9975f07b7a32262afe284561c2f0f620aa968913a65f671fd2" +dependencies = [ + "libc", + "log", + "nix 0.24.3", + "regex", +] + [[package]] name = "chrono" version = "0.4.26" @@ -573,7 +609,7 @@ dependencies = [ "bitflags 1.3.2", "clap_derive 3.2.25", "clap_lex 0.2.4", - "indexmap", + "indexmap 1.9.3", "once_cell", "strsim", "termcolor", @@ -582,24 +618,23 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.3" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8f255e4b8027970e78db75e78831229c9815fdbfa67eb1a1b777a62e24b4a0" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", - "clap_derive 4.3.2", + "clap_derive 4.3.12", "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.3" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd4f3c17c83b0ba34ffbc4f8bbd74f079413f747f84a6f89292f138057e36ab" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", - "bitflags 1.3.2", "clap_lex 0.5.0", "strsim", ] @@ -610,7 +645,7 @@ version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-error", "proc-macro2", "quote", @@ -619,14 +654,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -705,35 +740,39 @@ dependencies = [ [[package]] name = "containerd-shim" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b7dc0083bae091806fe57ef508eada5a96244b41c6b8a555d1ef316f433b6de" +source = "git+https://github.com/containerd/rust-extensions?rev=7f7e3117a6ecb49e5e3b48b4f457a4914d2f2b93#7f7e3117a6ecb49e5e3b48b4f457a4914d2f2b93" dependencies = [ + "cgroups-rs", "command-fds", "containerd-shim-protos", "go-flag", "lazy_static", "libc", "log", - "nix 0.23.2", - "oci-spec 0.5.8", + "mio", + "nix 0.26.2", + "oci-spec", + "os_pipe", + "page_size", "prctl", + "regex", "serde", "serde_derive", "serde_json", "signal-hook", "thiserror", - "time 0.3.22", - "uuid 0.8.2", + "time 0.3.23", + "windows-sys 0.48.0", ] [[package]] name = "containerd-shim-protos" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "077ec778a0835d9d85502e8535362130187759b69eddabe2bdb3a68ffb575bd0" +version = "0.3.0" +source = "git+https://github.com/containerd/rust-extensions?rev=7f7e3117a6ecb49e5e3b48b4f457a4914d2f2b93#7f7e3117a6ecb49e5e3b48b4f457a4914d2f2b93" dependencies = [ - "protobuf", + "protobuf 3.2.0", "ttrpc", + "ttrpc-codegen", ] [[package]] @@ -743,10 +782,14 @@ dependencies = [ "anyhow", "async-trait", "chrono", - "clap 4.3.3", + "clap 4.3.19", "containerd-shim", "containerd-shim-wasm", + "libc", + "libcontainer", "log", + "nix 0.26.2", + "oci-spec", "openssl", "reqwest", "serde", @@ -766,9 +809,8 @@ dependencies = [ [[package]] name = "containerd-shim-wasm" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2671b0d99b6656f32f8ff4e6d228ad547f199fb943f545fd7bfb36e666a57e72" +version = "0.2.0" +source = "git+https://github.com/containerd/runwasi?rev=006b95f8aec41b0872e5472b718381468c36cb8a#006b95f8aec41b0872e5472b718381468c36cb8a" dependencies = [ "anyhow", "caps", @@ -779,9 +821,9 @@ dependencies = [ "libc", "log", "nix 0.26.2", - "oci-spec 0.6.1", + "oci-spec", "proc-mounts", - "protobuf", + "protobuf 3.2.0", "serde", "serde_json", "thiserror", @@ -815,9 +857,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -926,7 +968,7 @@ dependencies = [ "itertools", "log", "smallvec", - "wasmparser", + "wasmparser 0.107.0", "wasmtime-types", ] @@ -1080,7 +1122,18 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "uuid 1.3.4", + "uuid", +] + +[[package]] +name = "derive-new" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -1241,9 +1294,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" [[package]] name = "ed25519" @@ -1270,9 +1323,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" @@ -1296,6 +1349,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -1344,14 +1403,20 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "fd-lock" -version = "3.0.12" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ae6b3d9530211fb3b12a95374b8b0823be812f53d09e18c5675c0146b09642" +checksum = "0b0377f1edc77dbd1118507bc7a66e4ab64d2b90c66f90726dc801e73a8c68f9" dependencies = [ "cfg-if 1.0.0", - "rustix", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -1377,6 +1442,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "fixedbitset" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.26" @@ -1420,12 +1497,12 @@ dependencies = [ [[package]] name = "fs-set-times" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7833d0f115a013d51c55950a3b09d30e4b057be9961b709acb9b5b17a1108861" +checksum = "6d167b646a876ba8fda6b50ac645cfd96242553cbaf0ca4fccaa39afcbf0801f" dependencies = [ - "io-lifetimes", - "rustix", + "io-lifetimes 1.0.11", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -1485,6 +1562,7 @@ dependencies = [ "futures-core", "futures-task", "futures-util", + "num_cpus", ] [[package]] @@ -1499,7 +1577,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -1516,7 +1594,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -1564,7 +1642,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "debugid", "fxhash", "serde", @@ -1619,12 +1697,12 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] @@ -1645,9 +1723,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -1655,7 +1733,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util 0.7.8", @@ -1705,6 +1783,15 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "heck" version = "0.4.1" @@ -1722,18 +1809,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "hermit-abi" -version = "0.3.1" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hmac" @@ -1818,9 +1902,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1842,13 +1926,14 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", - "rustls 0.21.1", + "rustls 0.21.5", "tokio", "tokio-rustls 0.24.1", ] @@ -1922,6 +2007,16 @@ dependencies = [ "serde", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + [[package]] name = "infer" version = "0.2.3" @@ -1943,7 +2038,7 @@ version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde93d48f0d9277f977a333eca8313695ddd5301dc96f7e02aeddcb0dd99096f" dependencies = [ - "io-lifetimes", + "io-lifetimes 1.0.11", "windows-sys 0.48.0", ] @@ -1953,26 +2048,31 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] +[[package]] +name = "io-lifetimes" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffb4def18c48926ccac55c1223e02865ce1a821751a95920448662696e7472c" + [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", + "hermit-abi 0.3.2", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -1987,9 +2087,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "ittapi" @@ -2136,9 +2236,52 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "libcgroups" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "12f6fef16f505466473eeeee906244e03a437beaf41ccd85c39355b4077890c9" +dependencies = [ + "fixedbitset 0.4.2", + "nix 0.26.2", + "oci-spec", + "procfs", + "serde", + "thiserror", + "tracing", +] + +[[package]] +name = "libcontainer" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac48a05819bd5bd31390bd1874f5a94f711c248677fc908801de4789bdd1fbad" +dependencies = [ + "bitflags 2.3.3", + "caps", + "chrono", + "clone3", + "fastrand 2.0.0", + "futures", + "libc", + "libcgroups", + "nix 0.26.2", + "oci-spec", + "once_cell", + "prctl", + "procfs", + "regex", + "rust-criu", + "safe-path", + "serde", + "serde_json", + "thiserror", + "tracing", +] [[package]] name = "libloading" @@ -2183,20 +2326,32 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.9" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468756f34903b582fe7154dc1ffdebd89d0562c4a43b53c621bb0f1b1043ccb" +checksum = "3dd9f43e75536a46ee0f92b758f6b63846e594e86638c61a9251338a65baea63" dependencies = [ "cmake", "libc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "linux-raw-sys" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "lock_api" version = "0.4.10" @@ -2267,7 +2422,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "rustix", + "rustix 0.37.23", ] [[package]] @@ -2349,6 +2504,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "mysql_async" version = "0.30.0" @@ -2407,7 +2568,7 @@ dependencies = [ "serde", "serde_json", "sha1 0.10.5", - "sha2 0.10.6", + "sha2 0.10.7", "smallvec", "subprocess", "thiserror", @@ -2446,15 +2607,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.23.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags 1.3.2", - "cc", "cfg-if 1.0.0", "libc", - "memoffset 0.6.5", ] [[package]] @@ -2504,20 +2663,20 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.2", "libc", ] @@ -2545,7 +2704,7 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "url", ] @@ -2558,28 +2717,24 @@ checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", "hashbrown 0.13.2", - "indexmap", + "indexmap 1.9.3", "memchr", ] [[package]] -name = "oci-spec" -version = "0.5.8" +name = "object" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98135224dd4faeb24c05a2fac911ed53ea6b09ecb09d7cada1cb79963ab2ee34" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ - "derive_builder 0.11.2", - "getset", - "serde", - "serde_json", - "thiserror", + "memchr", ] [[package]] name = "oci-spec" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf77d2eace1f4909b081d231d1ad3570ba3448ae95290ab701314faaee1b611a" +checksum = "9421b067205c68dc80af7c68599a9c1eb113f975aafeb874cea7f4d5d41ce3fb" dependencies = [ "derive_builder 0.12.0", "getset", @@ -2602,9 +2757,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.54" +version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ "bitflags 1.3.2", "cfg-if 1.0.0", @@ -2623,7 +2778,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -2643,9 +2798,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.88" +version = "0.9.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" dependencies = [ "cc", "libc", @@ -2660,6 +2815,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "os_pipe" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "os_str_bytes" version = "6.5.1" @@ -2748,6 +2913,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "page_size" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b7663cbd190cfd818d08efa8497f6cd383076688c49a391ef7c0d03cd12b561" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "parking" version = "2.1.0" @@ -2799,7 +2974,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets", + "windows-targets 0.48.1", ] [[package]] @@ -2813,9 +2988,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "path-absolutize" @@ -2856,11 +3031,21 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +[[package]] +name = "petgraph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +dependencies = [ + "fixedbitset 0.2.0", + "indexmap 1.9.3", +] + [[package]] name = "phf" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_shared", ] @@ -2877,9 +3062,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", "rand 0.8.5", @@ -2887,9 +3072,9 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", "uncased", @@ -2897,29 +3082,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -2960,7 +3145,7 @@ dependencies = [ "md-5", "memchr", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "stringprep", ] @@ -2988,7 +3173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "059a34f111a9dee2ce1ac2826a68b24601c4298cfeb1a587c3cb493d5ab46f52" dependencies = [ "libc", - "nix 0.22.3", + "nix 0.26.2", ] [[package]] @@ -3017,9 +3202,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -3033,29 +3218,136 @@ dependencies = [ "partition-identity", ] +[[package]] +name = "procfs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "chrono", + "flate2", + "hex", + "lazy_static", + "rustix 0.36.15", +] + +[[package]] +name = "prost" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" +dependencies = [ + "bytes", + "heck 0.3.3", + "itertools", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" +dependencies = [ + "bytes", + "prost", +] + [[package]] name = "protobuf" version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +[[package]] +name = "protobuf" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55bad9126f378a853655831eb7363b7b01b81d19f8cb1218861086ca4a1a61e" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror", +] + [[package]] name = "protobuf-codegen" version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6" dependencies = [ - "protobuf", + "protobuf 2.28.0", ] [[package]] -name = "protobuf-codegen-pure" -version = "2.28.0" +name = "protobuf-codegen" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a29399fc94bcd3eeaa951c715f7bea69409b2445356b00519740bcd6ddd865" +checksum = "0dd418ac3c91caa4032d37cb80ff0d44e2ebe637b2fb243b6234bf89cdac4901" dependencies = [ - "protobuf", - "protobuf-codegen", + "anyhow", + "once_cell", + "protobuf 3.2.0", + "protobuf-parse", + "regex", + "tempfile", + "thiserror", +] + +[[package]] +name = "protobuf-parse" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d39b14605eaa1f6a340aec7f320b34064feb26c93aec35d6a9a2272a8ddfa49" +dependencies = [ + "anyhow", + "indexmap 1.9.3", + "log", + "protobuf 3.2.0", + "protobuf-support", + "tempfile", + "thiserror", + "which", +] + +[[package]] +name = "protobuf-support" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d4d7b8601c814cfb36bcebb79f0e61e45e1e93640cf778837833bbed05c372" +dependencies = [ + "thiserror", ] [[package]] @@ -3080,9 +3372,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -3252,9 +3544,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", @@ -3263,9 +3567,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" @@ -3273,7 +3577,7 @@ version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "async-compression 0.4.0", + "async-compression 0.4.1", "base64 0.21.2", "bytes", "encoding_rs", @@ -3293,8 +3597,8 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.1", - "rustls-pemfile 1.0.2", + "rustls 0.21.5", + "rustls-pemfile 1.0.3", "serde", "serde_json", "serde_urlencoded", @@ -3333,7 +3637,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -3341,6 +3645,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "rust-criu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4737b28406b3395359f485127073117a11cedc8942738b69ba6ab9a79432acbc" +dependencies = [ + "anyhow", + "libc", + "protobuf 3.2.0", + "protobuf-codegen 3.2.0", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3398,20 +3714,47 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.20" +version = "0.36.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes 1.0.11", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", "errno", - "io-lifetimes", + "io-lifetimes 1.0.11", "itoa", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", "once_cell", "windows-sys 0.48.0", ] +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.3", + "windows-sys 0.48.0", +] + [[package]] name = "rustls" version = "0.20.8" @@ -3426,9 +3769,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.1" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" dependencies = [ "log", "ring", @@ -3447,18 +3790,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64 0.21.2", ] [[package]] name = "rustls-webpki" -version = "0.100.1" +version = "0.101.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" dependencies = [ "ring", "untrusted", @@ -3466,9 +3809,18 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "safe-path" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "980abdd3220aa19b67ca3ea07b173ca36383f18ae48cde696d90c8af39447ffb" +dependencies = [ + "libc", +] [[package]] name = "same-file" @@ -3497,18 +3849,18 @@ checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71" [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -3522,9 +3874,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3535,9 +3887,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -3545,18 +3897,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.164" +version = "1.0.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "63ba2516aa6bf82e0b19ca8b50019d52df58455d3cf9bdaf6315225fdd0c560a" dependencies = [ "serde_derive", ] @@ -3573,20 +3925,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "401797fe7833d72109fedec6bfcbe67c0eed9b99772f26eb8afd261f0abc6fd3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ "itoa", "ryu", @@ -3595,10 +3947,11 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" dependencies = [ + "itoa", "serde", ] @@ -3666,9 +4019,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -3701,9 +4054,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -3733,7 +4086,7 @@ dependencies = [ "num-bigint", "num-traits", "thiserror", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -3775,9 +4128,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "socket2" @@ -3826,7 +4179,7 @@ source = "git+https://github.com/fermyon/spin?tag=v1.4.0#7aab1fe43be70a271ba6336 dependencies = [ "anyhow", "dirs 4.0.0", - "sha2 0.10.6", + "sha2 0.10.7", "tokio", ] @@ -3836,8 +4189,8 @@ version = "0.1.0" source = "git+https://github.com/fermyon/spin-componentize?rev=3653d24ee95b4efcc39de52b5c988b435f87712a#3653d24ee95b4efcc39de52b5c988b435f87712a" dependencies = [ "anyhow", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.29.0", + "wasmparser 0.107.0", "wit-component", "wit-parser", ] @@ -3870,7 +4223,7 @@ dependencies = [ "cap-std", "crossbeam-channel", "io-extras", - "rustix", + "rustix 0.37.23", "system-interface", "tracing", "wasi-common", @@ -3886,7 +4239,7 @@ dependencies = [ "anyhow", "http", "hyper", - "indexmap", + "indexmap 1.9.3", "percent-encoding", "serde", "spin-app", @@ -3991,7 +4344,7 @@ name = "spin-manifest" version = "1.4.0" source = "git+https://github.com/fermyon/spin?tag=v1.4.0#7aab1fe43be70a271ba6336b959cd52191fc2253" dependencies = [ - "indexmap", + "indexmap 1.9.3", "serde", "thiserror", "toml", @@ -4068,7 +4421,7 @@ dependencies = [ "ctrlc", "dirs 4.0.0", "futures", - "indexmap", + "indexmap 1.9.3", "outbound-http", "outbound-mysql", "outbound-pg", @@ -4111,7 +4464,7 @@ dependencies = [ "futures-util", "http", "hyper", - "indexmap", + "indexmap 1.9.3", "percent-encoding", "rustls-pemfile 0.3.0", "serde", @@ -4151,10 +4504,10 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3995a6daa13c113217b6ad22154865fb06f9cb939bef398fd04f4a7aaaf5bd7" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "cc", "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "log", "memchr", "phf", @@ -4187,9 +4540,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -4230,9 +4583,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -4253,18 +4606,18 @@ dependencies = [ [[package]] name = "system-interface" -version = "0.25.7" +version = "0.25.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928ebd55ab758962e230f51ca63735c5b283f26292297c81404289cda5d78631" +checksum = "10081a99cbecbc363d381b9503563785f0b02735fccbb0d4c1a2cb3d39f7e7fe" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", "cap-fs-ext", "cap-std", "fd-lock", - "io-lifetimes", - "rustix", + "io-lifetimes 2.0.2", + "rustix 0.38.4", "windows-sys 0.48.0", - "winx", + "winx 0.36.1", ] [[package]] @@ -4275,21 +4628,20 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.7" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" +checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ - "autocfg", "cfg-if 1.0.0", - "fastrand", + "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -4320,22 +4672,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -4351,9 +4703,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "itoa", "libc", @@ -4371,9 +4723,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] @@ -4409,11 +4761,12 @@ dependencies = [ [[package]] name = "tokio" -version = "1.28.2" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -4434,7 +4787,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -4488,7 +4841,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.1", + "rustls 0.21.5", "tokio", ] @@ -4505,14 +4858,14 @@ dependencies = [ [[package]] name = "tokio-tar" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50188549787c32c1c3d9c8c71ad7e003ccf2f102489c5a96e385c84760477f4" +checksum = "9d5714c010ca3e5c27114c1cdeb9d14641ace49874aa5626d7149e47aedace75" dependencies = [ "filetime", "futures-core", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "tokio", "tokio-stream", "xattr", @@ -4576,13 +4929,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -4612,17 +4965,45 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "ttrpc" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ecfff459a859c6ba6668ff72b34c2f1d94d9d58f7088414c2674ad0f31cc7d8" +checksum = "adb03d0f5219ec54d870cb3d58719a2dc0b8849405b75a2e0968b3590392a5b0" dependencies = [ "byteorder", "libc", "log", - "nix 0.23.2", - "protobuf", - "protobuf-codegen-pure", + "nix 0.26.2", + "protobuf 3.2.0", + "protobuf-codegen 3.2.0", "thiserror", + "windows-sys 0.48.0", +] + +[[package]] +name = "ttrpc-codegen" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94d7f7631d7a9ebed715a47cd4cb6072cbc7ae1d4ec01598971bbec0024340c2" +dependencies = [ + "protobuf 2.28.0", + "protobuf-codegen 3.2.0", + "protobuf-support", + "ttrpc-compiler", +] + +[[package]] +name = "ttrpc-compiler" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3cb5dbf1f0865a34fe3f722290fe776cacb16f50428610b779467b76ddf647" +dependencies = [ + "derive-new", + "prost", + "prost-build", + "prost-types", + "protobuf 2.28.0", + "protobuf-codegen 2.28.0", + "tempfile", ] [[package]] @@ -4631,7 +5012,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "rand 0.8.5", "static_assertions", ] @@ -4694,9 +5075,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -4707,6 +5088,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + [[package]] name = "unicode-width" version = "0.1.10" @@ -4745,18 +5132,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.10", -] - -[[package]] -name = "uuid" -version = "1.3.4" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa2982af2eec27de306107c027578ff7f423d65f7250e40ce0fea8f45248b81" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom 0.2.10", ] @@ -4811,11 +5189,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -4851,10 +5228,10 @@ dependencies = [ "cap-time-ext", "fs-set-times", "io-extras", - "io-lifetimes", + "io-lifetimes 1.0.11", "is-terminal", "once_cell", - "rustix", + "rustix 0.37.23", "system-interface", "tracing", "wasi-common", @@ -4873,7 +5250,7 @@ dependencies = [ "cap-std", "io-extras", "log", - "rustix", + "rustix 0.37.23", "thiserror", "tracing", "wasmtime", @@ -4890,8 +5267,8 @@ dependencies = [ "anyhow", "cap-std", "io-extras", - "io-lifetimes", - "rustix", + "io-lifetimes 1.0.11", + "rustix 0.37.23", "tokio", "wasi-cap-std-sync", "wasi-common", @@ -4919,7 +5296,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", "wasm-bindgen-shared", ] @@ -4953,7 +5330,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4973,6 +5350,15 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-encoder" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41763f20eafed1399fff1afb466496d3a959f58241436cfdc17e3f5ca954de16" +dependencies = [ + "leb128", +] + [[package]] name = "wasm-metadata" version = "0.8.0" @@ -4980,10 +5366,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" dependencies = [ "anyhow", - "indexmap", + "indexmap 1.9.3", "serde", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.29.0", + "wasmparser 0.107.0", ] [[package]] @@ -5005,18 +5391,28 @@ version = "0.107.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" dependencies = [ - "indexmap", + "indexmap 1.9.3", + "semver", +] + +[[package]] +name = "wasmparser" +version = "0.110.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dfcdb72d96f01e6c85b6bf20102e7423bdbaad5c337301bab2bbf253d26413c" +dependencies = [ + "indexmap 2.0.0", "semver", ] [[package]] name = "wasmprinter" -version = "0.2.59" +version = "0.2.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc960b30b84abca377768f3c62cff3a1c74db8c0f6759ed581827da0bd3a3fed" +checksum = "42cd12ed4d96a984e4b598a17457f1126d01640cc7461afbb319642111ff9e7f" dependencies = [ "anyhow", - "wasmparser", + "wasmparser 0.110.0", ] [[package]] @@ -5032,10 +5428,10 @@ dependencies = [ "cfg-if 1.0.0", "encoding_rs", "fxprof-processed-profile", - "indexmap", + "indexmap 1.9.3", "libc", "log", - "object", + "object 0.30.4", "once_cell", "paste", "psm", @@ -5043,7 +5439,7 @@ dependencies = [ "serde", "serde_json", "target-lexicon", - "wasmparser", + "wasmparser 0.107.0", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -5078,9 +5474,9 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix", + "rustix 0.37.23", "serde", - "sha2 0.10.6", + "sha2 0.10.7", "toml", "windows-sys 0.48.0", "zstd", @@ -5122,10 +5518,10 @@ dependencies = [ "cranelift-wasm", "gimli", "log", - "object", + "object 0.30.4", "target-lexicon", "thiserror", - "wasmparser", + "wasmparser 0.107.0", "wasmtime-cranelift-shared", "wasmtime-environ", ] @@ -5141,7 +5537,7 @@ dependencies = [ "cranelift-control", "cranelift-native", "gimli", - "object", + "object 0.30.4", "target-lexicon", "wasmtime-environ", ] @@ -5155,14 +5551,14 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli", - "indexmap", + "indexmap 1.9.3", "log", - "object", + "object 0.30.4", "serde", "target-lexicon", "thiserror", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.29.0", + "wasmparser 0.107.0", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -5176,7 +5572,7 @@ checksum = "14309cbdf2c395258b124a24757c727403070c0465a28bcc780c4f82f4bca5ff" dependencies = [ "cc", "cfg-if 1.0.0", - "rustix", + "rustix 0.37.23", "wasmtime-asm-macros", "windows-sys 0.48.0", ] @@ -5187,7 +5583,7 @@ version = "10.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f0f2eaeb01bb67266416507829bd8e0bb60278444e4cbd048e280833ebeaa02" dependencies = [ - "addr2line", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if 1.0.0", @@ -5195,9 +5591,9 @@ dependencies = [ "gimli", "ittapi", "log", - "object", + "object 0.30.4", "rustc-demangle", - "rustix", + "rustix 0.37.23", "serde", "target-lexicon", "wasmtime-environ", @@ -5213,9 +5609,9 @@ version = "10.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f42e59d62542bfb73ce30672db7eaf4084a60b434b688ac4f05b287d497de082" dependencies = [ - "object", + "object 0.30.4", "once_cell", - "rustix", + "rustix 0.37.23", ] [[package]] @@ -5239,7 +5635,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "encoding_rs", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", @@ -5247,7 +5643,7 @@ dependencies = [ "memoffset 0.8.0", "paste", "rand 0.8.5", - "rustix", + "rustix 0.37.23", "sptr", "wasmtime-asm-macros", "wasmtime-environ", @@ -5265,7 +5661,7 @@ dependencies = [ "cranelift-entity", "serde", "thiserror", - "wasmparser", + "wasmparser 0.107.0", ] [[package]] @@ -5284,7 +5680,7 @@ dependencies = [ "fs-set-times", "io-extras", "libc", - "rustix", + "rustix 0.37.23", "system-interface", "thiserror", "tracing", @@ -5305,9 +5701,9 @@ dependencies = [ "anyhow", "cranelift-codegen", "gimli", - "object", + "object 0.30.4", "target-lexicon", - "wasmparser", + "wasmparser 0.107.0", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", @@ -5320,7 +5716,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3334b0466a4d340de345cda83474d1d2c429770c3d667877971407672bc618a" dependencies = [ "anyhow", - "heck", + "heck 0.4.1", "wit-parser", ] @@ -5335,23 +5731,23 @@ dependencies = [ [[package]] name = "wast" -version = "60.0.0" +version = "62.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd06cc744b536e30387e72a48fdd492105b9c938bb4f415c39c616a7a0a697ad" +checksum = "b8ae06f09dbe377b889fbd620ff8fa21e1d49d1d9d364983c0cdbf9870cb9f1f" dependencies = [ "leb128", "memchr", "unicode-width", - "wasm-encoder", + "wasm-encoder 0.31.1", ] [[package]] name = "wat" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5abe520f0ab205366e9ac7d3e6b2fc71de44e32a2b58f2ec871b6b575bdcea3b" +checksum = "842e15861d203fb4a96d314b0751cdeaf0f6f8b35e8d81d2953af2af5e44e637" dependencies = [ - "wast 60.0.0", + "wast 62.0.1", ] [[package]] @@ -5383,6 +5779,17 @@ dependencies = [ "webpki", ] +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + [[package]] name = "wiggle" version = "10.0.1" @@ -5405,7 +5812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7df96ee6bea595fabf0346c08c553f684b08e88fad6fdb125e6efde047024f7b" dependencies = [ "anyhow", - "heck", + "heck 0.4.1", "proc-macro2", "quote", "shellexpand 2.1.2", @@ -5468,7 +5875,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser", + "wasmparser 0.107.0", "wasmtime-environ", ] @@ -5478,22 +5885,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.1", ] [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.42.2", ] [[package]] @@ -5502,14 +5903,29 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.1", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", @@ -5620,7 +6036,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c52a121f0fbf9320d5f2a9a5d82f6cb7557eda5e8b47fc3e7f359ec866ae960" dependencies = [ "bitflags 1.3.2", - "io-lifetimes", + "io-lifetimes 1.0.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "winx" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4857cedf8371f690bb6782a3e2b065c54d1b6661be068aaf3eac8b45e813fdf8" +dependencies = [ + "bitflags 2.3.3", "windows-sys 0.48.0", ] @@ -5632,11 +6058,11 @@ checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" dependencies = [ "anyhow", "bitflags 1.3.2", - "indexmap", + "indexmap 1.9.3", "log", - "wasm-encoder", + "wasm-encoder 0.29.0", "wasm-metadata", - "wasmparser", + "wasmparser 0.107.0", "wit-parser", ] @@ -5648,7 +6074,7 @@ checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" dependencies = [ "anyhow", "id-arena", - "indexmap", + "indexmap 1.9.3", "log", "pulldown-cmark", "semver", @@ -5679,9 +6105,9 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +checksum = "ea263437ca03c1522846a4ddafbca2542d0ad5ed9b784909d4b27b76f62bc34a" dependencies = [ "libc", ] @@ -5703,7 +6129,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] diff --git a/containerd-shim-spin-v1/Cargo.toml b/containerd-shim-spin-v1/Cargo.toml index 2c6a23a6..f5d35f74 100644 --- a/containerd-shim-spin-v1/Cargo.toml +++ b/containerd-shim-spin-v1/Cargo.toml @@ -13,8 +13,8 @@ Containerd shim for running Spin workloads. [dependencies] chrono = "0.4" clap = { version = "4.3", features = ["derive", "env"] } -containerd-shim = "0.3" -containerd-shim-wasm = "0.1" +containerd-shim = { git = "https://github.com/containerd/rust-extensions", rev = "7f7e3117a6ecb49e5e3b48b4f457a4914d2f2b93" } +containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", rev = "006b95f8aec41b0872e5472b718381468c36cb8a" } log = "0.4" spin-trigger = { git = "https://github.com/fermyon/spin", tag = "v1.4.0" } spin-app = { git = "https://github.com/fermyon/spin", tag = "v1.4.0" } @@ -33,5 +33,9 @@ url = "2.3" reqwest = { version = "0.11", features = ["stream"] } anyhow = "1.0" async-trait = "0.1" +libcontainer = { version = "0.1", features = ["v2"], default-features = false } +oci-spec = "0.6.2" +libc = "0.2.147" +nix = "0.26.2" -[workspace] \ No newline at end of file +[workspace] diff --git a/containerd-shim-spin-v1/Cross.toml b/containerd-shim-spin-v1/Cross.toml new file mode 100644 index 00000000..a9a083e4 --- /dev/null +++ b/containerd-shim-spin-v1/Cross.toml @@ -0,0 +1,8 @@ +[build] +default-target = "x86_64-unknown-linux-musl" + +[target.x86_64-unknown-linux-musl] +dockerfile = "./containerd-shim-spin-v1/Dockerfile" + +[target.aarch64-unknown-linux-musl] +dockerfile = "./containerd-shim-spin-v1/Dockerfile" diff --git a/containerd-shim-spin-v1/Dockerfile b/containerd-shim-spin-v1/Dockerfile new file mode 100644 index 00000000..1896a89c --- /dev/null +++ b/containerd-shim-spin-v1/Dockerfile @@ -0,0 +1,5 @@ +ARG CROSS_BASE_IMAGE +FROM $CROSS_BASE_IMAGE + +RUN apt-get -y update +RUN apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev diff --git a/containerd-shim-spin-v1/src/executor.rs b/containerd-shim-spin-v1/src/executor.rs new file mode 100644 index 00000000..fe392db1 --- /dev/null +++ b/containerd-shim-spin-v1/src/executor.rs @@ -0,0 +1,165 @@ +use log::info; +use nix::unistd::{dup, dup2}; +use spin_manifest::Application; +use spin_redis_engine::RedisTrigger; +use spin_trigger::{loader, RuntimeConfig, TriggerExecutor, TriggerExecutorBuilder}; +use spin_trigger_http::HttpTrigger; +use std::{future::Future, os::fd::RawFd, path::PathBuf, pin::Pin}; +use tokio::runtime::Runtime; +use url::Url; +use wasmtime::OptLevel; + +use anyhow::{anyhow, Result}; +use containerd_shim_wasm::sandbox::oci; +use libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO}; +use libcontainer::workload::{Executor, ExecutorError}; +use oci_spec::runtime::Spec; + +use crate::{parse_addr, SPIN_ADDR}; + +const EXECUTOR_NAME: &str = "spin"; +// const RUNTIME_CONFIG_FILE_PATH: &str = "runtime_config.toml"; + +pub struct SpinExecutor { + pub stdin: Option, + pub stdout: Option, + pub stderr: Option, +} + +impl SpinExecutor { + async fn build_spin_application( + mod_path: PathBuf, + working_dir: PathBuf, + ) -> anyhow::Result { + spin_loader::from_file(mod_path, Some(working_dir)).await + } + + async fn build_spin_trigger( + working_dir: PathBuf, + app: Application, + ) -> Result + where + for<'de> ::TriggerConfig: serde::de::Deserialize<'de>, + { + // Build and write app lock file + let locked_app = spin_trigger::locked::build_locked_app(app, &working_dir)?; + let locked_path = working_dir.join("spin.lock"); + let locked_app_contents = + serde_json::to_vec_pretty(&locked_app).expect("could not serialize locked app"); + std::fs::write(&locked_path, locked_app_contents).expect("could not write locked app"); + let locked_url = Url::from_file_path(&locked_path) + .map_err(|_| anyhow!("cannot convert to file URL: {locked_path:?}"))? + .to_string(); + + // Build trigger config + let loader = loader::TriggerLoader::new(working_dir.clone(), true); + let runtime_config = RuntimeConfig::new(PathBuf::from("/").into()); + let mut builder = TriggerExecutorBuilder::new(loader); + let config = builder.wasmtime_config_mut(); + config.cranelift_opt_level(OptLevel::Speed); + let init_data = Default::default(); + let executor = builder.build(locked_url, runtime_config, init_data).await?; + Ok(executor) + } +} + +impl Executor for SpinExecutor { + fn exec(&self, spec: &Spec) -> Result<(), ExecutorError> { + let args = oci::get_args(spec); + if args.is_empty() { + return Err(ExecutorError::InvalidArg); + } + + prepare_stdio(self.stdin, self.stdout, self.stderr).map_err(|err| { + ExecutorError::Other(format!("failed to prepare stdio for container: {}", err)) + })?; + + let rt = Runtime::new().unwrap(); + let res = rt.block_on(async { + info!(" >>> building spin application"); + let app = match SpinExecutor::build_spin_application( + PathBuf::from("/spin.toml"), + PathBuf::from("/"), + ) + .await + { + Ok(app) => app, + Err(err) => { + return err; + } + }; + + let trigger = app.info.trigger.clone(); + info!(" >>> building spin trigger {:?}", trigger); + + let f: Pin> + Send>>; + + match trigger { + spin_manifest::ApplicationTrigger::Http(_config) => { + let http_trigger: HttpTrigger = + match SpinExecutor::build_spin_trigger(PathBuf::from("/"), app).await { + Ok(http_trigger) => http_trigger, + Err(err) => { + log::error!(" >>> failed to build spin trigger: {:?}", err); + return err; + } + }; + + info!(" >>> running spin trigger"); + f = http_trigger.run(spin_trigger_http::CliArgs { + address: parse_addr(SPIN_ADDR).unwrap(), + tls_cert: None, + tls_key: None, + }); + } + spin_manifest::ApplicationTrigger::Redis(_config) => { + let redis_trigger: RedisTrigger = + match SpinExecutor::build_spin_trigger(PathBuf::from("/"), app).await { + Ok(redis_trigger) => redis_trigger, + Err(err) => { + return err; + } + }; + + info!(" >>> running spin trigger"); + f = redis_trigger.run(spin_trigger::cli::NoArgs); + } + _ => todo!("Only Http and Redis triggers are currently supported."), + } + + info!(" >>> notifying main thread we are about to start"); + tokio::select! { + _ = f => { + log::info!(" >>> server shut down: exiting"); + std::process::exit(0); + }, + } + }); + log::error!(" >>> error: {:?}", res); + std::process::exit(137); + } + + fn can_handle(&self, _spec: &Spec) -> bool { + true + } + + fn name(&self) -> &'static str { + EXECUTOR_NAME + } +} + +fn prepare_stdio(stdin: Option, stdout: Option, stderr: Option) -> Result<()> { + if let Some(stdin) = stdin { + dup(STDIN_FILENO)?; + dup2(stdin, STDIN_FILENO)?; + } + if let Some(stdout) = stdout { + dup(STDOUT_FILENO)?; + dup2(stdout, STDOUT_FILENO)?; + } + if let Some(stderr) = stderr { + dup(STDERR_FILENO)?; + dup2(stderr, STDERR_FILENO)?; + } + Ok(()) +} diff --git a/containerd-shim-spin-v1/src/main.rs b/containerd-shim-spin-v1/src/main.rs index a7409cfe..4b4e72c9 100644 --- a/containerd-shim-spin-v1/src/main.rs +++ b/containerd-shim-spin-v1/src/main.rs @@ -1,36 +1,42 @@ -use std::future::Future; +use std::fs::File; +use std::io::ErrorKind; +use std::io::Read; use std::net::SocketAddr; use std::net::ToSocketAddrs; use std::option::Option; use std::path::Path; use std::path::PathBuf; -use std::pin::Pin; -use std::sync::mpsc::channel; -use std::sync::mpsc::Sender; use std::sync::{Arc, Condvar, Mutex}; use std::thread; +use anyhow::Context; use anyhow::{anyhow, Result}; use chrono::{DateTime, Utc}; use containerd_shim as shim; +use containerd_shim_wasm::sandbox::instance::Wait; +use containerd_shim_wasm::sandbox::instance_utils::get_instance_root; +use containerd_shim_wasm::sandbox::instance_utils::instance_exists; +use containerd_shim_wasm::sandbox::instance_utils::maybe_open_stdio; use containerd_shim_wasm::sandbox::{ - error::Error, - instance::{EngineGetter, InstanceConfig}, - oci, Instance, ShimCli, + error::Error, EngineGetter, Instance, InstanceConfig, ShimCli, }; -use log::info; -use reqwest::Url; -use spin_manifest::Application; -use spin_redis_engine::RedisTrigger; -use spin_trigger::{loader, RuntimeConfig, TriggerExecutor, TriggerExecutorBuilder}; -use spin_trigger_http::HttpTrigger; -use tokio::runtime::Runtime; -use wasmtime::OptLevel; - -mod podio; +use executor::SpinExecutor; +use libc::{SIGINT, SIGKILL}; +use libcontainer::container::builder::ContainerBuilder; +use libcontainer::container::Container; +use libcontainer::container::ContainerStatus; +use libcontainer::signal::Signal; +use libcontainer::syscall::syscall::create_syscall; +use log::error; +use nix::errno::Errno; +use nix::sys::wait::{waitid, Id as WaitID, WaitPidFlag, WaitStatus}; +use serde::Deserialize; +use serde::Serialize; + +mod executor; const SPIN_ADDR: &str = "0.0.0.0:80"; -const RUNTIME_CONFIG_FILE_PATH: &str = "runtime_config.toml"; +static DEFAULT_CONTAINER_ROOT_DIR: &str = "/run/containerd/spin"; type ExitCode = Arc<(Mutex)>>, Condvar)>; @@ -41,68 +47,62 @@ pub struct Wasi { stdout: String, stderr: String, bundle: String, - shutdown_signal: Arc<(Mutex, Condvar)>, + rootdir: PathBuf, } -pub fn prepare_module(bundle: String) -> Result<(PathBuf, PathBuf), Error> { - let mut spec = oci::load(Path::new(&bundle).join("config.json").to_str().unwrap()) - .expect("unable to load OCI bundle"); - - spec.canonicalize_rootfs(&bundle) - .map_err(|err| Error::Others(format!("could not canonicalize rootfs: {err}")))?; +#[derive(Serialize, Deserialize)] +struct Options { + root: Option, +} - let working_dir = oci::get_root(&spec); - let mod_path = working_dir.join("spin.toml"); - Ok((working_dir.to_path_buf(), mod_path)) +fn determine_rootdir>(bundle: P, namespace: String) -> Result { + log::info!( + "determining rootdir for bundle: {}", + bundle.as_ref().display() + ); + let mut file = match File::open(bundle.as_ref().join("options.json")) { + Ok(f) => f, + Err(err) => match err.kind() { + ErrorKind::NotFound => { + return Ok(<&str as Into>::into(DEFAULT_CONTAINER_ROOT_DIR).join(namespace)) + } + _ => return Err(err.into()), + }, + }; + let mut data = String::new(); + file.read_to_string(&mut data)?; + let options: Options = serde_json::from_str(&data)?; + let path = options + .root + .unwrap_or(PathBuf::from(DEFAULT_CONTAINER_ROOT_DIR)) + .join(namespace); + log::info!("youki root path is: {}", path.display()); + Ok(path) } impl Wasi { - async fn build_spin_application( - mod_path: PathBuf, - working_dir: PathBuf, - ) -> Result { - Ok(spin_loader::from_file(mod_path, Some(working_dir)).await?) - } - - async fn build_spin_trigger( - working_dir: PathBuf, - app: Application, - stdout_pipe_path: PathBuf, - stderr_pipe_path: PathBuf, - stdin_pipe_path: PathBuf, - ) -> Result - where - for<'de> ::TriggerConfig: serde::de::Deserialize<'de>, - { - // Build and write app lock file - let locked_app = spin_trigger::locked::build_locked_app(app, &working_dir)?; - let locked_path = working_dir.join("spin.lock"); - let locked_app_contents = - serde_json::to_vec_pretty(&locked_app).expect("could not serialize locked app"); - std::fs::write(&locked_path, locked_app_contents).expect("could not write locked app"); - let locked_url = Url::from_file_path(&locked_path) - .map_err(|_| anyhow!("cannot convert to file URL: {locked_path:?}"))? - .to_string(); - - // Build trigger config - let loader = loader::TriggerLoader::new(working_dir.clone(), true); - let runtime_config_path = working_dir.clone().join(RUNTIME_CONFIG_FILE_PATH); - let runtime_config = RuntimeConfig::new(runtime_config_path.into()); - let mut builder = TriggerExecutorBuilder::new(loader); - let config = builder.wasmtime_config_mut(); - config - .cache_config_load_default()? - .cranelift_opt_level(OptLevel::Speed); - - let logging_hooks = podio::PodioLoggingTriggerHooks::new( - stdout_pipe_path, - stderr_pipe_path, - stdin_pipe_path, - ); - builder.hooks(logging_hooks); - let init_data = Default::default(); - let executor = builder.build(locked_url, runtime_config, init_data).await?; - Ok(executor) + fn build_container( + &self, + stdin: &str, + stdout: &str, + stderr: &str, + ) -> anyhow::Result { + let syscall = create_syscall(); + let stdin = maybe_open_stdio(stdin).context("could not open stdin")?; + let stdout = maybe_open_stdio(stdout).context("could not open stdout")?; + let stderr = maybe_open_stdio(stderr).context("could not open stderr")?; + + let container = ContainerBuilder::new(self.id.clone(), syscall.as_ref()) + .with_executor(vec![Box::new(SpinExecutor { + stdin, + stdout, + stderr, + })])? + .with_root_path(self.rootdir.clone())? + .as_init(&self.bundle) + .with_systemd(false) + .build()?; + Ok(container) } } @@ -110,6 +110,8 @@ impl Instance for Wasi { type E = (); fn new(id: String, cfg: Option<&InstanceConfig>) -> Self { let cfg = cfg.unwrap(); + let bundle = cfg.get_bundle().unwrap_or_default(); + let rootdir = determine_rootdir(bundle.as_str(), cfg.get_namespace()).unwrap(); Wasi { exit_code: Arc::new((Mutex::new(None), Condvar::new())), id, @@ -117,188 +119,123 @@ impl Instance for Wasi { stdout: cfg.get_stdout().unwrap_or_default(), stderr: cfg.get_stderr().unwrap_or_default(), bundle: cfg.get_bundle().unwrap_or_default(), - shutdown_signal: Arc::new((Mutex::new(false), Condvar::new())), + rootdir, } } fn start(&self) -> Result { - let exit_code = self.exit_code.clone(); - let shutdown_signal = self.shutdown_signal.clone(); - let (tx, rx) = channel::>(); - let bundle = self.bundle.clone(); - let stdin = self.stdin.clone(); - let stdout = self.stdout.clone(); - let stderr = self.stderr.clone(); - - info!( - " >>> stdin: {:#?}, stdout: {:#?}, stderr: {:#?}", - stdin, stdout, stderr - ); - - thread::Builder::new() - .name(self.id.clone()) - .spawn(move || { - let (working_dir, mod_path) = match prepare_module(bundle) { - Ok(f) => f, - Err(err) => { - tx.send(Err(err)).unwrap(); - return; - } - }; - - info!(" >>> loading module: {}", mod_path.display()); - info!(" >>> working dir: {}", working_dir.display()); - info!(" >>> starting spin"); - - let rt = Runtime::new().unwrap(); - rt.block_on(async { - info!(" >>> building spin application"); - let app = - match Wasi::build_spin_application(mod_path, working_dir.clone()).await { - Ok(app) => app, - Err(err) => { - tx.send(Err(err)).unwrap(); - return; - } - }; - - let rx_future = tokio::task::spawn_blocking(move || { - let (lock, cvar) = &*shutdown_signal; - let mut shutdown = lock.lock().unwrap(); - while !*shutdown { - shutdown = cvar.wait(shutdown).unwrap(); - } - }); - - let trigger = app.info.trigger.clone(); - info!(" >>> building spin trigger {:?}", trigger); - - let f: Pin> + Send>>; - - match trigger { - spin_manifest::ApplicationTrigger::Http(_config) => { - let http_trigger: HttpTrigger = match Wasi::build_spin_trigger( - working_dir, - app, - PathBuf::from(stdout), - PathBuf::from(stderr), - PathBuf::from(stdin), - ) - .await - { - Ok(http_trigger) => http_trigger, - Err(err) => { - tx.send(Err(Error::Others(format!( - "could not build spin trigger: {err}" - )))) - .unwrap(); - return; - } - }; - - info!(" >>> running spin trigger"); - f = http_trigger.run(spin_trigger_http::CliArgs { - address: parse_addr(SPIN_ADDR).unwrap(), - tls_cert: None, - tls_key: None, - }); - } - spin_manifest::ApplicationTrigger::Redis(_config) => { - let redis_trigger: RedisTrigger = match Wasi::build_spin_trigger( - working_dir, - app, - PathBuf::from(stdout), - PathBuf::from(stderr), - PathBuf::from(stdin), - ) - .await - { - Ok(redis_trigger) => redis_trigger, - Err(err) => { - tx.send(Err(Error::Others(format!( - "could not build spin trigger: {err}" - )))) - .unwrap(); - return; - } - }; - - info!(" >>> running spin trigger"); - f = redis_trigger.run(spin_trigger::cli::NoArgs); - } - _ => todo!("Only Http and Redis triggers are currently supported."), - } + log::info!("starting instance: {}", self.id); + let mut container = self.build_container( + self.stdin.as_str(), + self.stdout.as_str(), + self.stderr.as_str(), + )?; + log::info!("created container: {}", self.id); + let code = self.exit_code.clone(); + let pid = container.pid().unwrap(); - info!(" >>> notifying main thread we are about to start"); - tx.send(Ok(())).unwrap(); - tokio::select! { - _ = f => { - log::info!(" >>> server shut down: exiting"); + container + .start() + .map_err(|err| Error::Any(anyhow::anyhow!("failed to start container: {}", err)))?; + thread::spawn(move || { + let (lock, cvar) = &*code; - let (lock, cvar) = &*exit_code; - let mut ec = lock.lock().unwrap(); - *ec = Some((137, Utc::now())); - cvar.notify_all(); - }, - _ = rx_future => { - log::info!(" >>> user requested shutdown: exiting"); - let (lock, cvar) = &*exit_code; - let mut ec = lock.lock().unwrap(); - *ec = Some((0, Utc::now())); - cvar.notify_all(); - }, + let status = match waitid(WaitID::Pid(pid), WaitPidFlag::WEXITED) { + Ok(WaitStatus::Exited(_, status)) => status, + Ok(WaitStatus::Signaled(_, sig, _)) => sig as i32, + Ok(_) => 0, + Err(e) => { + if e == Errno::ECHILD { + log::info!("no child process"); + 0 + } else { + panic!("waitpid failed: {}", e); } - }) - })?; - - info!(" >>> waiting for start notification"); - match rx.recv().unwrap() { - Ok(_) => (), - Err(err) => { - info!(" >>> error starting instance: {err}"); - let code = self.exit_code.clone(); - - let (lock, cvar) = &*code; - let mut ec = lock.lock().unwrap(); - *ec = Some((139, Utc::now())); - cvar.notify_all(); - return Err(err); - } - } + } + } as u32; + let mut ec = lock.lock().unwrap(); + *ec = Some((status, Utc::now())); + drop(ec); + cvar.notify_all(); + }); - Ok(1) // TODO: PID: I wanted to use a thread ID here, but threads use a u64, the API wants a u32 + Ok(pid.as_raw() as u32) } fn kill(&self, signal: u32) -> Result<(), Error> { - if signal != 9 && signal != 2 { + log::info!("killing instance: {}", self.id); + if signal as i32 != SIGKILL && signal as i32 != SIGINT { return Err(Error::InvalidArgument( "only SIGKILL and SIGINT are supported".to_string(), )); } - - let (lock, cvar) = &*self.shutdown_signal; - let mut shutdown = lock.lock().unwrap(); - *shutdown = true; - cvar.notify_all(); - - Ok(()) + let container_root = get_instance_root(&self.rootdir, self.id.as_str())?; + let mut container = Container::load(container_root).with_context(|| { + format!( + "could not load state for container {id}", + id = self.id.as_str() + ) + })?; + let signal = Signal::try_from(signal as i32) + .map_err(|err| Error::InvalidArgument(format!("invalid signal number: {}", err)))?; + match container.kill(signal, true) { + Ok(_) => Ok(()), + Err(e) => { + if container.status() == ContainerStatus::Stopped { + return Err(Error::Others("container not running".into())); + } + Err(Error::Others(e.to_string())) + } + } } fn delete(&self) -> Result<(), Error> { + log::info!("deleting instance: {}", self.id); + match instance_exists(&self.rootdir, self.id.as_str()) { + Ok(exists) => { + if !exists { + return Ok(()); + } + } + Err(err) => { + error!("could not find the container, skipping cleanup: {}", err); + return Ok(()); + } + } + let container_root = get_instance_root(&self.rootdir, self.id.as_str())?; + let container = Container::load(container_root).with_context(|| { + format!( + "could not load state for container {id}", + id = self.id.as_str() + ) + }); + match container { + Ok(mut container) => container.delete(true).map_err(|err| { + Error::Any(anyhow::anyhow!( + "failed to delete container {}: {}", + self.id, + err + )) + })?, + Err(err) => { + error!("could not find the container, skipping cleanup: {}", err); + return Ok(()); + } + } + Ok(()) } - fn wait(&self, channel: Sender<(u32, DateTime)>) -> Result<(), Error> { + fn wait(&self, waiter: &Wait) -> Result<(), Error> { + log::info!("waiting for instance: {}", self.id); let code = self.exit_code.clone(); - thread::spawn(move || { - let (lock, cvar) = &*code; - let mut exit = lock.lock().unwrap(); - while (*exit).is_none() { - exit = cvar.wait(exit).unwrap(); - } - let ec = (*exit).unwrap(); - channel.send(ec).unwrap(); - }); + waiter.set_up_exit_code_wait(code) + } +} + +impl EngineGetter for Wasi { + type E = (); + fn new_engine() -> std::result::Result { Ok(()) } } @@ -311,15 +248,8 @@ fn parse_addr(addr: &str) -> Result { Ok(addrs) } -impl EngineGetter for Wasi { - type E = (); - fn new_engine() -> Result { - Ok(()) - } -} - fn main() { - shim::run::>("io.containerd.spin.v1", None); + shim::run::>("io.containerd.spin.v1", None); } #[cfg(test)] diff --git a/containerd-shim-spin-v1/src/podio.rs b/containerd-shim-spin-v1/src/podio.rs deleted file mode 100644 index a5325b54..00000000 --- a/containerd-shim-spin-v1/src/podio.rs +++ /dev/null @@ -1,72 +0,0 @@ -use std::{ - fs::{File, OpenOptions}, - path::{Path, PathBuf}, -}; - -use spin_app::{App, AppComponent}; -use spin_core::StoreBuilder; -use spin_trigger::{RuntimeConfig, TriggerHooks}; - -pub struct PodioLoggingTriggerHooks { - stdout_pipe: Option, - stderr_pipe: Option, - stdin_pipe: Option, -} - -fn maybe_open_stdio(pipe_path: &Path) -> Option { - if pipe_path.as_os_str().is_empty() { - None - } else { - Some( - OpenOptions::new() - .read(true) - .write(true) - .open(pipe_path) - .expect("could not open pipe"), - ) - } -} - -impl PodioLoggingTriggerHooks { - pub fn new( - stdout_pipe_path: PathBuf, - stderr_pipe_path: PathBuf, - stdin_pipe_path: PathBuf, - ) -> Self { - let stdout_pipe = maybe_open_stdio(&stdout_pipe_path); - let stderr_pipe = maybe_open_stdio(&stderr_pipe_path); - let stdin_pipe = maybe_open_stdio(&stdin_pipe_path); - Self { - stdout_pipe, - stderr_pipe, - stdin_pipe, - } - } -} - -impl TriggerHooks for PodioLoggingTriggerHooks { - fn app_loaded( - &mut self, - _component: &App, - _store_builder: &RuntimeConfig, - ) -> anyhow::Result<()> { - Ok(()) - } - - fn component_store_builder( - &self, - _component: &AppComponent<'_>, - builder: &mut StoreBuilder, - ) -> anyhow::Result<()> { - if let Some(stdout_pipe) = &self.stdout_pipe { - builder.stdout_pipe(stdout_pipe.try_clone().unwrap()); - } - if let Some(stderr_pipe) = &self.stderr_pipe { - builder.stderr_pipe(stderr_pipe.try_clone().unwrap()); - } - if let Some(stdin_pipe) = &self.stdin_pipe { - builder.stdin_pipe(stdin_pipe.try_clone().unwrap()); - } - Ok(()) - } -} diff --git a/deployments/k3d/workload/workload.yaml b/deployments/k3d/workload/workload.yaml index 4f6a569e..213ff16b 100644 --- a/deployments/k3d/workload/workload.yaml +++ b/deployments/k3d/workload/workload.yaml @@ -57,7 +57,6 @@ spec: - name: spin-hello imagePullPolicy: Never image: wasmtest_spin:latest - command: ["/"] --- apiVersion: v1 kind: Service diff --git a/images/spin/Dockerfile b/images/spin/Dockerfile index 54129b8d..1ef9874e 100644 --- a/images/spin/Dockerfile +++ b/images/spin/Dockerfile @@ -10,6 +10,7 @@ RUN curl -LO https://github.com/tinygo-org/tinygo/releases/download/v0.25.0/tiny RUN cd go-hello && tinygo build -wasm-abi=generic -target=wasi -gc=leaking -o spin_go_hello.wasm main.go FROM scratch -COPY --from=build /opt/build/target/wasm32-wasi/release/spin_rust_hello.wasm . +COPY --from=build --chmod=0755 /opt/build/target/wasm32-wasi/release/spin_rust_hello.wasm . COPY --from=build /opt/build/spin.toml . -COPY --from=build-go /opt/build/go-hello/spin_go_hello.wasm . \ No newline at end of file +COPY --from=build-go --chmod=0755 /opt/build/go-hello/spin_go_hello.wasm . +ENTRYPOINT [ "./spin_rust_hello.wasm" ] \ No newline at end of file diff --git a/tests/setup.py b/tests/setup.py index 97a50bd7..0f97d0d9 100644 --- a/tests/setup.py +++ b/tests/setup.py @@ -90,6 +90,8 @@ def setup_test(target): time.sleep(25) os.system("kubectl describe pods") + os.system("kubectl describe deployments") + os.system("kubectl describe services") print(">>> cluster is ready") diff --git a/tests/workloads/workload.yaml b/tests/workloads/workload.yaml index c9835556..9df958ac 100644 --- a/tests/workloads/workload.yaml +++ b/tests/workloads/workload.yaml @@ -57,7 +57,6 @@ spec: - name: testwasm image: docker.io/library/spin-hello-world:latest imagePullPolicy: Never # prevent k8s from pulling the image from a registry - command: ["/"] resources: # limit the resources to 128Mi of memory and 100m of CPU limits: cpu: 100m