diff --git a/Cargo.toml b/Cargo.toml index 98bb0dc0..a80120e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "0.9.2" +version = "0.9.3" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/containerd-shim-lunatic/Cargo.lock b/containerd-shim-lunatic/Cargo.lock index 368c28cc..d15f323f 100644 --- a/containerd-shim-lunatic/Cargo.lock +++ b/containerd-shim-lunatic/Cargo.lock @@ -583,7 +583,7 @@ dependencies = [ [[package]] name = "containerd-shim-lunatic-v1" -version = "0.9.2" +version = "0.9.3" dependencies = [ "anyhow", "chrono", diff --git a/containerd-shim-lunatic/Cargo.toml b/containerd-shim-lunatic/Cargo.toml index 78c2e47d..a8b17f1c 100644 --- a/containerd-shim-lunatic/Cargo.toml +++ b/containerd-shim-lunatic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "containerd-shim-lunatic-v1" -version = "0.9.2" +version = "0.9.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/containerd-shim-slight/Cargo.lock b/containerd-shim-slight/Cargo.lock index d5bce05e..3501d0e2 100644 --- a/containerd-shim-slight/Cargo.lock +++ b/containerd-shim-slight/Cargo.lock @@ -1459,7 +1459,7 @@ dependencies = [ [[package]] name = "containerd-shim-slight-v1" -version = "0.9.2" +version = "0.9.3" dependencies = [ "anyhow", "containerd-shim-wasm", diff --git a/containerd-shim-slight/Cargo.toml b/containerd-shim-slight/Cargo.toml index b4c74f6a..8c331a9e 100644 --- a/containerd-shim-slight/Cargo.toml +++ b/containerd-shim-slight/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "containerd-shim-slight-v1" -version = "0.9.2" +version = "0.9.3" authors = ["DeisLabs Engineering Team"] edition = "2021" repository = 'https://github.com/deislabs/containerd-wasm-shims' diff --git a/containerd-shim-spin/Cargo.lock b/containerd-shim-spin/Cargo.lock index dec27403..23f20a75 100644 --- a/containerd-shim-spin/Cargo.lock +++ b/containerd-shim-spin/Cargo.lock @@ -975,7 +975,7 @@ dependencies = [ [[package]] name = "containerd-shim-spin-v2" -version = "0.9.2" +version = "0.9.3" dependencies = [ "anyhow", "containerd-shim-wasm", diff --git a/containerd-shim-spin/Cargo.toml b/containerd-shim-spin/Cargo.toml index e98fc511..07932629 100644 --- a/containerd-shim-spin/Cargo.toml +++ b/containerd-shim-spin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "containerd-shim-spin-v2" -version = "0.9.2" +version = "0.9.3" authors = ["DeisLabs Engineering Team"] edition = "2021" repository = 'https://github.com/deislabs/containerd-wasm-shims' diff --git a/containerd-shim-wws/Cargo.lock b/containerd-shim-wws/Cargo.lock index 6801eb2d..16247d27 100644 --- a/containerd-shim-wws/Cargo.lock +++ b/containerd-shim-wws/Cargo.lock @@ -847,7 +847,7 @@ dependencies = [ [[package]] name = "containerd-shim-wws-v1" -version = "0.9.2" +version = "0.9.3" dependencies = [ "anyhow", "containerd-shim-wasm", diff --git a/containerd-shim-wws/Cargo.toml b/containerd-shim-wws/Cargo.toml index 79459a69..df2b8c99 100644 --- a/containerd-shim-wws/Cargo.toml +++ b/containerd-shim-wws/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "containerd-shim-wws-v1" -version = "0.9.2" +version = "0.9.3" authors = ["Wasm Labs team "] edition = "2021" repository = 'https://github.com/deislabs/containerd-wasm-shims' diff --git a/deployments/k3d/README.md b/deployments/k3d/README.md index fdd6c96c..f41f1045 100644 --- a/deployments/k3d/README.md +++ b/deployments/k3d/README.md @@ -17,7 +17,7 @@ $ tree . ## How to run the example The shell script below will create a k3d cluster locally with the Wasm shims installed and containerd configured. The script then applies the runtime classes for the shims and an example service and deployment. Finally, we curl the `/hello` and receive a response from the example workload. ```shell -k3d cluster create wasm-cluster --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.9.2 -p "8081:80@loadbalancer" --agents 2 +k3d cluster create wasm-cluster --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.9.3 -p "8081:80@loadbalancer" --agents 2 kubectl apply -f https://github.com/deislabs/containerd-wasm-shims/raw/main/deployments/workloads/runtime.yaml kubectl apply -f https://github.com/deislabs/containerd-wasm-shims/raw/main/deployments/workloads/workload.yaml echo "waiting 5 seconds for workload to be ready" diff --git a/deployments/workloads/workload.yaml b/deployments/workloads/workload.yaml index a6fa103f..382653f6 100644 --- a/deployments/workloads/workload.yaml +++ b/deployments/workloads/workload.yaml @@ -15,7 +15,7 @@ spec: runtimeClassName: wasmtime-slight containers: - name: slight-hello - image: ghcr.io/deislabs/containerd-wasm-shims/examples/slight-rust-hello:v0.9.2 + image: ghcr.io/deislabs/containerd-wasm-shims/examples/slight-rust-hello:v0.9.3 command: ["/"] resources: # limit the resources to 128Mi of memory and 100m of CPU limits: @@ -54,7 +54,7 @@ spec: runtimeClassName: wasmtime-spin containers: - name: spin-hello - image: ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:v0.9.2 + image: ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:v0.9.3 command: ["/"] resources: # limit the resources to 128Mi of memory and 100m of CPU limits: @@ -93,7 +93,7 @@ spec: runtimeClassName: wasmtime-wws containers: - name: wws-hello - image: ghcr.io/deislabs/containerd-wasm-shims/examples/wws-js-hello:v0.9.2 + image: ghcr.io/deislabs/containerd-wasm-shims/examples/wws-js-hello:v0.9.3 command: ["/"] resources: # limit the resources to 128Mi of memory and 100m of CPU limits: @@ -132,7 +132,7 @@ spec: runtimeClassName: wasmtime-lunatic containers: - name: lunatic - image: ghcr.io/deislabs/containerd-wasm-shims/examples/lunatic-submillisecond:v0.9.2 + image: ghcr.io/deislabs/containerd-wasm-shims/examples/lunatic-submillisecond:v0.9.3 resources: # limit the resources to 128Mi of memory and 100m of CPU limits: cpu: 100m diff --git a/images/slight/Cargo.toml b/images/slight/Cargo.toml index e4dd324a..e18b68a2 100644 --- a/images/slight/Cargo.toml +++ b/images/slight/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "http-server-lib" -version = "0.9.2" +version = "0.9.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/images/spin-inbound-redis/Cargo.lock b/images/spin-inbound-redis/Cargo.lock index 88b851fb..e579ed49 100644 --- a/images/spin-inbound-redis/Cargo.lock +++ b/images/spin-inbound-redis/Cargo.lock @@ -4,19 +4,19 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "async-trait" -version = "0.1.67" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", + "syn 2.0.39", ] [[package]] @@ -27,15 +27,21 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fnv" @@ -45,18 +51,113 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" + +[[package]] +name = "futures-executor" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" + +[[package]] +name = "futures-macro" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "futures-sink" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" + +[[package]] +name = "futures-task" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" + +[[package]] +name = "futures-util" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" + [[package]] name = "heck" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" dependencies = [ "unicode-segmentation", ] @@ -78,49 +179,79 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", + "serde", +] + [[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 = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] -name = "proc-macro2" -version = "1.0.52" +name = "pin-project-lite" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" -dependencies = [ - "unicode-ident", -] +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] -name = "pulldown-cmark" -version = "0.8.0" +name = "pin-utils" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ - "bitflags", - "memchr", - "unicase", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -135,6 +266,64 @@ dependencies = [ "smartstring", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "serde" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -155,6 +344,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-inbound-redis" version = "0.1.0" @@ -163,13 +361,12 @@ dependencies = [ "bytes", "http", "spin-sdk", - "wit-bindgen-rust", ] [[package]] name = "spin-macro" version = "0.1.0" -source = "git+https://github.com/fermyon/spin?tag=v1.3.0#9fb8256d1380a046414b22bf2c17d1543f5029e4" +source = "git+https://github.com/fermyon/spin?tag=v2.0.0#e4bb2357067d29f053b2d039476180ffa31222b2" dependencies = [ "anyhow", "bytes", @@ -181,17 +378,22 @@ dependencies = [ [[package]] name = "spin-sdk" -version = "1.3.0" -source = "git+https://github.com/fermyon/spin?tag=v1.3.0#9fb8256d1380a046414b22bf2c17d1543f5029e4" +version = "2.0.0" +source = "git+https://github.com/fermyon/spin?tag=v2.0.0#e4bb2357067d29f053b2d039476180ffa31222b2" dependencies = [ "anyhow", + "async-trait", "bytes", "form_urlencoded", + "futures", "http", + "once_cell", "routefinder", + "serde", + "serde_json", "spin-macro", "thiserror", - "wit-bindgen-rust", + "wit-bindgen", ] [[package]] @@ -213,9 +415,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.4" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c622ae390c9302e214c31013517c2061ecb2699935882c60a9b37f82f8625ae" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -224,138 +426,164 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", + "syn 2.0.39", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "unicode-segmentation" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] -name = "unicase" -version = "2.6.0" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "unicode-ident" -version = "1.0.8" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "unicode-normalization" -version = "0.1.22" +name = "wasm-encoder" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "822b645bf4f2446b949776ffca47e2af60b167209ffb70814ef8779d299cd421" dependencies = [ - "tinyvec", + "leb128", ] [[package]] -name = "unicode-segmentation" -version = "1.10.1" +name = "wasm-metadata" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "2167ce53b2faa16a92c6cafd4942cff16c9a4fa0c5a5a0a41131ee4e49fc055f" +dependencies = [ + "anyhow", + "indexmap", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder", + "wasmparser", +] [[package]] -name = "unicode-xid" -version = "0.2.4" +name = "wasmparser" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "a58e28b80dd8340cb07b8242ae654756161f6fc8d0038123d679b7b99964fa50" +dependencies = [ + "indexmap", + "semver", +] [[package]] -name = "version_check" -version = "0.9.4" +name = "wit-bindgen" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "38726c54a5d7c03cac28a2a8de1006cfe40397ddf6def3f836189033a413bc08" +dependencies = [ + "bitflags", + "wit-bindgen-rust-macro", +] [[package]] -name = "wit-bindgen-gen-core" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +name = "wit-bindgen-core" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8bf1fddccaff31a1ad57432d8bfb7027a7e552969b6c68d6d8820dcf5c2371f" dependencies = [ "anyhow", + "wit-component", "wit-parser", ] [[package]] -name = "wit-bindgen-gen-rust" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +name = "wit-bindgen-rust" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7200e565124801e01b7b5ddafc559e1da1b2e1bed5364d669cd1d96fb88722" dependencies = [ + "anyhow", "heck", - "wit-bindgen-gen-core", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", ] [[package]] -name = "wit-bindgen-gen-rust-wasm" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +name = "wit-bindgen-rust-macro" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae33920ad8119fe72cf59eb00f127c0b256a236b9de029a1a10397b1f38bdbd" dependencies = [ - "heck", - "wit-bindgen-gen-core", - "wit-bindgen-gen-rust", + "anyhow", + "proc-macro2", + "quote", + "syn 2.0.39", + "wit-bindgen-core", + "wit-bindgen-rust", + "wit-component", ] [[package]] -name = "wit-bindgen-rust" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +name = "wit-component" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "480cc1a078b305c1b8510f7c455c76cbd008ee49935f3a6c5fd5e937d8d95b1e" dependencies = [ - "async-trait", + "anyhow", "bitflags", - "wit-bindgen-rust-impl", -] - -[[package]] -name = "wit-bindgen-rust-impl" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "wit-bindgen-gen-core", - "wit-bindgen-gen-rust-wasm", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", ] [[package]] name = "wit-parser" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43771ee863a16ec4ecf9da0fc65c3bbd4a1235c8e3da5f094b562894843dfa76" dependencies = [ "anyhow", "id-arena", - "pulldown-cmark", - "unicode-normalization", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", "unicode-xid", ] diff --git a/images/spin-inbound-redis/Cargo.toml b/images/spin-inbound-redis/Cargo.toml index 0867eb35..f16eca66 100644 --- a/images/spin-inbound-redis/Cargo.toml +++ b/images/spin-inbound-redis/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spin-inbound-redis" -version = "0.1.0" +version = "0.9.3" authors = ["Suneet Nangia "] edition = "2021" @@ -12,8 +12,7 @@ anyhow = "1" bytes = "1" http = "0.2" # Do not change spin sdk version without testing the e2e. -spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v1.3.0" } -wit-bindgen-rust = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "cb871cfa1ee460b51eb1d144b175b9aab9c50aba" } +spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v2.0.0" } [workspace] diff --git a/images/spin-inbound-redis/Dockerfile b/images/spin-inbound-redis/Dockerfile index f8f1d916..71470aaf 100644 --- a/images/spin-inbound-redis/Dockerfile +++ b/images/spin-inbound-redis/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=${BUILDPLATFORM} rust:1.70 AS build +FROM --platform=${BUILDPLATFORM} rust:1.72 AS build WORKDIR /opt/build COPY . . RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release diff --git a/images/spin-inbound-redis/src/lib.rs b/images/spin-inbound-redis/src/lib.rs index 9fa440cd..5d6a7b1f 100644 --- a/images/spin-inbound-redis/src/lib.rs +++ b/images/spin-inbound-redis/src/lib.rs @@ -14,10 +14,12 @@ fn on_message(message: Bytes) -> Result<()> { let address = std::env::var(REDIS_ADDRESS_ENV)?; let channel = std::env::var(REDIS_CHANNEL_ENV)?; + let conn = redis::Connection::open(&address)?; + println!("{}", from_utf8(&message)?); // Publish to Redis - redis::publish(&address, &channel, &message).unwrap(); + conn.publish(&channel, &message.to_vec())?; Ok(()) } diff --git a/images/spin-outbound-redis/Cargo.lock b/images/spin-outbound-redis/Cargo.lock index 27422395..f5b663bb 100644 --- a/images/spin-outbound-redis/Cargo.lock +++ b/images/spin-outbound-redis/Cargo.lock @@ -4,19 +4,19 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "async-trait" -version = "0.1.67" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", + "syn 2.0.39", ] [[package]] @@ -27,21 +27,21 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] -name = "bitflags" -version = "2.3.3" +name = "bytes" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] -name = "bytes" -version = "1.4.0" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fnv" @@ -51,28 +51,108 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "futures" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] [[package]] -name = "heck" -version = "0.3.3" +name = "futures-channel" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ - "unicode-segmentation", + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" + +[[package]] +name = "futures-executor" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" + +[[package]] +name = "futures-macro" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", ] +[[package]] +name = "futures-sink" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" + +[[package]] +name = "futures-task" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" + +[[package]] +name = "futures-util" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" + [[package]] name = "heck" version = "0.4.1" @@ -99,32 +179,22 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "indexmap" -version = "1.9.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] [[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 = "leb128" @@ -134,47 +204,54 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "once_cell" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] -name = "proc-macro2" -version = "1.0.52" +name = "pin-project-lite" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" -dependencies = [ - "unicode-ident", -] +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pulldown-cmark" -version = "0.8.0" +name = "proc-macro2" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ - "bitflags 1.3.2", - "memchr", - "unicase", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -189,32 +266,64 @@ dependencies = [ "smartstring", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", + "syn 2.0.39", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", ] +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -235,10 +344,19 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-macro" version = "0.1.0" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +source = "git+https://github.com/fermyon/spin?tag=v2.0.0#e4bb2357067d29f053b2d039476180ffa31222b2" dependencies = [ "anyhow", "bytes", @@ -250,25 +368,29 @@ dependencies = [ [[package]] name = "spin-outbound-redis" -version = "0.9.0" +version = "0.9.3" dependencies = [ "anyhow", "bytes", "http", "spin-sdk", - "wit-bindgen-rust 0.2.0", ] [[package]] name = "spin-sdk" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "2.0.0" +source = "git+https://github.com/fermyon/spin?tag=v2.0.0#e4bb2357067d29f053b2d039476180ffa31222b2" dependencies = [ "anyhow", + "async-trait", "bytes", "form_urlencoded", + "futures", "http", + "once_cell", "routefinder", + "serde", + "serde_json", "spin-macro", "thiserror", "wit-bindgen", @@ -293,9 +415,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.4" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c622ae390c9302e214c31013517c2061ecb2699935882c60a9b37f82f8625ae" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -304,68 +426,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", + "syn 2.0.39", ] -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - [[package]] name = "unicode-ident" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-segmentation" @@ -379,17 +462,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - [[package]] name = "version_check" version = "0.9.4" @@ -398,31 +470,34 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "822b645bf4f2446b949776ffca47e2af60b167209ffb70814ef8779d299cd421" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "2167ce53b2faa16a92c6cafd4942cff16c9a4fa0c5a5a0a41131ee4e49fc055f" dependencies = [ "anyhow", "indexmap", "serde", + "serde_derive", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "a58e28b80dd8340cb07b8242ae654756161f6fc8d0038123d679b7b99964fa50" dependencies = [ "indexmap", "semver", @@ -430,151 +505,85 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +checksum = "38726c54a5d7c03cac28a2a8de1006cfe40397ddf6def3f836189033a413bc08" dependencies = [ - "bitflags 2.3.3", + "bitflags", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +checksum = "c8bf1fddccaff31a1ad57432d8bfb7027a7e552969b6c68d6d8820dcf5c2371f" dependencies = [ "anyhow", "wit-component", - "wit-parser 0.8.0", -] - -[[package]] -name = "wit-bindgen-gen-core" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" -dependencies = [ - "anyhow", - "wit-parser 0.2.0", -] - -[[package]] -name = "wit-bindgen-gen-rust" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" -dependencies = [ - "heck 0.3.3", - "wit-bindgen-gen-core", -] - -[[package]] -name = "wit-bindgen-gen-rust-wasm" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" -dependencies = [ - "heck 0.3.3", - "wit-bindgen-gen-core", - "wit-bindgen-gen-rust", + "wit-parser", ] [[package]] name = "wit-bindgen-rust" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "wit-bindgen-rust-impl", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.8.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +checksum = "0e7200e565124801e01b7b5ddafc559e1da1b2e1bed5364d669cd1d96fb88722" dependencies = [ - "heck 0.4.1", + "anyhow", + "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-impl" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "wit-bindgen-gen-core", - "wit-bindgen-gen-rust-wasm", -] - -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck 0.4.1", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +checksum = "4ae33920ad8119fe72cf59eb00f127c0b256a236b9de029a1a10397b1f38bdbd" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.4", + "quote", + "syn 2.0.39", "wit-bindgen-core", - "wit-bindgen-rust 0.8.0", + "wit-bindgen-rust", "wit-component", ] [[package]] name = "wit-component" -version = "0.11.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "480cc1a078b305c1b8510f7c455c76cbd008ee49935f3a6c5fd5e937d8d95b1e" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags", "indexmap", "log", + "serde", + "serde_derive", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", - "wit-parser 0.8.0", + "wit-parser", ] [[package]] name = "wit-parser" -version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" -dependencies = [ - "anyhow", - "id-arena", - "pulldown-cmark", - "unicode-normalization", - "unicode-xid", -] - -[[package]] -name = "wit-parser" -version = "0.8.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "43771ee863a16ec4ecf9da0fc65c3bbd4a1235c8e3da5f094b562894843dfa76" dependencies = [ "anyhow", "id-arena", "indexmap", "log", - "pulldown-cmark", "semver", + "serde", + "serde_derive", + "serde_json", "unicode-xid", - "url", ] diff --git a/images/spin-outbound-redis/Cargo.toml b/images/spin-outbound-redis/Cargo.toml index 09515243..b2b6bed5 100644 --- a/images/spin-outbound-redis/Cargo.toml +++ b/images/spin-outbound-redis/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spin-outbound-redis" -version = "0.9.2" +version = "0.9.3" authors = ["DeisLabs Engineering Team"] edition = "2021" @@ -11,8 +11,7 @@ crate-type = ["cdylib"] anyhow = "1" bytes = "1" http = "0.2" -spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v1.4.1" } -wit-bindgen-rust = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "cb871cfa1ee460b51eb1d144b175b9aab9c50aba" } +spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v2.0.0" } [workspace] diff --git a/images/spin-outbound-redis/src/lib.rs b/images/spin-outbound-redis/src/lib.rs index e871417a..8f184466 100644 --- a/images/spin-outbound-redis/src/lib.rs +++ b/images/spin-outbound-redis/src/lib.rs @@ -1,34 +1,42 @@ -use anyhow::{anyhow, Result}; +use anyhow::{anyhow, Context, Result}; use spin_sdk::{ - http::{internal_server_error, Request, Response}, + http::responses::internal_server_error, + http::{IntoResponse, Request, Response}, http_component, redis, }; + const REDIS_ADDRESS_ENV: &str = "REDIS_ADDRESS"; const REDIS_CHANNEL_ENV: &str = "REDIS_CHANNEL"; #[http_component] -fn hello_world(_req: Request) -> Result { +fn hello_world(_req: Request) -> Result { let address = std::env::var(REDIS_ADDRESS_ENV)?; let channel = std::env::var(REDIS_CHANNEL_ENV)?; + let conn = redis::Connection::open(&address)?; + // Get the message to publish from the Redis key "mykey" - let payload = redis::get(&address, "mykey").map_err(|_| anyhow!("Error querying Redis"))?; + let payload = conn + .get("mykey") + .map_err(|_| anyhow!("Error querying Redis"))? + .context("no value for key 'mykey'")?; // Set the Redis key "spin-example" to value "Eureka!" - redis::set(&address, "spin-example", &b"Eureka!"[..]) + conn.set("spin-example", &"Eureka!".to_owned().into_bytes()) .map_err(|_| anyhow!("Error executing Redis set command"))?; // Set the Redis key "int-key" to value 0 - redis::set(&address, "int-key", format!("{:x}", 0).as_bytes()) + conn.set("int-key", &format!("{:x}", 0).into_bytes()) .map_err(|_| anyhow!("Error executing Redis set command"))?; - let int_value = redis::incr(&address, "int-key") + let int_value = conn + .incr("int-key") .map_err(|_| anyhow!("Error executing Redis incr command",))?; assert_eq!(int_value, 1); // Publish to Redis - match redis::publish(&address, &channel, &payload) { - Ok(()) => Ok(http::Response::builder().status(200).body(None)?), - Err(_e) => internal_server_error(), + match conn.publish(&channel, &payload) { + Ok(()) => Ok(Response::new(200, ())), + Err(_e) => Ok(internal_server_error()), } } \ No newline at end of file diff --git a/images/spin/Cargo.toml b/images/spin/Cargo.toml index 86a63c35..22c1b7ac 100644 --- a/images/spin/Cargo.toml +++ b/images/spin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spin-rust-hello" -version = "0.9.2" +version = "0.9.3" authors = ["DeisLabs Engineering Team"] edition = "2021"