Skip to main content

Deploy with crun

The crun project has WasmEdge support baked in. This chapter will walk you through deploying WASM images with crun.

Fedora Platform

The crun fedora package has WasmEdge as the default WebAssembly Runtime. So the easiest way to deploy WasmEdge with crun is on the Fedora Linux distribution. Please refer to the next section for the other Linux distributions.

First, install crun and WasmEdge on your fedora machine.

sudo dnf -y install wasmedge
sudo dnf -y install crun

Next, run crun -v to check if you installed successfully.

crun -v
# Output
crun version 1.7.2
commit: 0356bf4aff9a133d655dc13b1d9ac9424706cac4
rundir: /run/user/501/crun
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL

You can see that crun has WasmEdge package already.

Next, you can run WASM apps on your fedora machine.

Other Linux Platforms

Quick start

The GitHub repo contains scripts and GitHub Actions for running our example apps on CRI-O.

Prerequisites

  1. Make sure you have installed WasmEdge

  2. Build and configure crun with WasmEdge support

For now, the easiest approach is just built it yourself from source. First, let's ensure that crun dependencies are installed on your Ubuntu 20.04. For other Linux distributions, please see here.

sudo apt update
sudo apt install -y make git gcc build-essential pkgconf libtool \
libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libyajl-dev \
go-md2man libtool autoconf python3 automake

Next, configure, build, and install a crun binary with WasmEdge support.

git clone https://github.com/containers/crun
cd crun
./autogen.sh
./configure --with-wasmedge
make
sudo make install