7 releases (breaking)

0.7.0 Oct 7, 2024
0.6.0 May 23, 2024
0.5.0 Mar 20, 2024
0.4.0 Nov 1, 2023
0.1.2 Mar 7, 2023

#158 in WebAssembly

Download history 45/week @ 2024-07-27 1/week @ 2024-08-03 19/week @ 2024-08-10 26/week @ 2024-08-17 2/week @ 2024-08-24 32/week @ 2024-09-07 10/week @ 2024-09-14 38/week @ 2024-09-21 26/week @ 2024-09-28 224/week @ 2024-10-05 52/week @ 2024-10-12 3/week @ 2024-10-19 21/week @ 2024-10-26 82/week @ 2024-11-02 17/week @ 2024-11-09

127 downloads per month

Apache-2.0

325KB
4.5K SLoC

runwasi logo

containerd-shim-wasm

A library to help build containerd shims for wasm workloads.

Usage

use containerd_shim as shim;
use containerd_shim_wasm::sandbox::{ShimCli, Instance, Nop}

shim::run::<ShimCli<Nop>>("io.containerd.nop.v1", opts);

The above example uses the built-in Nop instance which does nothing. You can build your own instance by implementing the Instance trait.

use containerd_shim as shim;
use containerd_shim_wasm::sandbox::{ShimCli, Instance}

struct MyInstance {
 // ...
}

impl Instance for MyInstance {
    // ...
}

shim::run::<ShimCli<MyInstance>>("io.containerd.myshim.v1", opts);

containerd expects the shim binary to be installed into $PATH (as seen by the containerd process) with a binary name like containerd-shim-myshim-v1 which maps to the io.containerd.myshim.v1 runtime which would need to be configured in containerd. It (containerd) also supports specifying a path to the shim binary but needs to be configured to do so.

This crate is not tied to any specific wasm engine.

Dependencies

~35–54MB
~1M SLoC