Skip to content
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

Add wasi-http trigger support based on wasmtime-wasi-http take 2 #1877

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Oct 11, 2023

Based on a rebased version of #1855 with a couple of additional small commits.

dicej and others added 3 commits October 11, 2023 17:27
This required upgrading to a snapshot of what will eventually be Wasmtime 14, as
well as upgrading `wit-bindgen` to 0.12.

Note that I had to make a copy of wit/preview2 under sdk/rust/macro in order to
allow the `http_component` and `redis_component` macros to generate a
`wit_bindgen::generate` invocation that actually works.  Ideally we'd avoid this
duplication, e.g. by using a registry.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

address PR feedback

- Move `spin_http::empty` and `spin_http::full` into a `body` submodule
- Use `Bytes::from_static` where appropriate

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

update Wasmtime and `spin-componentize` deps to Wasmtime release-14.0.0 branch

This also re-enabled wit-bindgen 0.8 support in `spin-componentize` to
(hopefully) fix the e2e tests.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

add `wasi_http_component` macro to Rust SDK

The implementation is pretty ugly given that the inbound and outbound parts of
`wasi-http` are tightly coupled, and it's not currently possible to tell
`wit_bindgen::generate` to reuse types instead of generating duplicate ones.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev enabled auto-merge October 11, 2023 16:34
@rylev rylev merged commit 42d3c44 into main Oct 11, 2023
10 checks passed
@rylev rylev deleted the wasi-http-wasmtime-rebase branch October 12, 2023 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants