-
Notifications
You must be signed in to change notification settings - Fork 177
Closed
Milestone
Description
This is the first step in supporting workers implementing the wasi-http incoming-handler interface (https://wa.dev/wasi:http#incoming-handler).
The primary challenge is that this interface takes an incoming-request handle to a host resource, and returns with a outgoing-response handle to a host resource, which is not something we can directly invoke using Golem's existing invokation API.
Instead, as part of this ticket, we define:
- A gRPC definition of HTTP request->response handler, using gRPC streaming for the request and response body
- A special invocation mode in worker executor, wrapping the existing one (on the level of
invocation.rs) that does the following:- Take the request information (coming via gRPC) and set up a host
incoming-resourceinstance - Invoke the worker's exported
wasi:http/incoming-handler:{handle}function with this resource - Take the returned
outgoing-responseresource and convert it back to the protobuf response structure
- Take the request information (coming via gRPC) and set up a host
- This new invocation mode needs to be implemented on all layers (
Worker, including the invocation loop) and wired to the gRPC handler - To make the scope of the task smaller, it is enough for this ticket to NOT do actual request/response body streaming
- Likely requires changes to the oplog too (to be decided by the implementor), some options:
- Maybe it is possible to not introduce new invocation start/end entries, but instead use the existing ones, converting the request/response data to
Value. Or maybe it is easier to have dedicated new ones. Think of the currentExportedFunctionInvoked,ExportedFunctionCompletedandPendingWorkerInvocationentries.
- Maybe it is possible to not introduce new invocation start/end entries, but instead use the existing ones, converting the request/response data to
- Support this new call in the test DSL
- Write worker executor test(s) proving this works
With this ticket done we can call worker executor using a representation of a "http request" and get back a representation of a "http response", while the worker itself exports only the wasi-http incoming handler interface.
Follow-up tickets add streaming support and wires this functionality into the worker bridge.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels