Skip to content

Commit

Permalink
Add 04-22 meeting notes
Browse files Browse the repository at this point in the history
  • Loading branch information
linclark authored Apr 22, 2021
1 parent 74b9db6 commit 4ab96a8
Showing 1 changed file with 182 additions and 1 deletion.
183 changes: 182 additions & 1 deletion meetings/2021/WASI-04-22.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,186 @@ The meeting will be on a zoom.us video conference.
1. Announcements
1. _Sumbit a PR to add your announcement here_
1. Proposals and discussions
1. [Proxy-Wasm](https://github.com/proxy-wasm) update (Piotr Sikora)
1. [Proxy-Wasm](https://github.com/proxy-wasm) update (Piotr Sikora, [slides](https://docs.google.com/presentation/d/1PYuWke-XDJhAYdCUIw20_I-LoR2IVfJlo5Gn784fFYs/edit?usp=sharing&resourcekey=0-vnuIEdhe_kdc9VHQ6-o2Pg))
1. _Sumbit a PR to add your agenda item here_

## Notes
### Attendees
- Dan Gohman
- Sam Clegg
- Johnnie Birch
- Mingqiu Sun
- Yong He
- Andrew Brown
- Lin Clark
- Piotr Sikora
- Luke Wagner
- M Butcher
- Mark
- Ralph Squillace


**Piotr Sikora:** Update on proxy-wasm. People have changed, so going to recap.

Slides: https://docs.google.com/presentation/d/1PYuWke-XDJhAYdCUIw20_I-LoR2IVfJlo5Gn784fFYs/edit?usp=sharing&resourcekey=0-vnuIEdhe_kdc9VHQ6-o2Pg

Primary reason is to extend capabilities of proxies with business logic. Ideally running on different proxies and providers. Run in Nginx, istio, fastly, and works exactly the same on the platforms. Started as part of istio to allow code at runtime with security, but that’s not the only reason. Primary reason is abstraction across different providers.

Have support for logging, metrics, network filters, HTTP and gPRC callouts, can do auth check, have key-value store (non-durable, only used to coordinate e.g. telemetry, not meant as DB), background services and timers, FFI.

Current adoption pretty good, supported in Envoy and Istio Proxy. Alibaba added support to MOSN. Created embeddable Go host library. Have SDKs for AS, C++, Go, Rust. ABI spec is kind of lagging behind, so they are all using last year’s version which isn’t reflected in today’s presentation.

Compared to serverless, we are executing in-process as part of request/response flow, trying to minimize memory overhead, running multiple requests in same VM. Handle as much as possible in the optimized host e.g. TLS processing

Led to a design that’s using reactor, each entry point is an event. Minimize number of calls, e.g. include number and size of headers so you don’t need to do extra call. Transforming pre-opened connections.

[walk through Example slide]

Changes since last update: trying to align with WASI. Prev memory allocations were happening on host side, e.g. get host headers would call plugin and would then copy to own memory. Context_id is passed as arg, prev this was implied and not part of ABI. Added support to have multiple instances of timers, queues, etc.

Wasi-context. We run multiple plugins as part of the same wasm instance if there are multiple plugins compiled as part of the same wasm module. Don’t expect this to land in WASI in this form.

Wasi-common. Retrieve data, get/set property. I put them in common because they are shared across http proxy and bytestream, etc. Perhaps should move towards something more generic.

Wasi-bytestream. TCP, UDP stream, QUIC.

Wasi-http or wasi-http-proxy.

wasi-http-client .

**Sam Clegg:** So if WASI developed async, you could use that.

**Dan Gohman:** The Wasm stack switching proposal is the place where that async work is happening.

**Sam Clegg:** I wonder if this changes—instead of having callout ID, you would use the stack.

Wasi-grpc. Similar set of APIs. bidirectional open http2 request. Wondering whether this should be separate component, or whether should be layered on top of http. Left as dedicated abi because of small details.

**Dan Gohman:** are the on functions calling _____

Now for straightforward components: wasi-log. Print_f or std_out. Level so we don’t waste time for hosts that dont’ care about certain levels.

**Dan Gohman:** Minimizing calls because APIs are expensive?

**Piotr Sikora:** Again, this is running in process. Because of that, we’re looking at 300-400 nanosecond. Maybe premature optimization.

Wasi-kvstore. Not sure whether this is something that should be standardized in WASI. Can create new or open existing KV store. Make sure it’s atomic.

wasi-queue . similar to prev. We just use it to shift stats from each of the workers to aggregated.

Wasi-timer. Used to periodically call into the plugins so it can perform some background task.

Wasi-metrics. Maintained by the host.

Wasi-ffi. Support for foreign functions.

Next steps: alignment with WASI. Write witx, need to migrate to handles, need to see whether can leverage wasi-io.

New features: load balancing, tighter integration with cache control, ability to follow redirects because right now ABI makes it ugly, support for starttls because some start with plain text and then start tls in middle of connection, possibly UDP datagrams.

Any questions, comments?

**Sam Clegg:** What VM options do you provide?

**Piotr Sikora:** We’re running on V8, but envoy supports both Wasmtime and WAVM, and PR in progress for WAMR.

**Sam Clegg:** When you have the on callbacks, those are exports from the module, and the others are imports. Is this the first time we’re talking about exports of a wasm module.

**Dan Gohman:** Yes, currently tooling gaps

**Sam Clegg:** Once we have funcrefs, would it be better to use those than IDs.

**Luke Wagner:** One idea in other contexts, is distinction between interface and profile. It sounds like we’re talking about profiles to describe proxy filter.

**Piotr Sikora:** Definitely

**Luke Wagner:** There might be perf improvement if they aren’t callbacks

**Sam Clegg:** Funcrefs would require some sort of bind

**Luke Wagner:** IT wants to statically know the functions, so that works better when they are static exports.

**Dan Gohman:** At some level core wasm doesn’t like mutually recursive instances. This seems to have APIs that would want that, eg log interface. Have any ideas to resolve?

**Piotr Sikora:** One is host and one is module.

**Dan Gohman:** Thinking in terms of virtualization.

**Sam Clegg:** You would need mutual instantiation in order to satisfy.

**Piotr Sikora:** Those would be statically linked at compile time. Right now we solve this through SDK, so delivered as part of the same WASI module.

**Dan Gohman:** Goal is to make all of these virtualizable. How would we do that in the case of wasm module implementation. To be sure, this is a loaded question.

**Piotr Sikora:** Log doesn’t depend on anything.

**Dan Gohman:** You do have the program depending on the log module, the log module

**Luke Wagner:** You may need to split this into two modules. Containment relationship

**Sam Clegg:** Presumably only one log module, so there’s a multiplexing here, is that right? Could have 1000 plugins and there’s only 1 log instance.

**Luke Wagner:** So you’d have 1 of the inner things, and N of the outer things. Might be an interesting question of whether this could just be a function call.

**Dan Gohman:** Maybe the log function could return current log level.

**Sam Clegg:** Highlights some sort of design space we need to think about

**Andrew Brown:** essence of the problem here. IIn order to work, every module needs to register somewhere and there’s no good place.

**Dan Gohman:** Good question. Does everyone get their own log instance. Can you run multiple plugins in same store.

**Piotr Sikora:** Yes. share an instance

**Andrew Brown:** The instance we’re talking about is a host instance for loggin.

**Dan Gohman:** Sort of both. Should de-emphasize the instance

**Sam Clegg:** Something that changed over the last year or so. We now think more about virtualizability. Never made a formal announcement, but that’s the way that’s it’s going.

**Piotr Sikora:** Now I understand the issue. So I guess the question is do we see these components as something that we want to include.

**Dan Gohman:** Certainly a lot of functionality that’s common to a lot of things. I think question is with the callback interface, will that be generalized enough, or is this more of a specialized use case? People doing HTTP that are using no callbacks. Do we need separate APIs for that?

**Piotr Sikora:** Good question, prefer same APIs.

**Dan Gohman:** The callback model requires fundamentally different model. E.g. C++ doesn’t have a way of getting called ___

**Piotr Sikora:** No main function

**Dan Gohman:** That’s a pretty fundamental difference between models. That’s why we’re working on difference between command and reactor. This is an open question.

**Sam Clegg:** I guess you’re saying that anything that has these callback patterns is by definition a reactor.

**Andrew Brown:** Kind of changes requirements of WASI APIs, because if you’re one of these reactors that can look at HTTP headers, you have to export that function, which is a WASI requirement that we didn’t have before.

**Piotr Sikora:** But that’s the whole point of WASI reactors

**Dan Gohman:** What I would like to see then, could someone mock up end-to-end command style program that has callbacks

**Piotr Sikora:** Those are by definition mutually exclusive

**Dan Gohman:** That gets to my question. Do we need to have separate APIs. If we’re going to have one, then I’d like to see how it works.

**Andrew Brown:** It would be nice to just have one.

**Piotr Sikora:** Blocking

**Dan Gohman:** In regard to blocking, WASI is deferring to Wasm’s async model. Not practical in short term, so I think there’s space for doing something now with a custom async model, but that’s the current space that we’re in. But feels like it has bearing on whether it bifurcates the API.

**Andrew Brown:** Bringing this up brings up a great question. On other note, does this support client?

**Piotr Sikora:** Any idea when async may be widely available.

**Luke Wagner:** Like idea someone else brought up, maybe doesn’t have to wait.

**Lin Clark**: Next steps?

**Andrew Brown**: Seems like a convo about callbacks

**Luke Wagner:** Should have more to say about async after next Tuesday’s CG meeting

**Lin Clark:** Ok, I’ll follow up with those involved in the discussion to see whether this is offline chat or should be covered in next meeting.



0 comments on commit 4ab96a8

Please sign in to comment.