Skip to main content
Version: v3.8.0

Wasm runtime

Edgelet runs Wasm workloads on linux when containerEngine: edgelet. Workloads use platform: wasi/wasm and a RuntimeClass handler. Docker and Podman engines do not support RuntimeClass on Edgelet.

Prerequisites

RequirementDetail
Platformlinux only
EnginecontainerEngine: edgelet
Shim binaryHandler-specific containerd-shim-* on PATH (see table below)
RuntimeClassDeployed on the node before scheduling a Wasm microservice

potctl can stage Wasm shims during Edgelet node install when package.wasm is set on the Agent manifest. Native linux install only; skipped for deploymentType: container and for containerEngine: podman.

RuntimeClass

Register handlers with EdgeletAPI deploy manifests (apiVersion: edgelet.iofog.org/v1). Each metadata.name is the value you set on spec.container.runtime in Controller YAML.

apiVersion: edgelet.iofog.org/v1
kind: RuntimeClass
metadata:
name: edgelet-wasmtime
handler: edgelet-wasmtime

Apply on the node:

edgelet deploy -f runtimeclass-edgelet-wasmtime.yaml
edgelet deploy -f runtimeclass-edgelet-wasmtime.yaml --dry-run

edgelet-wasmtime is the Datasance wasmtime shim (containerd-shim-edgelet-v2). It is not the same as containerEngine: edgelet (the embedded OCI engine).

Supported handlers

HandlerShim binary (primary)Notes
edgelet-wasmtimecontainerd-shim-edgelet-v2Datasance shim; recommended for generic WASI images
spincontainerd-shim-spin-v2Spin framework workloads
wasmtimecontainerd-shim-wasmtime-v2Upstream wasmtime shim
wasmedgecontainerd-shim-wasmedge-v2WasmEdge shim
wasmercontainerd-shim-wasmer-v2Wasmer shim
slightcontainerd-shim-slight-v2Slight runtime
lunaticcontainerd-shim-lunatic-v2Lunatic runtime
wwscontainerd-shim-wws-v2Wasmer WASIX (wws)

Edgelet discovers shims from PATH. If the shim is missing, deploy fails with a clear error when the workload starts.

Pin a Wasm microservice

Controller YAML uses apiVersion: {API_VERSION}. Set spec.container.platform to wasi/wasm and spec.container.runtime to the RuntimeClass metadata.name (not containerEngine).

Microservice (edgelet-wasmtime)
apiVersion: datasance.com/v3
kind: Microservice
metadata:
name: wasm2
spec:
name: wasm2
agent:
name: edge-1
images:
registry: 1
amd64: ghcr.io/containerd/runwasi/wasi-demo-app:latest
arm64: ghcr.io/containerd/runwasi/wasi-demo-app:latest
container:
platform: wasi/wasm
runtime: edgelet-wasmtime
ports:
- internal: 8080
external: 8081
protocol: tcp
application: wasm

Spin example (runtime: spin):

Application excerpt (spin)
apiVersion: datasance.com/v3
kind: Application
metadata:
name: wasm
spec:
microservices:
- name: wasm
agent:
name: controller-1
images:
registry: 1
amd64: ghcr.io/spinframework/containerd-shim-spin/examples/spin-rust-hello:v0.22.0
arm64: ghcr.io/spinframework/containerd-shim-spin/examples/spin-rust-hello:v0.22.0
container:
platform: wasi/wasm
runtime: spin
ports:
- internal: 80
external: 8080
protocol: tcp
commands:
- "/"

Deploy the application with potctl after the RuntimeClass exists on the target Edgelet node.

Operator install (optional)

When provisioning an Edgelet node, potctl can install configured Wasm handlers and apply matching RuntimeClass manifests. Set package.wasm on the Agent kind with handler keys (for example edgelet-wasmtime, spin). See Setup Edgelet Nodes.

Troubleshooting

SymptomCheck
runtimeclass is supported only when containerEngine=edgeletSet containerEngine: edgelet on linux
Workload stuck or shim errorwhich containerd-shim-edgelet-v2 (or handler-specific shim); redeploy RuntimeClass
Handler not foundedgelet deploy -f runtimeclass.yaml --dry-run; confirm metadata.name matches spec.container.runtime

See also

Group 3See anything wrong with the document? Help us improve it!