Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,8 +63,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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion components/wit/deps/componentized-config/package.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion components/wit/deps/componentized-services/package.wit
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ world service-lifecycle {
import wasi:io/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:config/[email protected]draft;
import wasi:config/[email protected]rc.1;
import wasi:io/[email protected];
import wasi:io/[email protected];
import wasi:filesystem/[email protected];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected]draft;
package wasi:[email protected]rc.1;

interface store {
/// An error type that encapsulates the different errors that can occur fetching configuration values.
Expand Down
16 changes: 8 additions & 8 deletions components/wit/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ world valkey-lifecycle {
}

world credential-config {
export wasi:config/[email protected]draft;
export wasi:config/[email protected]rc.1;

import componentized:services/credential-store;

include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
}

// lifecycle hosts
Expand All @@ -39,41 +39,41 @@ world lifecycle-host-http {
world filesystem-credential-store {
export componentized:services/credential-store;

include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
include wasi:filesystem/[email protected];
}

world filesystem-credential-admin {
export componentized:services/credential-admin;

include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
include wasi:filesystem/[email protected];
}

world keyvalue-credential-store {
export componentized:services/credential-store;

include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
include wasi:keyvalue/[email protected];
}

world keyvalue-credential-admin {
export componentized:services/credential-admin;

include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
include wasi:keyvalue/[email protected];
}

world webhook-credential-admin {
export componentized:services/credential-admin;
include wasi:http/[email protected];
include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
include wasi:logging/[email protected];
}

world webhook-credential-store {
export componentized:services/credential-store;
include wasi:http/[email protected];
include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
include wasi:logging/[email protected];
}
9 changes: 9 additions & 0 deletions components/wkg.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion components/wkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 1 addition & 1 deletion demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"::/ \
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down
2 changes: 1 addition & 1 deletion tests/wit/deps/componentized-config/package.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/wit/deps/componentized-services/package.wit
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ world service-lifecycle {
import wasi:io/[email protected];
import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:config/[email protected]draft;
import wasi:config/[email protected]rc.1;
import wasi:io/[email protected];
import wasi:io/[email protected];
import wasi:filesystem/[email protected];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected]draft;
package wasi:[email protected]rc.1;

interface store {
/// An error type that encapsulates the different errors that can occur fetching configuration values.
Expand Down
4 changes: 2 additions & 2 deletions tests/wit/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ world stub-client {
export greeter: interface {
greet: func(name: string) -> result<string, string>;
}
include wasi:config/[email protected]draft;
include wasi:config/[email protected]rc.1;
include wasi:logging/[email protected];
}

Expand Down Expand Up @@ -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/[email protected]draft;
include wasi:config/[email protected]rc.1;

export ops;
}
Expand Down
9 changes: 9 additions & 0 deletions tests/wkg.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion tests/wkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
10 changes: 5 additions & 5 deletions update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion wit-overrides/componentized-config/package.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
30 changes: 0 additions & 30 deletions wit-overrides/wasi-config/store.wit

This file was deleted.

6 changes: 0 additions & 6 deletions wit-overrides/wasi-config/world.wit

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected]draft;
package wasi:[email protected]rc.1;

interface store {
/// An error type that encapsulates the different errors that can occur fetching configuration values.
Expand Down
30 changes: 0 additions & 30 deletions wit/overrides/wasi-config/store.wit

This file was deleted.

6 changes: 0 additions & 6 deletions wit/overrides/wasi-config/world.wit

This file was deleted.

2 changes: 1 addition & 1 deletion wit/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ world service-lifecycle {

import wasi:clocks/[email protected];
import wasi:clocks/[email protected];
import wasi:config/[email protected]draft;
import wasi:config/[email protected]rc.1;
import wasi:filesystem/[email protected];
import wasi:filesystem/[email protected];
import wasi:logging/[email protected];
Expand Down
9 changes: 9 additions & 0 deletions wkg.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion wkg.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
[overrides]
"wasi:config" = { path = "./wit-overrides/wasi-config" }
Loading