-
Notifications
You must be signed in to change notification settings - Fork 61
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
WASI support #202
WASI support #202
Conversation
Signed-off-by: Anton Whalley <[email protected]>
Signed-off-by: Anton Whalley <[email protected]>
Signed-off-by: Anton Whalley <[email protected]>
Signed-off-by: Anton Whalley <[email protected]>
This is very cool. Thanks! With "Wasm containers" supported in containerd and Docker Desktop etc, developers can build very small container apps to respond to events on demand -- image size for a Wasm app is often 1-2 MB as opposed to 20+MB for LXC; and Wasm starts up much faster than LXC apps. I would like to understand if there is anything we can do on the |
@juntao Thanks for the feedback. As you mention the main item is the |
Thanks @No9 I looked into the autocfg issue. It seems that it can be fixed with a |
@juntao Great news! Do you want to PR it in and we can monitor? claim is used quite widely so it would be great to get it in. |
Signed-off-by: Anthony Whalley <[email protected]>
@juntao That worked out and I've updated the PR. |
Very cool. Thank you! I look forward to building and deploying cloudevent functions in Wasm containers! |
@jcrossley3 Now that wasm support has been added to OpenShift in developer preview with Knative support my understanding is that this is based on wasmedge. is there anychance we can get this PR to land? |
@No9 Can you rebase through the conflicts, please? |
Signed-off-by: Anton Whalley <[email protected]>
@Lazzaretti @jcrossley3 I've rebased and merged the changes |
@No9 Thanks for the update! I would prefer to have the tests including CI in the same PR :) |
Signed-off-by: Anton Whalley <[email protected]>
@Lazzaretti updated the PR to support Notes: nit: hyper had slipped out of the conditional in Cargo.toml during a merge so that has been fixed. |
Signed-off-by: Anton Whalley <[email protected]>
Signed-off-by: Fabrizio Lazzaretti <[email protected]>
403b5ff
to
811b44e
Compare
@No9 Thanks a lot for your contribution 🎉 |
Hi All,
Opening this draft to solicit feedback and gauge interest.
I've been building out a
kn func
project for WASI using WASMEdgehttps://github.com/uirlis/func-rust-wasi/tree/main/cloudevents
As part of that work I have put together a first pass at getting cloudevents to compile for WASI which is this PR.
The majority of the work is redefining the features in the Cargo.toml to bring in hyper-wasi when the OS is
wasi
However I had to patchrust-claim
in the test suite as theautocfg
doesn't play well with a hyper-wasi so this placeholder is usedhttps://github.com/cloudevents/sdk-rust/compare/main...No9:wasi-support?expand=1#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542R74.
Which points to this patch
svartalf/rust-claim@master...No9:rust-claim:ignore-autocfg-wasi
No longer an issue as latest active claims repo has been added.
To build and run this PR you will need:
WASMEdge installed - https://wasmedge.org/book/en/quick_start/install.html
WASI Tools for Rust -
cargo install cargo-wasi
Set the was env -
export CARGO_TARGET_WASM32_WASI_RUNNER=wasmedge
Currently this PR should pass testing with with the following command that enables the features used in the sample kn project
And the main contribution command
cargo test --all-features --all
also passesBut the main contribution command with
wasm32-wasi
fails as expected with numerous errors.If this is of interest and we can work out what to do about
claim
I'm happy working on the CI pieces to finalise.Also understand if this is using projects that are too nascent and you want to keep it down stream for a while.