Show HN: Run WASM in Containerd (github.com)
I've been working with a partner team to integrate wasm workloads with existing container toolchains with the goal of enabling wasm workloads anywhere, be it on the edge, in kubernetes, or wherever.
To that end, this project implements a containerd shim which runs those wasm workloads. It is designed as a library to bring your own host implementation, but also includes an implementation for WASI. Right now the library assumes you are using wasmtime, which is embedded in.
It works either standalone (run with containerd directly) or in kubernetes. Kubernetes networking and storage are wired into the wasm host and the wasm can run side by side with native workloads on the same machine. Wasm pods can be exposed as a service like any other pod.
11 comments
[ 2.8 ms ] story [ 35.1 ms ] threadI'm certainly excited about the Rust aspect.
Tangentially relevant shameless plug:
https://news.ycombinator.com/item?id=31242735
The core security advantage of WASM is the fact that no file capabilities are provided to the workload by default.
If you have something like a Kubernetes volume, config map, secret, etc. this is all prepared by Kubelet and winds up as mounts we need to perform as mentioned above.
Looks like that’s not decided yet.
In theory you could use pod.spec.volumes to hand it over to the shim for the wasi preopens.[1]
Whether that’s a good idea is the other side of the story…
[1] https://github.com/bytecodealliance/wasmtime/blob/main/docs/...
https://github.com/deislabs/runwasi/blob/9a43a31c1f29df65392...
The WasmEdge team also tamed their crun OCI runtime to run containers as well as wasm modules. [1]
So running wasm along with your pods is not exactly new.
Though it yet needs to be proven what’s the better approach: a shim on CRI level or integration in OCI level…
[1] https://wasmedge.org/book/en/kubernetes.html
I did look at implementing this at the OCI layer (also really cool that crun does this!) but decided to go another way.
Is there a WasmEdge replacement shim using Wasmtime?
Jokes aside, it's mainly cause Rust has first class support for wasm. Soon the rest will catch up.