From fd40db41849b907b260632f42911cdbdb62051a8 Mon Sep 17 00:00:00 2001 From: Jorge Prendes Date: Thu, 21 Sep 2023 21:19:20 +0100 Subject: [PATCH] chore: bump spin version to 1.5.0 (#151) --- .cargo/config.toml | 7 + .github/workflows/build.yaml | 3 - .github/workflows/ci.yaml | 3 - Cargo.lock | 2 +- Makefile | 6 +- containerd-shim-spin-v1/Cargo.lock | 938 ++++++++++++++++-- containerd-shim-spin-v1/Cargo.toml | 10 +- containerd-shim-spin-v1/Cross.toml | 6 +- containerd-shim-spin-v1/Dockerfile | 2 + containerd-shim-spin-v1/polyfill/README.md | 8 + containerd-shim-spin-v1/polyfill/polyfill.sh | 16 + .../polyfill/polyfill_vld1q_s8_x4.h | 14 + .../polyfill/polyfill_vld1q_u8_x4.h | 14 + .../polyfill/test_vld1q_s8_x4.c | 2 + .../polyfill/test_vld1q_u8_x4.c | 2 + containerd-shim-spin-v1/src/engine.rs | 6 +- rust-toolchain.toml | 5 + 17 files changed, 939 insertions(+), 105 deletions(-) create mode 100644 .cargo/config.toml create mode 100644 containerd-shim-spin-v1/polyfill/README.md create mode 100755 containerd-shim-spin-v1/polyfill/polyfill.sh create mode 100644 containerd-shim-spin-v1/polyfill/polyfill_vld1q_s8_x4.h create mode 100644 containerd-shim-spin-v1/polyfill/polyfill_vld1q_u8_x4.h create mode 100644 containerd-shim-spin-v1/polyfill/test_vld1q_s8_x4.c create mode 100644 containerd-shim-spin-v1/polyfill/test_vld1q_u8_x4.c create mode 100644 rust-toolchain.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..2b37c758 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,7 @@ +[profile.release] +strip = "symbols" +panic = "abort" + +[target.aarch64-unknown-linux-musl] +# see https://github.com/fermyon/spin/commit/07db218dccf2d02eb6c8c74d0b39dd2eb59cc4b4 +rustflags = ["-Ctarget-feature=+fp16"] diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c5d47656..5f22cf6c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,9 +26,6 @@ jobs: with: workspaces: | "containerd-shim-*-v1 -> target" - - name: "Install Rust Wasm targets" - run: | - make install-rust-targets - name: "Install dependencies" run: | sudo apt-get update diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 59bcd1d3..a43505d1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,9 +13,6 @@ jobs: with: workspaces: | "containerd-shim-*-v1 -> target" - - name: "Install Rust Wasm targets" - run: | - make install-rust-targets - name: "Install dependencies" run: | sudo apt-get update diff --git a/Cargo.lock b/Cargo.lock index 5068f5bb..5e23dc97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,7 +136,7 @@ dependencies = [ [[package]] name = "containerd-wasm-shims-tests" -version = "0.9.0" +version = "0.9.1" dependencies = [ "anyhow", "curl", diff --git a/Makefile b/Makefile index 755c2b2b..8ed88273 100644 --- a/Makefile +++ b/Makefile @@ -69,10 +69,6 @@ build: $(foreach shim,$(SHIMS),build-$(shim)-cross-$(TARGET)) install-cross: @if [ -z $$(which cross) ]; then cargo install cross --git https://github.com/cross-rs/cross; fi -.PHONY: install-rust-targets -install-rust-targets: - rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown - # build-cross can be be used to build any cross supported target (make build-cross-x86_64-unknown-linux-musl) .PHONY: $(BUILD_TARGETS) $(BUILD_TARGETS): SHIM = $(word 2,$(subst -, ,$@)) @@ -80,7 +76,7 @@ $(BUILD_TARGETS): install-cross cross build --release --target $(TARGET) --manifest-path=containerd-shim-$(SHIM)-v1/Cargo.toml $(VERBOSE_FLAG) .PHONY: build-% -build-%: install-rust-targets +build-%: cargo build --release --manifest-path=containerd-shim-$*-v1/Cargo.toml .PHONY: install diff --git a/containerd-shim-spin-v1/Cargo.lock b/containerd-shim-spin-v1/Cargo.lock index 047adcde..a0498e80 100644 --- a/containerd-shim-spin-v1/Cargo.lock +++ b/containerd-shim-spin-v1/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - [[package]] name = "addr2line" version = "0.19.0" @@ -32,6 +26,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.4.4", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.7.6" @@ -54,6 +59,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + [[package]] name = "aho-corasick" version = "1.0.5" @@ -247,6 +261,12 @@ version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bcrypt" version = "0.10.1" @@ -377,7 +397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe3ff3fc1de48c1ac2e3341c4df38b0d1bfb8fdf04632a187c8b75aaa319a7ab" dependencies = [ "byteorder", - "cipher", + "cipher 0.3.0", "opaque-debug", ] @@ -387,6 +407,12 @@ version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + [[package]] name = "byteorder" version = "1.4.3" @@ -399,6 +425,207 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cached-path" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "097968e38f1319207f057d0f4d76452e4f4f847a5de61c5215379f297fa034f3" +dependencies = [ + "flate2", + "fs2", + "glob", + "indicatif 0.16.2", + "log", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "sha2 0.10.7", + "tar", + "tempfile", + "thiserror", + "zip", +] + +[[package]] +name = "candle-core" +version = "0.1.0" +source = "git+https://github.com/huggingface/candle?rev=b80348d22f8f0dadb6cc4101bde031d5de69a9a5#b80348d22f8f0dadb6cc4101bde031d5de69a9a5" +dependencies = [ + "byteorder", + "candle-gemm", + "half 2.3.1", + "memmap2 0.7.1", + "num-traits", + "num_cpus", + "rand 0.8.5", + "safetensors", + "thiserror", + "zip", +] + +[[package]] +name = "candle-gemm" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b726a1f6cdd7ff080e95e3d91694701b1e04a58acd198e4a78c39428b2274e" +dependencies = [ + "candle-gemm-c32", + "candle-gemm-c64", + "candle-gemm-common", + "candle-gemm-f16", + "candle-gemm-f32", + "candle-gemm-f64", + "dyn-stack", + "lazy_static", + "num-complex", + "num-traits", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-c32" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "661470663389f0c99fd8449e620bfae630a662739f830a323eda4dcf80888843" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static", + "num-complex", + "num-traits", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-c64" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a111ddf61db562854a6d2ff4dfe1e8a84066431b7bc68d3afae4bf60874fda0" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static", + "num-complex", + "num-traits", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-common" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6dd93783ead7eeef14361667ea32014dc6f716a2fc956b075fe78729e10dd5" +dependencies = [ + "dyn-stack", + "lazy_static", + "num-complex", + "num-traits", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-f16" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b76499bf4b858cacc526c5c8f948bc7152774247dce8568f174b743ab1363fa4" +dependencies = [ + "candle-gemm-common", + "candle-gemm-f32", + "dyn-stack", + "half 2.3.1", + "lazy_static", + "num-complex", + "num-traits", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-f32" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bec152e7d36339d3785e0d746d75ee94a4e92968fbb12ddcc91b536b938d016" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static", + "num-complex", + "num-traits", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-f64" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f59ac68a5521e2ff71431bb7f1b22126ff0b60c5e66599b1f4676433da6e69" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static", + "num-complex", + "num-traits", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-nn" +version = "0.1.0" +source = "git+https://github.com/huggingface/candle?rev=b80348d22f8f0dadb6cc4101bde031d5de69a9a5#b80348d22f8f0dadb6cc4101bde031d5de69a9a5" +dependencies = [ + "candle-core", + "safetensors", + "thiserror", +] + [[package]] name = "cap-fs-ext" version = "1.0.15" @@ -537,6 +764,16 @@ dependencies = [ "generic-array", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.6.1" @@ -639,6 +876,25 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "containerd-shim" version = "0.5.0" @@ -861,7 +1117,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser 0.107.0", @@ -944,6 +1200,12 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -1203,6 +1465,16 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +[[package]] +name = "dyn-stack" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24269739c7c175bc12130622ef1a60b9ab2d5b30c0b9ce5110cd406d7fd497bc" +dependencies = [ + "bytemuck", + "reborrow", +] + [[package]] name = "ed25519" version = "1.5.3" @@ -1232,6 +1504,12 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.33" @@ -1281,6 +1559,15 @@ dependencies = [ "libc", ] +[[package]] +name = "esaxx-rs" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f748b253ceca9fed5f42f8b5ceb3851e93102199bc25b64b65369f76e5c0a35" +dependencies = [ + "cc", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -1366,7 +1653,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", - "libz-ng-sys", "miniz_oxide", ] @@ -1600,6 +1886,24 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ggml" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "ggml-sys", + "memmap2 0.5.10", + "thiserror", +] + +[[package]] +name = "ggml-sys" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "cc", +] + [[package]] name = "gimli" version = "0.27.3" @@ -1657,6 +1961,19 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +[[package]] +name = "half" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if 1.0.0", + "crunchy", + "num-traits", + "rand 0.8.5", + "rand_distr", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1928,12 +2245,45 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "indicatif" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +dependencies = [ + "console", + "lazy_static", + "number_prefix 0.3.0", + "regex", +] + +[[package]] +name = "indicatif" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +dependencies = [ + "console", + "lazy_static", + "number_prefix 0.4.0", + "regex", +] + [[package]] name = "infer" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "instant" version = "0.1.12" @@ -1987,6 +2337,24 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1996,6 +2364,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -2047,7 +2424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.3", - "pem", + "pem 1.1.1", "ring", "serde", "serde_json", @@ -2203,6 +2580,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + [[package]] name = "libsql-client" version = "0.31.11" @@ -2234,16 +2617,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libz-ng-sys" -version = "1.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dd9f43e75536a46ee0f92b758f6b63846e594e86638c61a9251338a65baea63" -dependencies = [ - "cmake", - "libc", -] - [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -2262,6 +2635,58 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +[[package]] +name = "llm" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", + "llm-llama", + "serde", + "tracing", +] + +[[package]] +name = "llm-base" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "bytemuck", + "ggml", + "half 2.3.1", + "llm-samplers", + "memmap2 0.5.10", + "partial_sort", + "rand 0.8.5", + "regex", + "serde", + "serde_bytes", + "thiserror", + "tokenizers", + "tracing", +] + +[[package]] +name = "llm-llama" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", + "tracing", +] + +[[package]] +name = "llm-samplers" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7553f60d113c9cdc6a5402456a31cd9a273bef79f6f16d8a4f7b4bedf5f754b2" +dependencies = [ + "anyhow", + "num-traits", + "rand 0.8.5", + "thiserror", +] + [[package]] name = "lock_api" version = "0.4.10" @@ -2296,6 +2721,15 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "lru" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +dependencies = [ + "hashbrown 0.13.2", +] + [[package]] name = "mach" version = "0.3.2" @@ -2305,6 +2739,22 @@ dependencies = [ "libc", ] +[[package]] +name = "macro_rules_attribute" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862" +dependencies = [ + "macro_rules_attribute-proc_macro", + "paste", +] + +[[package]] +name = "macro_rules_attribute-proc_macro" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d" + [[package]] name = "maybe-owned" version = "0.3.4" @@ -2335,6 +2785,24 @@ dependencies = [ "rustix 0.37.23", ] +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2414,6 +2882,27 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "monostate" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f370ae88093ec6b11a710dec51321a61d420fafd1bad6e30d01bd9c920e8ee" +dependencies = [ + "monostate-impl", + "serde", +] + +[[package]] +name = "monostate-impl" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "371717c0a5543d6a800cac822eac735aa7d2d2fbb41002e9856a4089532dbdce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "multimap" version = "0.8.3" @@ -2422,9 +2911,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "mysql_async" -version = "0.30.0" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456207bb9636a0fdade67a64cea7bdebe6730c3c16ee5e34f2c481838ee5a39e" +checksum = "f5272f59b5b1f93d65f7f826c1f025d6e410e89fb50a67e05aa20b35a55a8c0a" dependencies = [ "bytes", "crossbeam", @@ -2433,17 +2922,18 @@ dependencies = [ "futures-sink", "futures-util", "lazy_static", - "lru 0.7.8", + "lru 0.10.1", "mio", "mysql_common", "native-tls", "once_cell", - "pem", + "pem 2.0.1", "percent-encoding", "pin-project", + "priority-queue", "serde", "serde_json", - "socket2 0.4.9", + "socket2 0.5.3", "thiserror", "tokio", "tokio-native-tls", @@ -2454,13 +2944,13 @@ dependencies = [ [[package]] name = "mysql_common" -version = "0.29.2" +version = "0.30.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9006c95034ccf7b903d955f210469119f6c3477fc9c9e7a7845ce38a3e665c2a" +checksum = "57349d5a326b437989b6ee4dc8f2f34b0cc131202748414712a8e7d98952fc8c" dependencies = [ - "base64 0.13.1", + "base64 0.21.3", "bindgen", - "bitflags 1.3.2", + "bitflags 2.4.0", "bitvec", "byteorder", "bytes", @@ -2482,6 +2972,7 @@ dependencies = [ "smallvec", "subprocess", "thiserror", + "uuid", ] [[package]] @@ -2571,6 +3062,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -2588,6 +3088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2609,6 +3110,18 @@ dependencies = [ "libc", ] +[[package]] +name = "number_prefix" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "oauth2" version = "4.4.1" @@ -2669,6 +3182,28 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "onig" +version = "6.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" +dependencies = [ + "bitflags 1.3.2", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" +dependencies = [ + "cc", + "pkg-config", +] + [[package]] name = "opaque-debug" version = "0.3.0" @@ -2753,31 +3288,33 @@ checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" [[package]] name = "ouroboros" -version = "0.15.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +checksum = "1c86de06555b970aec45229b27291b53154f21a5743a163419f4e4c0b065dcde" dependencies = [ "aliasable", "ouroboros_macro", + "static_assertions", ] [[package]] name = "ouroboros_macro" -version = "0.15.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +checksum = "8cad0c4b129e9696e37cb712b243777b90ef489a0bfaa0ac34e7d9b860e4f134" dependencies = [ - "Inflector", + "heck 0.4.1", + "itertools 0.11.0", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.29", ] [[package]] name = "outbound-http" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "http", @@ -2791,8 +3328,8 @@ dependencies = [ [[package]] name = "outbound-mysql" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "flate2", @@ -2807,8 +3344,8 @@ dependencies = [ [[package]] name = "outbound-pg" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "native-tls", @@ -2822,8 +3359,8 @@ dependencies = [ [[package]] name = "outbound-redis" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "redis", @@ -2897,6 +3434,23 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -2921,6 +3475,18 @@ dependencies = [ "once_cell", ] +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac", + "password-hash", + "sha2 0.10.7", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -2936,6 +3502,16 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b13fe415cdf3c8e44518e18a7c95a13431d9bdf6d15367d82b23c377fdd441a" +dependencies = [ + "base64 0.21.3", + "serde", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -3087,6 +3663,16 @@ dependencies = [ "nix 0.27.1", ] +[[package]] +name = "priority-queue" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff39edfcaec0d64e8d0da38564fad195d2d51b680940295fcc307366e101e61" +dependencies = [ + "autocfg", + "indexmap 1.9.3", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -3153,7 +3739,7 @@ checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" dependencies = [ "bytes", "heck 0.3.3", - "itertools", + "itertools 0.10.5", "log", "multimap", "petgraph", @@ -3170,7 +3756,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -3349,6 +3935,16 @@ dependencies = [ "getrandom 0.2.10", ] +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -3358,6 +3954,15 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "raw-cpuid" +version = "10.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "rayon" version = "1.7.0" @@ -3368,6 +3973,17 @@ dependencies = [ "rayon-core", ] +[[package]] +name = "rayon-cond" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd1259362c9065e5ea39a789ef40b1e3fd934c94beb7b5ab3ac6629d3b5e7cb7" +dependencies = [ + "either", + "itertools 0.8.2", + "rayon", +] + [[package]] name = "rayon-core" version = "1.11.0" @@ -3380,6 +3996,12 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "reborrow" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2962bf2e1f971c53ef59b2d7ca51d6a5e5c4a9d2be47eb1f661a321a4da85888" + [[package]] name = "redis" version = "0.21.7" @@ -3450,7 +4072,7 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.5", "memchr", "regex-automata", "regex-syntax", @@ -3462,7 +4084,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.5", "memchr", "regex-syntax", ] @@ -3724,6 +4346,16 @@ dependencies = [ "libc", ] +[[package]] +name = "safetensors" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93279b86b3de76f820a8854dd06cbc33cfa57a417b19c47f6a25280112fb1df" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "same-file" version = "1.0.6" @@ -3806,6 +4438,12 @@ dependencies = [ "serde", ] +[[package]] +name = "seq-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" + [[package]] name = "serde" version = "1.0.188" @@ -3815,13 +4453,22 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +dependencies = [ + "serde", +] + [[package]] name = "serde_cbor" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ - "half", + "half 1.8.2", "serde", ] @@ -4062,11 +4709,12 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin-app" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", + "base64 0.21.3", "ouroboros", "serde", "serde_json", @@ -4076,8 +4724,8 @@ dependencies = [ [[package]] name = "spin-common" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "dirs 4.0.0", @@ -4088,7 +4736,7 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=3653d24ee95b4efcc39de52b5c988b435f87712a#3653d24ee95b4efcc39de52b5c988b435f87712a" +source = "git+https://github.com/fermyon/spin-componentize?rev=0aa9622d2dafbdacae55b1fd62eb5bb36bf84b2d#0aa9622d2dafbdacae55b1fd62eb5bb36bf84b2d" dependencies = [ "anyhow", "wasm-encoder 0.29.0", @@ -4099,8 +4747,8 @@ dependencies = [ [[package]] name = "spin-config" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4117,8 +4765,8 @@ dependencies = [ [[package]] name = "spin-core" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4135,8 +4783,8 @@ dependencies = [ [[package]] name = "spin-http" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "http", @@ -4150,8 +4798,8 @@ dependencies = [ [[package]] name = "spin-key-value" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "lru 0.9.0", @@ -4165,7 +4813,7 @@ dependencies = [ [[package]] name = "spin-key-value-azure" version = "0.1.0" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "azure_data_cosmos", @@ -4180,7 +4828,7 @@ dependencies = [ [[package]] name = "spin-key-value-redis" version = "0.1.0" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "redis", @@ -4194,7 +4842,7 @@ dependencies = [ [[package]] name = "spin-key-value-sqlite" version = "0.1.0" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "once_cell", @@ -4205,10 +4853,36 @@ dependencies = [ "tokio", ] +[[package]] +name = "spin-llm" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" +dependencies = [ + "anyhow", + "bytesize", + "candle-core", + "candle-nn", + "chrono", + "llm", + "lru 0.9.0", + "num_cpus", + "rand 0.8.5", + "safetensors", + "serde", + "spin-app", + "spin-core", + "spin-world", + "terminal", + "tokenizers", + "tokio", + "tracing", + "uuid", +] + [[package]] name = "spin-loader" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4218,7 +4892,7 @@ dependencies = [ "dunce", "futures", "glob", - "itertools", + "itertools 0.10.5", "lazy_static", "mime_guess", "outbound-http", @@ -4243,8 +4917,8 @@ dependencies = [ [[package]] name = "spin-manifest" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "indexmap 1.9.3", "serde", @@ -4254,8 +4928,8 @@ dependencies = [ [[package]] name = "spin-redis-engine" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4271,8 +4945,8 @@ dependencies = [ [[package]] name = "spin-sqlite" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4285,8 +4959,8 @@ dependencies = [ [[package]] name = "spin-sqlite-inproc" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4300,8 +4974,8 @@ dependencies = [ [[package]] name = "spin-sqlite-libsql" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4314,8 +4988,8 @@ dependencies = [ [[package]] name = "spin-trigger" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4340,6 +5014,7 @@ dependencies = [ "spin-key-value-azure", "spin-key-value-redis", "spin-key-value-sqlite", + "spin-llm", "spin-loader", "spin-manifest", "spin-sqlite", @@ -4356,8 +5031,8 @@ dependencies = [ [[package]] name = "spin-trigger-http" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "anyhow", "async-trait", @@ -4367,6 +5042,7 @@ dependencies = [ "http", "hyper", "indexmap 1.9.3", + "outbound-http", "percent-encoding", "rustls-pemfile 0.3.0", "serde", @@ -4388,12 +5064,24 @@ dependencies = [ [[package]] name = "spin-world" -version = "1.4.1" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +version = "1.5.0" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "wasmtime", ] +[[package]] +name = "spm_precompiled" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5851699c4033c63636f7ea4cf7b7c1f1bf06d0cc03cfb42e711de5a5c46cf326" +dependencies = [ + "base64 0.13.1", + "nom", + "serde", + "unicode-segmentation", +] + [[package]] name = "sptr" version = "0.3.2" @@ -4528,6 +5216,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.11" @@ -4559,7 +5258,7 @@ dependencies = [ [[package]] name = "terminal" version = "0.1.0" -source = "git+https://github.com/fermyon/spin?tag=v1.4.1#e0bd9115fa51399e106681ac1c9ed1afbad1baaa" +source = "git+https://github.com/fermyon/spin?tag=v1.5.0#ca08dd933de32fe09f4c318fbbc1f04853f2085f" dependencies = [ "atty", "once_cell", @@ -4651,6 +5350,42 @@ dependencies = [ "tokio-rustls 0.23.4", ] +[[package]] +name = "tokenizers" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aea68938177975ab09da68552b720eac941779ff386baceaf77e0f5f9cea645f" +dependencies = [ + "aho-corasick 0.7.20", + "cached-path", + "clap 4.4.1", + "derive_builder 0.12.0", + "dirs 4.0.0", + "esaxx-rs", + "getrandom 0.2.10", + "indicatif 0.15.0", + "itertools 0.9.0", + "lazy_static", + "log", + "macro_rules_attribute", + "monostate", + "onig", + "paste", + "rand 0.8.5", + "rayon", + "rayon-cond", + "regex", + "regex-syntax", + "reqwest", + "serde", + "serde_json", + "spm_precompiled", + "thiserror", + "unicode-normalization-alignments", + "unicode-segmentation", + "unicode_categories", +] + [[package]] name = "tokio" version = "1.32.0" @@ -4982,6 +5717,15 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-normalization-alignments" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f613e4fa046e69818dd287fdc4bc78175ff20331479dab6e1b0f98d57062de" +dependencies = [ + "smallvec", +] + [[package]] name = "unicode-segmentation" version = "1.10.1" @@ -5000,6 +5744,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "untrusted" version = "0.7.1" @@ -6022,6 +6772,26 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1 0.10.5", + "time 0.3.28", + "zstd", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/containerd-shim-spin-v1/Cargo.toml b/containerd-shim-spin-v1/Cargo.toml index 2dde4c6e..1e5687de 100644 --- a/containerd-shim-spin-v1/Cargo.toml +++ b/containerd-shim-spin-v1/Cargo.toml @@ -14,11 +14,11 @@ Containerd shim for running Spin workloads. containerd-shim = "0.5.0" containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", rev = "4d212b968d24d42a27952e8b04979382b543a613", features = ["cgroupsv2"] } log = "0.4" -spin-trigger = { git = "https://github.com/fermyon/spin", tag = "v1.4.1" } -spin-trigger-http = { git = "https://github.com/fermyon/spin", tag = "v1.4.1" } -spin-redis-engine = { git = "https://github.com/fermyon/spin", tag = "v1.4.1" } -spin-manifest = { git = "https://github.com/fermyon/spin", tag = "v1.4.1" } -spin-loader = { git = "https://github.com/fermyon/spin", tag = "v1.4.1" } +spin-trigger = { git = "https://github.com/fermyon/spin", tag = "v1.5.0" } +spin-trigger-http = { git = "https://github.com/fermyon/spin", tag = "v1.5.0" } +spin-redis-engine = { git = "https://github.com/fermyon/spin", tag = "v1.5.0" } +spin-manifest = { git = "https://github.com/fermyon/spin", tag = "v1.5.0" } +spin-loader = { git = "https://github.com/fermyon/spin", tag = "v1.5.0" } wasmtime = "10.0.1" tokio = { version = "1", features = ["rt"] } openssl = { version = "*", features = ["vendored"] } diff --git a/containerd-shim-spin-v1/Cross.toml b/containerd-shim-spin-v1/Cross.toml index a9a083e4..c1496abc 100644 --- a/containerd-shim-spin-v1/Cross.toml +++ b/containerd-shim-spin-v1/Cross.toml @@ -2,7 +2,9 @@ default-target = "x86_64-unknown-linux-musl" [target.x86_64-unknown-linux-musl] -dockerfile = "./containerd-shim-spin-v1/Dockerfile" +dockerfile.file = "./containerd-shim-spin-v1/Dockerfile" +dockerfile.context = "./containerd-shim-spin-v1/polyfill/" [target.aarch64-unknown-linux-musl] -dockerfile = "./containerd-shim-spin-v1/Dockerfile" +dockerfile.file = "./containerd-shim-spin-v1/Dockerfile" +dockerfile.context = "./containerd-shim-spin-v1/polyfill/" diff --git a/containerd-shim-spin-v1/Dockerfile b/containerd-shim-spin-v1/Dockerfile index 1896a89c..18d6cc21 100644 --- a/containerd-shim-spin-v1/Dockerfile +++ b/containerd-shim-spin-v1/Dockerfile @@ -3,3 +3,5 @@ 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 + +RUN --mount=type=bind,source=/,target=/polyfill /polyfill/polyfill.sh diff --git a/containerd-shim-spin-v1/polyfill/README.md b/containerd-shim-spin-v1/polyfill/README.md new file mode 100644 index 00000000..fbc8ea9d --- /dev/null +++ b/containerd-shim-spin-v1/polyfill/README.md @@ -0,0 +1,8 @@ +# Polyfill for missing SIMD intrinsics in `cross-rs` image for target `aarch64-unknown-linux-musl` + +A transitive dependency of spin (`llama.cpp` via `ggml`) uses the `vld1q_s8_x4` and `vld1q_u8_x4` compiler built-in SIMD intrinsics. +These intrinsics are missing for `aarch64` in `gcc < 10.3`, while `cross-rs` ships with `gcc 9` for `aarch64-unknown-linux-musl` as of writing. + +The code in this folder does a feature check and patches the `arm_neon.h` header with polyfills if the functions are missing. + +See https://github.com/fermyon/spin/issues/1786 for the upstream issue. diff --git a/containerd-shim-spin-v1/polyfill/polyfill.sh b/containerd-shim-spin-v1/polyfill/polyfill.sh new file mode 100755 index 00000000..6214e716 --- /dev/null +++ b/containerd-shim-spin-v1/polyfill/polyfill.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +ROOT="$(dirname "$0")" +echo "ROOT=$ROOT" +ARM_NEON_PATH="$(aarch64-linux-musl-gcc -E "$ROOT/test_vld1q_s8_x4.c" | grep -m1 "arm_neon.h" | sed -En 's|.*"(/usr/local/[^"]*/arm_neon.h)".*|\1|p')" +echo "ARM_NEON_PATH=$ARM_NEON_PATH" +if command -v aarch64-linux-musl-gcc > /dev/null; then + if ! aarch64-linux-musl-gcc -Werror=implicit-function-declaration -c -o /dev/null "$ROOT/test_vld1q_u8_x4.c"; then + echo "Polyfilling vld1q_u8_x4" + cat "$ROOT/polyfill_vld1q_u8_x4.h" >> $ARM_NEON_PATH + fi + if ! aarch64-linux-musl-gcc -Werror=implicit-function-declaration -c -o /dev/null "$ROOT/test_vld1q_s8_x4.c"; then + echo "Polyfilling vld1q_s8_x4" + cat "$ROOT/polyfill_vld1q_s8_x4.h" >> $ARM_NEON_PATH + fi +fi \ No newline at end of file diff --git a/containerd-shim-spin-v1/polyfill/polyfill_vld1q_s8_x4.h b/containerd-shim-spin-v1/polyfill/polyfill_vld1q_s8_x4.h new file mode 100644 index 00000000..8d77a165 --- /dev/null +++ b/containerd-shim-spin-v1/polyfill/polyfill_vld1q_s8_x4.h @@ -0,0 +1,14 @@ +#ifndef __POLYFILL_VLD1Q_S8_X4__ +#define __POLYFILL_VLD1Q_S8_X4__ + +inline int8x16x4_t vld1q_s8_x4(const int8_t *p) +{ + int8x16x4_t ret; + ret.val[0] = vld1q_s8(p + 0); + ret.val[1] = vld1q_s8(p + 16); + ret.val[2] = vld1q_s8(p + 32); + ret.val[3] = vld1q_s8(p + 48); + return ret; +} + +#endif // __POLYFILL_VLD1Q_S8_X4__ diff --git a/containerd-shim-spin-v1/polyfill/polyfill_vld1q_u8_x4.h b/containerd-shim-spin-v1/polyfill/polyfill_vld1q_u8_x4.h new file mode 100644 index 00000000..4b4a51e5 --- /dev/null +++ b/containerd-shim-spin-v1/polyfill/polyfill_vld1q_u8_x4.h @@ -0,0 +1,14 @@ +#ifndef __POLYFILL_VLD1Q_U8_X4__ +#define __POLYFILL_VLD1Q_U8_X4__ + +inline uint8x16x4_t vld1q_u8_x4(const uint8_t *p) +{ + uint8x16x4_t ret; + ret.val[0] = vld1q_u8(p + 0); + ret.val[1] = vld1q_u8(p + 16); + ret.val[2] = vld1q_u8(p + 32); + ret.val[3] = vld1q_u8(p + 48); + return ret; +} + +#endif // __POLYFILL_VLD1Q_U8_X4__ diff --git a/containerd-shim-spin-v1/polyfill/test_vld1q_s8_x4.c b/containerd-shim-spin-v1/polyfill/test_vld1q_s8_x4.c new file mode 100644 index 00000000..ad9a4c98 --- /dev/null +++ b/containerd-shim-spin-v1/polyfill/test_vld1q_s8_x4.c @@ -0,0 +1,2 @@ +#include +void test() { vld1q_s8_x4(0); } \ No newline at end of file diff --git a/containerd-shim-spin-v1/polyfill/test_vld1q_u8_x4.c b/containerd-shim-spin-v1/polyfill/test_vld1q_u8_x4.c new file mode 100644 index 00000000..ea853f84 --- /dev/null +++ b/containerd-shim-spin-v1/polyfill/test_vld1q_u8_x4.c @@ -0,0 +1,2 @@ +#include +void test() { vld1q_u8_x4(0); } \ No newline at end of file diff --git a/containerd-shim-spin-v1/src/engine.rs b/containerd-shim-spin-v1/src/engine.rs index 90d724bf..c807a435 100644 --- a/containerd-shim-spin-v1/src/engine.rs +++ b/containerd-shim-spin-v1/src/engine.rs @@ -47,8 +47,10 @@ impl SpinEngine { 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); + builder + .config_mut() + .wasmtime_config() + .cranelift_opt_level(OptLevel::Speed); let init_data = Default::default(); let executor = builder.build(locked_url, runtime_config, init_data).await?; Ok(executor) diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..a5176c3a --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "stable" +components = ["clippy", "rustfmt"] +targets = ["wasm32-wasi", "wasm32-unknown-unknown"] +profile = "default"