Skip to content

Commit

Permalink
update the table
Browse files Browse the repository at this point in the history
Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka committed Sep 21, 2023
1 parent 19a7a8a commit b9f2397
Showing 1 changed file with 51 additions and 38 deletions.
89 changes: 51 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Containerd Wasm Shims

This project aims to provide containerd shim implementations that can run [Wasm](https://webassembly.org/) / [WASI](https://github.com/WebAssembly/WASI) workloads using [runwasi](https://github.com/deislabs/runwasi) as a library. This means that by installing these shims onto Kubernetes nodes, we can add a [runtime class](https://kubernetes.io/docs/concepts/containers/runtime-class/) to Kubernetes and schedule Wasm workloads on those nodes. Your Wasm pods and deployments can act just like container workloads!

[runwasi](https://github.com/deislabs/runwasi) is a project that aims to run WASI workloads managed by [containerd](https://containerd.io/).
Expand All @@ -7,18 +8,19 @@ This project aims to provide containerd shim implementations that can run [Wasm]

This repo currently maintains four shims for Wasm application runtimes/frameworks:

1. [Lunatic](https://github.com/lunatic-solutions/lunatic) - an Earlang-inspired runtime for fast, robust and scalable server-side Wasm application.
1. [Lunatic](https://github.com/lunatic-solutions/lunatic) - an Earlang-inspired runtime for fast, robust and scalable server-side Wasm application.
2. [Spin](https://github.com/fermyon/spin) - a developer tool for building and running serverless Wasm applications.
3. [Slight](https://github.com/deislabs/spiderlightning) - a wasmtime-based runtime for running Wasm applications that use SpiderLightning (aks [WASI-Cloud-Core](https://github.com/WebAssembly/wasi-cloud-core)) capabilities
4. [Wasm Workers Server](https://github.com/vmware-labs/wasm-workers-server) - a tool to develop and run serverless applications server on top of Wasm.

Below is a table of the shims and the the most recent versions of the shims that are supported by this project.

| **shim version** | v0.9 |
|-------|------|
| **lunatic** | [v0.13.2](https://github.com/lunatic-solutions/lunatic/releases/tag/v0.13.2) |
| **spin** | [v1.4.1](https://github.com/fermyon/spin/releases/tag/v1.4.1) |
| **slight** | [v0.5.1](https://github.com/deislabs/spiderlightning/releases/tag/v0.5.1) |
| **wws** | [v1.5.0](https://github.com/vmware-labs/wasm-workers-server/releases/tag/v1.5.0) |
| **shim version** | v0.9 | v0.8 | v0.7 | v0.5.1 | v0.5.0 |
| ---------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| **spin** | [v1.4.1](https://github.com/fermyon/spin/releases/tag/v1.4.1) | [v1.4.0](https://github.com/fermyon/spin/releases/tag/v1.4.0) | [v1.3.0](https://github.com/fermyon/spin/releases/tag/v1.3.0) | [v1.0.0](https://github.com/fermyon/spin/releases/tag/v1.0.0) | [v0.9.0](https://github.com/fermyon/spin/releases/tag/v0.9.0) |
| **slight** | [v0.5.1](https://github.com/deislabs/spiderlightning/releases/tag/v0.5.1) | [v0.5.0](https://github.com/deislabs/spiderlightning/releases/tag/v0.5.1) | [v0.5.0](https://github.com/deislabs/spiderlightning/releases/tag/v0.5.0) | [v0.4.0](https://github.com/deislabs/spiderlightning/releases/tag/v0.4.0) | [v0.4.0](https://github.com/deislabs/spiderlightning/releases/tag/v0.4.0) |
| **wws** | [v1.5.0](https://github.com/vmware-labs/wasm-workers-server/releases/tag/v1.5.0) | [v1.4.0](https://github.com/vmware-labs/wasm-workers-server/releases/tag/v1.4.0) | [v1.2.0](https://github.com/vmware-labs/wasm-workers-server/releases/tag/v1.2.0) | / | / |
| **lunatic** | [v0.13.2](https://github.com/lunatic-solutions/lunatic/releases/tag/v0.13.2) | / | / | / | / |

## Compare to `runwasi` shims

Expand All @@ -32,55 +34,66 @@ As mentioned above, this project uses runwasi's `containerd-shim-wasm` to build
- [Deploy a Wasm Workers Server application with k3d](./containerd-shim-slight-v1/quickstart.md)

### Building the shims

To build the shims in this project, run `make build`.

### Running the integration tests

To run the integration tests, run `make integration-tests`.

### Cleaning up

To clean up, run `make tests/clean`.

## Example Kubernetes Cluster Deployments

In [the deployments directory](deployments) you will find examples of deploying the shims to Kubernetes clusters and using them in example Kubernetes workloads.

## Using a shim in Kubernetes

To use one of these containerd shims in Kubernetes, you must do the following:
1. Install the shim binary somewhere on the path of your Kubernetes worker nodes. For example, copy `containerd-shim-spin-v1` to `/bin`.

1. Install the shim binary somewhere on the path of your Kubernetes worker nodes. For example, copy `containerd-shim-spin-v1` to `/bin`.
2. Add the following to the containerd config.toml that maps the runtime type to the shim binary from step 1.
```toml
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin]
runtime_type = "io.containerd.spin.v1"
```

```toml
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin]
runtime_type = "io.containerd.spin.v1"
```

3. Apply a runtime class that contains a handler that matches the "spin" config runtime name from step 2.
```yaml
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: wasmtime-spin
handler: spin
```

```yaml
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: wasmtime-spin
handler: spin
```
4. Deploy a Wasm workload to your cluster with the specified runtime class name matching the "wasmtime-spin" runtime class from step 3.
```yaml
apiVersion: apps/v1
kind: Deployment
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: wasm-spin
spec:
replicas: 1
selector:
matchLabels:
app: wasm-spin
template:
metadata:
name: wasm-spin
labels:
app: wasm-spin
spec:
replicas: 1
selector:
matchLabels:
app: wasm-spin
template:
metadata:
labels:
app: wasm-spin
spec:
runtimeClassName: wasmtime-spin
containers:
- name: spin-hello
image: ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:latest
command: ["/"]
```
runtimeClassName: wasmtime-spin
containers:
- name: spin-hello
image: ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:latest
command: ["/"]
```
## Code of Conduct
Expand Down

0 comments on commit b9f2397

Please sign in to comment.