From 51e02653af4ecc8abccf7c09b29bdeb3b63f6305 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Wed, 5 Nov 2025 14:29:10 -0500 Subject: [PATCH 1/2] Bump wasi:config to 0.2.0-rc.1 This is equivalent to 0.2.0-draft, but properly tagged so manual overrides are no longer needed. Signed-off-by: Scott Andrews --- .github/workflows/ci.yaml | 6 ++-- README.md | 1 + .../wit/deps/componentized-config/package.wit | 2 +- .../deps/componentized-services/package.wit | 2 +- .../package.wit | 2 +- components/wit/world.wit | 16 +++++----- components/wkg.lock | 9 ++++++ components/wkg.toml | 1 - demo.sh | 2 +- test.sh | 2 +- .../wit/deps/componentized-config/package.wit | 2 +- .../deps/componentized-services/package.wit | 2 +- .../package.wit | 2 +- tests/wit/world.wit | 4 +-- tests/wkg.lock | 9 ++++++ tests/wkg.toml | 1 - update-deps.sh | 10 +++---- .../componentized-config/package.wit | 2 +- wit-overrides/wasi-config/store.wit | 30 ------------------- wit-overrides/wasi-config/world.wit | 6 ---- .../package.wit | 2 +- wit/overrides/wasi-config/store.wit | 30 ------------------- wit/overrides/wasi-config/world.wit | 6 ---- wit/world.wit | 2 +- wkg.lock | 9 ++++++ wkg.toml | 1 - 26 files changed, 58 insertions(+), 103 deletions(-) rename components/wit/deps/{wasi-config-0.2.0-draft => wasi-config-0.2.0-rc.1}/package.wit (97%) rename tests/wit/deps/{wasi-config-0.2.0-draft => wasi-config-0.2.0-rc.1}/package.wit (97%) delete mode 100644 wit-overrides/wasi-config/store.wit delete mode 100644 wit-overrides/wasi-config/world.wit rename wit/deps/{wasi-config-0.2.0-draft => wasi-config-0.2.0-rc.1}/package.wit (97%) delete mode 100644 wit/overrides/wasi-config/store.wit delete mode 100644 wit/overrides/wasi-config/world.wit diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b9f7b76..338fe53 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,8 +59,10 @@ jobs: - uses: actions/checkout@v5 - name: Install wasmtime run: | - curl https://wasmtime.dev/install.sh -sSf | bash - echo "PATH=${PATH}:${HOME}/.wasmtime/bin" >> "$GITHUB_ENV" + # TODO revert once wasmtime 41 is released + cargo install --git https://github.com/bytecodealliance/wasmtime.git --rev 29f2a1ca66c849a2d2e533a2df87c221daa8e2de wasmtime-cli + # curl https://wasmtime.dev/install.sh -sSf | bash + # echo "PATH=${PATH}:${HOME}/.wasmtime/bin" >> "$GITHUB_ENV" - name: Download components.tar uses: actions/download-artifact@v6 diff --git a/README.md b/README.md index 040b5da..81563db 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Prereqs: Prereqs: - build the components (see above) - access to a running [Valkey](https://valkey.io) server +- [`wasmtime`](https://github.com/bytecodealliance/wasmtime) 41+ or dev ```sh ./demo.sh diff --git a/components/wit/deps/componentized-config/package.wit b/components/wit/deps/componentized-config/package.wit index 1f5c014..4d02f71 100644 --- a/components/wit/deps/componentized-config/package.wit +++ b/components/wit/deps/componentized-config/package.wit @@ -7,7 +7,7 @@ interface factory { } world adapter { - export wasi:config/store@0.2.0-draft; + export wasi:config/store@0.2.0-rc.1; } world config-factory { export factory; diff --git a/components/wit/deps/componentized-services/package.wit b/components/wit/deps/componentized-services/package.wit index 0215f57..11d0d98 100644 --- a/components/wit/deps/componentized-services/package.wit +++ b/components/wit/deps/componentized-services/package.wit @@ -97,7 +97,7 @@ world service-lifecycle { import wasi:io/poll@0.2.3; import wasi:clocks/monotonic-clock@0.2.3; import wasi:clocks/wall-clock@0.2.3; - import wasi:config/store@0.2.0-draft; + import wasi:config/store@0.2.0-rc.1; import wasi:io/error@0.2.3; import wasi:io/streams@0.2.3; import wasi:filesystem/types@0.2.3; diff --git a/components/wit/deps/wasi-config-0.2.0-draft/package.wit b/components/wit/deps/wasi-config-0.2.0-rc.1/package.wit similarity index 97% rename from components/wit/deps/wasi-config-0.2.0-draft/package.wit rename to components/wit/deps/wasi-config-0.2.0-rc.1/package.wit index a4cdf94..d8950ee 100644 --- a/components/wit/deps/wasi-config-0.2.0-draft/package.wit +++ b/components/wit/deps/wasi-config-0.2.0-rc.1/package.wit @@ -1,4 +1,4 @@ -package wasi:config@0.2.0-draft; +package wasi:config@0.2.0-rc.1; interface store { /// An error type that encapsulates the different errors that can occur fetching configuration values. diff --git a/components/wit/world.wit b/components/wit/world.wit index 43d91ef..91f0744 100644 --- a/components/wit/world.wit +++ b/components/wit/world.wit @@ -10,11 +10,11 @@ world valkey-lifecycle { } world credential-config { - export wasi:config/store@0.2.0-draft; + export wasi:config/store@0.2.0-rc.1; import componentized:services/credential-store; - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; } // lifecycle hosts @@ -39,41 +39,41 @@ world lifecycle-host-http { world filesystem-credential-store { export componentized:services/credential-store; - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; include wasi:filesystem/imports@0.2.3; } world filesystem-credential-admin { export componentized:services/credential-admin; - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; include wasi:filesystem/imports@0.2.3; } world keyvalue-credential-store { export componentized:services/credential-store; - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; include wasi:keyvalue/imports@0.2.0-draft2; } world keyvalue-credential-admin { export componentized:services/credential-admin; - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; include wasi:keyvalue/imports@0.2.0-draft2; } world webhook-credential-admin { export componentized:services/credential-admin; include wasi:http/imports@0.2.3; - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; include wasi:logging/imports@0.1.0-draft; } world webhook-credential-store { export componentized:services/credential-store; include wasi:http/imports@0.2.3; - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; include wasi:logging/imports@0.1.0-draft; } diff --git a/components/wkg.lock b/components/wkg.lock index 5f35bc5..760945e 100644 --- a/components/wkg.lock +++ b/components/wkg.lock @@ -20,6 +20,15 @@ requirement = "=0.2.3" version = "0.2.3" digest = "sha256:3bbed4e582d6209cf281cfe94e51d64fd0c9507635c5e1c68795f493b6cdada9" +[[packages]] +name = "wasi:config" +registry = "wasi.dev" + +[[packages.versions]] +requirement = "=0.2.0-rc.1" +version = "0.2.0-rc.1" +digest = "sha256:1b7f1b0fd07bb4cede16c6a6ec8852815dfb924639a78735fc7bdffdc164485d" + [[packages]] name = "wasi:filesystem" registry = "wasi.dev" diff --git a/components/wkg.toml b/components/wkg.toml index cc95d37..5200433 100644 --- a/components/wkg.toml +++ b/components/wkg.toml @@ -2,5 +2,4 @@ "componentized:services" = { path = "../wit" } "componentized:config" = { path = "../wit-overrides/componentized-config" } "componentized:valkey" = { path = "../wit-overrides/componentized-valkey" } -"wasi:config" = { path = "../wit-overrides/wasi-config" } "wasi:keyvalue" = { path = "../wit-overrides/wasi-keyvalue" } diff --git a/demo.sh b/demo.sh index 6eafaad..6133302 100755 --- a/demo.sh +++ b/demo.sh @@ -6,7 +6,7 @@ set -o pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" componentized_services() { - wasmtime run -Sconfig -Sinherit-network \ + ${WASMTIME:-wasmtime} run -Sconfig -Sinherit-network \ -Sconfig-var=path=services \ -Sconfig-var=binding-id="${binding_id}" \ --dir "${SCRIPT_DIR:-.}/tests/testdata"::/ \ diff --git a/test.sh b/test.sh index 449a6de..47d0ad8 100755 --- a/test.sh +++ b/test.sh @@ -13,7 +13,7 @@ if [ -z ${SKIP_BUILD+x} ]; then fi componentized_services() { - wasmtime run -Sconfig -Sinherit-network \ + ${WASMTIME:-wasmtime} run -Sconfig -Sinherit-network \ -Sconfig-var=path=services \ --env log_context_kv2fs \ -Sconfig-var=binding-id="${binding_id}" \ diff --git a/tests/wit/deps/componentized-config/package.wit b/tests/wit/deps/componentized-config/package.wit index 1f5c014..4d02f71 100644 --- a/tests/wit/deps/componentized-config/package.wit +++ b/tests/wit/deps/componentized-config/package.wit @@ -7,7 +7,7 @@ interface factory { } world adapter { - export wasi:config/store@0.2.0-draft; + export wasi:config/store@0.2.0-rc.1; } world config-factory { export factory; diff --git a/tests/wit/deps/componentized-services/package.wit b/tests/wit/deps/componentized-services/package.wit index 0215f57..11d0d98 100644 --- a/tests/wit/deps/componentized-services/package.wit +++ b/tests/wit/deps/componentized-services/package.wit @@ -97,7 +97,7 @@ world service-lifecycle { import wasi:io/poll@0.2.3; import wasi:clocks/monotonic-clock@0.2.3; import wasi:clocks/wall-clock@0.2.3; - import wasi:config/store@0.2.0-draft; + import wasi:config/store@0.2.0-rc.1; import wasi:io/error@0.2.3; import wasi:io/streams@0.2.3; import wasi:filesystem/types@0.2.3; diff --git a/tests/wit/deps/wasi-config-0.2.0-draft/package.wit b/tests/wit/deps/wasi-config-0.2.0-rc.1/package.wit similarity index 97% rename from tests/wit/deps/wasi-config-0.2.0-draft/package.wit rename to tests/wit/deps/wasi-config-0.2.0-rc.1/package.wit index a4cdf94..d8950ee 100644 --- a/tests/wit/deps/wasi-config-0.2.0-draft/package.wit +++ b/tests/wit/deps/wasi-config-0.2.0-rc.1/package.wit @@ -1,4 +1,4 @@ -package wasi:config@0.2.0-draft; +package wasi:config@0.2.0-rc.1; interface store { /// An error type that encapsulates the different errors that can occur fetching configuration values. diff --git a/tests/wit/world.wit b/tests/wit/world.wit index cb737a2..7a69477 100644 --- a/tests/wit/world.wit +++ b/tests/wit/world.wit @@ -18,7 +18,7 @@ world stub-client { export greeter: interface { greet: func(name: string) -> result; } - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; include wasi:logging/imports@0.1.0-draft; } @@ -81,7 +81,7 @@ world ops-router { move: func(from-path: string, to-path: string) -> result<_, error>; delete: func(path: string) -> result<_, error>; } - include wasi:config/imports@0.2.0-draft; + include wasi:config/imports@0.2.0-rc.1; export ops; } diff --git a/tests/wkg.lock b/tests/wkg.lock index 4c58ae2..f1b4d4c 100644 --- a/tests/wkg.lock +++ b/tests/wkg.lock @@ -11,6 +11,15 @@ requirement = "=0.2.3" version = "0.2.3" digest = "sha256:3bbed4e582d6209cf281cfe94e51d64fd0c9507635c5e1c68795f493b6cdada9" +[[packages]] +name = "wasi:config" +registry = "wasi.dev" + +[[packages.versions]] +requirement = "=0.2.0-rc.1" +version = "0.2.0-rc.1" +digest = "sha256:1b7f1b0fd07bb4cede16c6a6ec8852815dfb924639a78735fc7bdffdc164485d" + [[packages]] name = "wasi:filesystem" registry = "wasi.dev" diff --git a/tests/wkg.toml b/tests/wkg.toml index cc95d37..5200433 100644 --- a/tests/wkg.toml +++ b/tests/wkg.toml @@ -2,5 +2,4 @@ "componentized:services" = { path = "../wit" } "componentized:config" = { path = "../wit-overrides/componentized-config" } "componentized:valkey" = { path = "../wit-overrides/componentized-valkey" } -"wasi:config" = { path = "../wit-overrides/wasi-config" } "wasi:keyvalue" = { path = "../wit-overrides/wasi-keyvalue" } diff --git a/update-deps.sh b/update-deps.sh index 9045db0..381e328 100755 --- a/update-deps.sh +++ b/update-deps.sh @@ -10,15 +10,15 @@ DEPS_DIR="${SCRIPT_DIR}/lib/deps" rm -rf "${DEPS_DIR}" mkdir -p "${DEPS_DIR}" -wkg oci pull ghcr.io/componentized/logging/levels:v0.1.0 -o "${DEPS_DIR}/logging-levels.wasm" -wkg oci pull ghcr.io/componentized/logging/to-stdout:v0.1.0 -o "${DEPS_DIR}/logging-to-stdout.wasm" +wkg oci pull ghcr.io/componentized/logging/levels:v0.2.0 -o "${DEPS_DIR}/logging-levels.wasm" +wkg oci pull ghcr.io/componentized/logging/to-stdout:v0.2.0 -o "${DEPS_DIR}/logging-to-stdout.wasm" wac plug "${DEPS_DIR}/logging-levels.wasm" --plug "${DEPS_DIR}/logging-to-stdout.wasm" -o "${DEPS_DIR}/logger.wasm" static-config -o "${DEPS_DIR}/app-config.wasm" -p logging.env.prefix=log_context_ -wkg oci pull ghcr.io/componentized/filesystem/chroot:v0.1.0 -o "${DEPS_DIR}/filesystem-chroot.wasm" +wkg oci pull ghcr.io/componentized/filesystem/chroot:v0.2.0 -o "${DEPS_DIR}/filesystem-chroot.wasm" wkg oci pull ghcr.io/componentized/cli/stdout-to-stderr:v0.1.0 -o "${DEPS_DIR}/stdout-to-stderr.wasm" -wkg oci pull ghcr.io/componentized/valkey/valkey-client:v0.1.1 -o "${DEPS_DIR}/valkey-client.wasm" -wkg oci pull ghcr.io/componentized/static-config/factory:v0.1.0 -o "${DEPS_DIR}/static-config-factory.wasm" +wkg oci pull ghcr.io/componentized/valkey/valkey-client:v0.2.0 -o "${DEPS_DIR}/valkey-client.wasm" +wkg oci pull ghcr.io/componentized/static-config/factory:v0.2.0 -o "${DEPS_DIR}/static-config-factory.wasm" wkg wit fetch (cd components && wkg wit fetch) diff --git a/wit-overrides/componentized-config/package.wit b/wit-overrides/componentized-config/package.wit index 1f5c014..4d02f71 100644 --- a/wit-overrides/componentized-config/package.wit +++ b/wit-overrides/componentized-config/package.wit @@ -7,7 +7,7 @@ interface factory { } world adapter { - export wasi:config/store@0.2.0-draft; + export wasi:config/store@0.2.0-rc.1; } world config-factory { export factory; diff --git a/wit-overrides/wasi-config/store.wit b/wit-overrides/wasi-config/store.wit deleted file mode 100644 index 794379a..0000000 --- a/wit-overrides/wasi-config/store.wit +++ /dev/null @@ -1,30 +0,0 @@ -interface store { - /// An error type that encapsulates the different errors that can occur fetching configuration values. - variant error { - /// This indicates an error from an "upstream" config source. - /// As this could be almost _anything_ (such as Vault, Kubernetes ConfigMaps, KeyValue buckets, etc), - /// the error message is a string. - upstream(string), - /// This indicates an error from an I/O operation. - /// As this could be almost _anything_ (such as a file read, network connection, etc), - /// the error message is a string. - /// Depending on how this ends up being consumed, - /// we may consider moving this to use the `wasi:io/error` type instead. - /// For simplicity right now in supporting multiple implementations, it is being left as a string. - io(string), - } - - /// Gets a configuration value of type `string` associated with the `key`. - /// - /// The value is returned as an `option`. If the key is not found, - /// `Ok(none)` is returned. If an error occurs, an `Err(error)` is returned. - get: func( - /// A string key to fetch - key: string - ) -> result, error>; - - /// Gets a list of configuration key-value pairs of type `string`. - /// - /// If an error occurs, an `Err(error)` is returned. - get-all: func() -> result>, error>; -} diff --git a/wit-overrides/wasi-config/world.wit b/wit-overrides/wasi-config/world.wit deleted file mode 100644 index f92f080..0000000 --- a/wit-overrides/wasi-config/world.wit +++ /dev/null @@ -1,6 +0,0 @@ -package wasi:config@0.2.0-draft; - -world imports { - /// The interface for wasi:config/store - import store; -} \ No newline at end of file diff --git a/wit/deps/wasi-config-0.2.0-draft/package.wit b/wit/deps/wasi-config-0.2.0-rc.1/package.wit similarity index 97% rename from wit/deps/wasi-config-0.2.0-draft/package.wit rename to wit/deps/wasi-config-0.2.0-rc.1/package.wit index a4cdf94..d8950ee 100644 --- a/wit/deps/wasi-config-0.2.0-draft/package.wit +++ b/wit/deps/wasi-config-0.2.0-rc.1/package.wit @@ -1,4 +1,4 @@ -package wasi:config@0.2.0-draft; +package wasi:config@0.2.0-rc.1; interface store { /// An error type that encapsulates the different errors that can occur fetching configuration values. diff --git a/wit/overrides/wasi-config/store.wit b/wit/overrides/wasi-config/store.wit deleted file mode 100644 index 794379a..0000000 --- a/wit/overrides/wasi-config/store.wit +++ /dev/null @@ -1,30 +0,0 @@ -interface store { - /// An error type that encapsulates the different errors that can occur fetching configuration values. - variant error { - /// This indicates an error from an "upstream" config source. - /// As this could be almost _anything_ (such as Vault, Kubernetes ConfigMaps, KeyValue buckets, etc), - /// the error message is a string. - upstream(string), - /// This indicates an error from an I/O operation. - /// As this could be almost _anything_ (such as a file read, network connection, etc), - /// the error message is a string. - /// Depending on how this ends up being consumed, - /// we may consider moving this to use the `wasi:io/error` type instead. - /// For simplicity right now in supporting multiple implementations, it is being left as a string. - io(string), - } - - /// Gets a configuration value of type `string` associated with the `key`. - /// - /// The value is returned as an `option`. If the key is not found, - /// `Ok(none)` is returned. If an error occurs, an `Err(error)` is returned. - get: func( - /// A string key to fetch - key: string - ) -> result, error>; - - /// Gets a list of configuration key-value pairs of type `string`. - /// - /// If an error occurs, an `Err(error)` is returned. - get-all: func() -> result>, error>; -} diff --git a/wit/overrides/wasi-config/world.wit b/wit/overrides/wasi-config/world.wit deleted file mode 100644 index f92f080..0000000 --- a/wit/overrides/wasi-config/world.wit +++ /dev/null @@ -1,6 +0,0 @@ -package wasi:config@0.2.0-draft; - -world imports { - /// The interface for wasi:config/store - import store; -} \ No newline at end of file diff --git a/wit/world.wit b/wit/world.wit index 92800d4..371ccc7 100644 --- a/wit/world.wit +++ b/wit/world.wit @@ -6,7 +6,7 @@ world service-lifecycle { import wasi:clocks/monotonic-clock@0.2.3; import wasi:clocks/wall-clock@0.2.3; - import wasi:config/store@0.2.0-draft; + import wasi:config/store@0.2.0-rc.1; import wasi:filesystem/types@0.2.3; import wasi:filesystem/preopens@0.2.3; import wasi:logging/logging@0.1.0-draft; diff --git a/wkg.lock b/wkg.lock index 4c58ae2..f1b4d4c 100644 --- a/wkg.lock +++ b/wkg.lock @@ -11,6 +11,15 @@ requirement = "=0.2.3" version = "0.2.3" digest = "sha256:3bbed4e582d6209cf281cfe94e51d64fd0c9507635c5e1c68795f493b6cdada9" +[[packages]] +name = "wasi:config" +registry = "wasi.dev" + +[[packages.versions]] +requirement = "=0.2.0-rc.1" +version = "0.2.0-rc.1" +digest = "sha256:1b7f1b0fd07bb4cede16c6a6ec8852815dfb924639a78735fc7bdffdc164485d" + [[packages]] name = "wasi:filesystem" registry = "wasi.dev" diff --git a/wkg.toml b/wkg.toml index 3bd6ee8..300aded 100644 --- a/wkg.toml +++ b/wkg.toml @@ -1,2 +1 @@ [overrides] -"wasi:config" = { path = "./wit-overrides/wasi-config" } From 2bd66d19390e92c656093e3a60362e24829f94a7 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Thu, 6 Nov 2025 14:38:18 -0500 Subject: [PATCH 2/2] always collect ci built components Signed-off-by: Scott Andrews --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 338fe53..8fefd67 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,18 +33,22 @@ jobs: - name: Check for drift in generated files run: git diff --exit-code . - name: Collect components.tar + if: always() run: tar -cvf ../components.tar *.wasm* working-directory: ./lib - name: Collect test-components.tar + if: always() run: tar -cvf ../../test-components.tar *.wasm* working-directory: ./lib/test - name: Upload components.tar + if: always() uses: actions/upload-artifact@v5 with: name: components.tar path: components.tar retention-days: 7 - name: Upload test-components.tar + if: always() uses: actions/upload-artifact@v5 with: name: test-components.tar