-
Notifications
You must be signed in to change notification settings - Fork 74
Add Wasmtime runtime. #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
22afd7b
to
0505324
Compare
verified that it has started working fine and passing all the e2e tests in https://github.com/tetratelabs/proxy-wasm-go-sdk |
hmm..... I haven't been able to identify the cause...... |
as for the performance, they seem to have the compile time optimization configurations: https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime.h#L84-L105 |
@PiotrSikora I followed Lizan's advice and decided to use smart pointers 🙂 But I still have struggles to identify the root cause of memory leakage when used in Envoy. Besides that, I believe this is ready for review. Please take a look! @lizan I need your advice on C++, bazel in general 🙂 |
e2f60d1
to
37a3c80
Compare
@PiotrSikora I managed to generate BUILD files for wasmtime in 37a3c80 , which is based on https://github.com/mathetake/bazel-wasmtime-c-api repo where I used cargo-raze and a few of manual tweeks. PTAL! 😃 |
Could you split this into 2 PRs? One that just adds Wasmtime build machinery, and another with an actual implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, it looks great, thanks!
A left a few nits, and it looks that you're missing getStrippedSource()
.
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Why disabling cache? |
wasmtime's cache spawns a new thread for a cache worker, and I thought it would affect the host's performance, although the same may be true for V8. and what's more, it seems to use file system rather than in-memory cache: https://github.com/bytecodealliance/wasmtime/blob/main/crates/cache/src/worker.rs#L404 That said, I'm not sure how impactful it is, so I disable it for now (as an experimental runtime) @PiotrSikora anythought? |
Ah, OK. Sounds good! btw: |
Signed-off-by: mathetake <[email protected]>
Thanks! Updated |
envoyproxy/envoy@a871b14 also updated for envoy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more nits before merge.
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
Signed-off-by: mathetake <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Ah, one more thing. You need to include |
Signed-off-by: mathetake <[email protected]>
Thanks! |
Commit Message: wasm: Add Wasmtime as a new runtime Additional Description: add a new wasm runtime named Wasmtime Risk Level: low Testing: run in `bazel.compile_time_options` build target as WAVM. Docs Changes: Docs will be provided in subsequent PRs. Release Notes: enable Wasmtime as a Wasm filter runtime optionally. ref: proxy-wasm/proxy-wasm-cpp-host#73 Signed-off-by: mathetake <[email protected]> Co-authored-by: Piotr Sikora <[email protected]>
Commit Message: wasm: Add Wasmtime as a new runtime Additional Description: add a new wasm runtime named Wasmtime Risk Level: low Testing: run in `bazel.compile_time_options` build target as WAVM. Docs Changes: Docs will be provided in subsequent PRs. Release Notes: enable Wasmtime as a Wasm filter runtime optionally. ref: proxy-wasm/proxy-wasm-cpp-host#73 Signed-off-by: mathetake <[email protected]> Co-authored-by: Piotr Sikora <[email protected]>
Signed-off-by: mathetake [email protected]