Skip to content

Commit 231702d

Browse files
chrisdickinsonG4Vi
andauthored
feat(component): rust component model support (#128)
* feat(component): wip component model support - upgrade to wasmtime>=13, wasmtime_wasi>=13 - the component model necessitated splitting the adapter setup into two parts: first creating the adapter so it can be associated with the state, then telling the linker how to get from the incoming state to the adapter. WASI also has this split. - change the c bindings in observe-api: 1. "_" is an illegal character! switch to "-". 2. change the module name from "dylibso_observe" to "dylibso:observe/api" * feat(component): rename core module imports Align core module instrumentation naming with component model naming. This relies on corresponding (undeployed, private) changes to the observe http api [1]. [1]: dylibso/wasm-instr#69 * feat(component): move from AsMut to ObserveSdkView This also removes the WIT `dylibso:observe` world since we don't *really* need it. * fix(corpus): rename 00-component-instr-{reactor → command} * feat(component): add an example of depending on an instr'd component * doc: add component model integration guide * fix(component): fix broken CI Update vendored instrumented wasm modules to match new naming. Additionally: switch github workflow from `npm i` to the (much faster) `npm ci`. * fix: bump WASM_INSTR_VERSION_MINOR * fix: error out when module and observe-sdk versions are not compatible * chore: improve messsaging with incompat wasm-instr versions * feat: detect and error out on all modules (incl observe api) that use dylibso_observe namespace * fix: observe sdk compat with observe api * chore: update go-sdk message for incompatible wasm-instr * fix: go-sdk import function names, don't hang on unknown name * chore: remove go/test/count_vowels.instr.wasm it was outdated Please use test files in the `test` directory in the root of the project instead * feat: js-sdk support old api too * chore: js-sdk warn on discovery of deprecated namespace dylibso_observe * feat: remove checks on version globals in rust-sdk * feat: support modules instrumented with deprecrated namespace dylibso_observe, with warning. Error on modules instrumented with observe_api * feat: error out when observe api is used on go and js sdks * docs: add SDK-API-VERSIONING.md to document how to do api changes * fix: error out on when even new observe api is used on go and js sdks * chore: readd go changes * fix: new versions of WIT require semicolons * fix,docs: component building and running, add instructions to README * ci: add testing components * ci: install just, use action to install rust cli * chore: bin versions * chore: update to wasmtime 17, move off cargo-component-bindings: bytecodealliance/cargo-component@5cf73a6 --------- Co-authored-by: Gavin Hayes <[email protected]>
1 parent 7c028e0 commit 231702d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2056
-626
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install JS build deps
2222
run: |
2323
cd js
24-
npm i
24+
npm ci
2525
2626
- name: Run Deno test
2727
run: |
@@ -84,6 +84,7 @@ jobs:
8484
uses: actions-rs/cargo@v1
8585
with:
8686
command: test
87+
args: --all-features
8788

8889
- name: Run basic example
8990
uses: actions-rs/cargo@v1
@@ -104,3 +105,21 @@ jobs:
104105
| head -n 1 \
105106
| jq '.resourceSpans[].scopeSpans[].spans[0].attributes[0]' \
106107
| jq '.key == "function_name", .value.stringValue == "_start"'
108+
109+
- name: Install Component CLI Deps
110+
uses: actions-rs/cargo@v1
111+
with:
112+
command: install
113+
args: wasm-tools cargo-component
114+
115+
- name: Install Just
116+
uses: extractions/setup-just@v1
117+
118+
- name: Build wit
119+
run: just build_wit
120+
121+
- name: Component Demo
122+
run: just component_demo
123+
124+
- name: Component Demo 2
125+
run: just component_demo_2

0 commit comments

Comments
 (0)