Stream: WASI-Virt

Topic: CLI Virtualization


view this post on Zulip Guy Bedford (Jan 24 2024 at 21:48):

Picking up on CLI virtualization conversation from https://bytecodealliance.zulipchat.com/#narrow/stream/409526-jco/topic/Flattening.20components

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 21:52):

I'm not entirely following you with regards to streams, but that's fine; I think I just need to experiment a bit and come back with more context and a better understanding of the design. I think I have an okay grasp of the overall approach but it's a system which has a lot of subtleties to it around the edges (it took me a while to realize that you can't use wasm-tools compose to connect a component's imports and exports simultaneously to one of its dependencies).

view this post on Zulip Guy Bedford (Jan 24 2024 at 21:54):

certainly, prototyping is the way to go

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 21:55):

do you know if WASI-Virt has seen much deployment yet? my assumption is no considering it was not really usable with the rest of the toolkit until my PR was merged a few days ago, but just to check

view this post on Zulip Guy Bedford (Jan 24 2024 at 21:56):

it's definitely early for the project, and has rough edges still, but it's at the integration phase of development where issues to make those improvements is really welcome.

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 21:56):

I've tested the current main branch of WASI-Virt with YoWASP projects (Yosys only I think, but they're all the same) and everything seems to work fine so I think I'd like to put it to production use soon

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 21:58):

I think my main questions at this point are:

view this post on Zulip Guy Bedford (Jan 24 2024 at 21:59):

I don't know much about who's deploying it at the moment, but we are looking to see it used more widely at this point and to maintain it, as long as users are aware it has some rough edges.

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 22:00):

oh I see, wasmtime-py does support components, it's just not in the docs, only in the README. I'll see if I can use that, that would be really helpful for me to be able to get rid of my homegrown FS virtualization layer

view this post on Zulip Guy Bedford (Jan 24 2024 at 22:00):

yeah it might be time to publish WASI-Virt to crates.io now that we are finally on the latest preview2

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 22:00):

and yeah I'm quite happy to polish those rough edges, I've plenty of compiler engineering experience so none of it is intimidating

view this post on Zulip Guy Bedford (Jan 24 2024 at 22:01):

yeah it would be a really great help at this point I think for the project

view this post on Zulip Dan Gohman (Jan 24 2024 at 22:03):

One minor detail, we aren't quite aligned with WASI Preview 2 at the moment; https://github.com/bytecodealliance/WASI-Virt/pull/43 is one of two steps to finish the remaining things, though it's hitting an odd wasm-encoder error that I haven't yet debugged yet.

Update WASI-virt to wasi-cli@0.2.0-rc-2024-01-16. Several interfaces in wasi-sockets changed, so this updates the virtual-adapter accordingly.

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 22:03):

I'm very excited about it, especially thinking about the point where I can move on from shipping individual toolchain components to their compositions. eventually I want to be able to ship the entire FPGA toolchain as one huge wasm file runnable with wasmtime or something

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 22:04):

... I say "FPGA toolchain" but really that includes python (frontend) and clang (simulation compiler) too. loads of fun to have

view this post on Zulip Catherine (whitequark) (Jan 24 2024 at 22:05):

it's pushing "OS distribution" a little at that point

view this post on Zulip Guy Bedford (Jan 24 2024 at 22:07):

I know some Microsoft folks had a Python build for preview1, which may well adapt over to preview2 okay, could ask for the link if you'd like to test it out

view this post on Zulip Brett Cannon (Jan 24 2024 at 23:48):

Guy Bedford said:

I know some Microsoft folks had a Python build for preview1, which may well adapt over to preview2 okay, could ask for the link if you'd like to test it out

I'm assuming I'm the "Microsoft folks [which] had a Python build for preview1" and said builds are https://github.com/brettcannon/cpython-wasi-build/releases

Unofficial WASI builds of CPython. Contribute to brettcannon/cpython-wasi-build development by creating an account on GitHub.

view this post on Zulip Guy Bedford (Jan 25 2024 at 01:14):

Thanks for sharing, makes for a great test case!

view this post on Zulip Guy Bedford (Jan 25 2024 at 01:24):

^^^ Just tested that as a Wasm component with jco run against our new preview2 implementation and can confirm it all works :)

view this post on Zulip Guy Bedford (Jan 25 2024 at 01:28):

Screenshot-2024-01-24-at-5.28.03-PM.png


Last updated: Nov 22 2024 at 17:03 UTC