Live data from Hacker News

Container2wasm: Convert Containers to WASM Blobs

github.com

31–40 of 72 posts

Re: Container2wasm: Convert Containers to WASM Blobs

#31
post #23
post #12

Earlier quoted context omitted.

Being able to run ANY Docker container directly in the browser is incredibly useful. The most obvious application is educational environments - this makes it trivial to provide all sorts of software for students to tinker with without needing to run any server-side code anywhere, just some static file hosting.

I very much doubt it's "any" docker image. WASM isn't 1:1 feature equivalent with docker. e.g. filesystem access

It looks to me like they solve that by simulating the entire Linux operating system, filesystem included.

You won't get persistence when you restart the process, but you'll still be able to run code that needs to read and write files.

Try it for yourself: visit https://ktock.github.io/container2wasm-demo/amd64-debian-was... to start a shell against a Debian container, then use "echo 'hi' > hello.txt" to write a file and "cat hello.txt" to read it.

Re: Container2wasm: Convert Containers to WASM Blobs

#32
post #9

Maybe these containers should be build for wasm-wasi instead of x86 from the beginning? Then there would be no need to emulate x86 in wasm

There is support in Docker to run wasm-wasi binaries directly (see: https://wasmlabs.dev/articles/docker-without-containers/). The downside compared to OP's approach is that whatever you're running has to have already been compiled to wasm-wasi. The upside would be much faster execution time (no emulation overhead for x86).

Re: Container2wasm: Convert Containers to WASM Blobs

#33
post #12
post #10

Is this a "why not" project, or are there real-world use cases for this?

Being able to run ANY Docker container directly in the browser is incredibly useful. The most obvious application is educational environments - this makes it trivial to provide all sorts of software for students to tinker with without needing to run any server-side code anywhere, just some static file hosting.

This is the use case I've been tackling with Runno (https://runno.dev), it's more performant than OP's approach but not as flexible.

Re: Container2wasm: Convert Containers to WASM Blobs

#35
post #12
post #10

Is this a "why not" project, or are there real-world use cases for this?

Being able to run ANY Docker container directly in the browser is incredibly useful. The most obvious application is educational environments - this makes it trivial to provide all sorts of software for students to tinker with without needing to run any server-side code anywhere, just some static file hosting.

Being able to do it client-side eliminates the biggest cost barrier (VM time) and risks (people using your VMs for cryptomining) that you encounter trying to offer real 'labs' for users.

Re: Container2wasm: Convert Containers to WASM Blobs

#36
post #27
post #25

Do any GUI frameworks support WASM? I've been looking for a way to run GUI applications remotely for a while, specifically on a wlroots compositor. Projects like this (maybe one day) and https://github.com/udevbe/greenfield are interesting since they essentially make access universally accessible.

I don't know about GTK, QT, and the like, but there's a whole budding ecosystem purporting to solve it WASM-native. Dioxus [1] and about a dozen other libraries are attempting to be write-once, deploy web, mobile, desktop with native performance. They adopt a React-like component UI. The Rust ecosystem is full of stuff. There are lots of different approaches too - immediate mode drawing, canvas drawing [2], etc. Choo…

GTK+ has Broadway to render GTK applications to the web browser. Qt has some ActiveX support, but you don't want that. Java/Kotlin has a bunch of frameworks, like TeaVM to run .JAR files in the browser, or Vaadin to write web GUIs like you would desktop applications.

I think most languages that have been around for more than five years have some kind of GUI framework that'll run in the browser.

Very worst-case scenario, you could compile a Windows executable and run them in BottledWine :P

Re: Container2wasm: Convert Containers to WASM Blobs

#37
post #25

Do any GUI frameworks support WASM? I've been looking for a way to run GUI applications remotely for a while, specifically on a wlroots compositor. Projects like this (maybe one day) and https://github.com/udevbe/greenfield are interesting since they essentially make access universally accessible.

COSMIC DE (Rust-based) supports rust-windowing/winit apps, which compile to a tag in WASM.

winit: https://github.com/rust-windowing/winit

Re: Container2wasm: Convert Containers to WASM Blobs

#38
container2wasm > Additional Resources: https://github.com/ktock/container2wasm#additional-resources :

vscode-container-wasm: https://github.com/ktock/vscode-container-wasm :

> VSCode extension for running containers on VSCode for the web (e.g. github.dev, [vscode.dev,]), leveraging container2wasm

Chromebooks can run vscode.dev and WASM.

Is this the best way to `git clone` and run `python -m this` in a Bash/ZSH shell on a Chromebook?

This could be useful with jupyter-repo2docker.

Re: Container2wasm: Convert Containers to WASM Blobs

#39
post #25

Do any GUI frameworks support WASM? I've been looking for a way to run GUI applications remotely for a while, specifically on a wlroots compositor. Projects like this (maybe one day) and https://github.com/udevbe/greenfield are interesting since they essentially make access universally accessible.

This seems like an absolute nightmare for people with disabilities.

Re: Container2wasm: Convert Containers to WASM Blobs

#40

Shameless self-promotion: https://webvm.io Powered by a x86->Wasm JIT. Technical writeup: https://labs.leaningtech.com/blog/webvm-server-less-x86-virt...

It's a bit hard to tell, but this isn't open source (well, assuming we all don't consider wasm source :)), right?

I got as far as "powered by cheerpx", which leads me here: https://leaningtech.com/webvm/

And I'm also guessing that you guys just allow free use of the compiled wasm for demos such as this?

Post reply on HN