containers / crun

A fast and lightweight fully featured OCI runtime and C library for running containers
GNU General Public License v2.0
2.94k stars 299 forks source link

Support for wasm-micro-runtime handler #1498

Open macko99 opened 1 month ago

macko99 commented 1 month ago

Hello, I try to add support for wasm-micro-runtime (WAMR) as another handler. It seems promising since it is a very lightweight WASM runtime.

I have followed the implementation of current handlers as well as docs regarding embedding WAMR, but unfortunately, I failed to succeed. Here is the PR with my efforts.

Would someone be able to help me fix it? Currently, it seems that the wasm module is not executed, regarding the "Running" status reported by kubectl.

I'm using Kubernetes 1.27, containerd 1.6, latest build of crun and WAMR.

macko99 commented 1 month ago

Hi, I have updated my PR and it does work! It is not yet fully developed and needs some polishing but the WASM containers are executing. The env vars are being passed and you can see the container logs. The memory footprint is much much lower than the one of Wasmedge. Simple wait containers use about 54% less memory due to the WAMR library being super lightweight!

It seems very promising!