-
Notifications
You must be signed in to change notification settings - Fork 807
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
HTTP server embedded mode works with WasmEdge and not with WasmTime (and vice et versa) #2056
Comments
Hi @k33g |
I think I can help with the first issue. |
@MediosZ do you mean that wasm_edge_socket is a dependency of https://hyper.rs ? |
wasmedge_wasi_socket is a dependency of |
Oh! @MediosZ thank you (I didn't read the |
If you have any other questions please let me know. |
Hi @k33g TLDRThe socket-related functions in the WasmEdge implementation are different from the WasmTime. Our socket-related functions will ask users to use DetailsWasmEdge started working on the socket-related functions before the https://github.com/second-state/wasmedge_wasi_socket/blob/main/src/socket.rs#L271-L352 and also the https://github.com/second-state/wasmedge_wasi_socket/blob/main/src/wasi_poll.rs#L101-L106 Since there are some projects starting using the WASI spec |
@hydai, thank you for the detailed answer 🙏 (the release 0.12 will be ✨) |
I tried the following two examples on a Macbook M1 with wasmedge version 0.11.2:
and I likewise get the following runtime error:
The same issue was mentioned above in the description by @k33g. Any idea what might be causing this? (Update: same thing happens on an Intel Mac, so it appears unrelated to the architecture on which WasmEdge is running.) |
As the error message suggests, WasmEdge implements a super set of socket APIs thats available in standard WASI proposals. In order for these examples to work, we need non-blocking I/O, DNS etc, which are not currently supported in other runtimes. We are working on getting this features into the WASI standard, however. |
The issue is not occurring with some other runtime, but with wasmedge itself, hence my question. |
I tried this example |
I believe the error occurs because the pr that adds networking functions on macOS is merged but not shipped with version 0.11.2. |
Description
I have two use cases.
Current State
First use case: Rust HTTP server
I start the WASM HTTP server with WasmEdge like this:
🟢 everything is ok when I query the service with
curl -d '👋 Hello World 🌍' -X POST http://127.0.0.1:8080/echo
If I start the same wasm module with WasmTime:
🔴 the server does not start:
Second use case: ASP.Net HTTP server
I created a WASM ASP.Net HTTP server with dotNet Core WASI support preview.
If I start the same wasm module with WasmTime:
🟢 the server starts, and I can "curl" the service:
curl http://localhost:8080
If I start the same wasm module with WasmEdge:
🔴 the server does not start:
Expected
Theoretically, I should be able to launch the WASM HTTP servers either with WasmEdge or WasmTime.
https://twitter.com/juntao/status/1589323762901843971
Environment
Steps to Reproduce
It's possible to open my project samples (https://github.com/wasm-university/wasm-hosted-web-servers) with Gitpod like this https://gitpod.io/#https://github.com/wasm-university/wasm-hosted-web-servers.
First use case: Rust HTTP server
Build:
cd http-service cargo build --target wasm32-wasi
Start with WasmEdge:
Call the service: (🟢 it works)
curl -d '👋 Hello World 🌍' -X POST http://127.0.0.1:8080/echo
Start with WasmTime:
Call the service: (🔴 it does not work)
curl -d '👋 Hello World 🌍' -X POST http://127.0.0.1:8080/echo
Second use case: ASP.Net HTTP server
Build:
Start with WasmTime:
Call the service: (🟢 it works)
Start with WasmEdge:
Call the service: (🔴 it does not work)
The text was updated successfully, but these errors were encountered: