Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/second-state/runw


https://github.com/second-state/runw

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# 简介

**RUNW** 是一个 OCI 兼容的运行时,用于在容器环境中运行 WASI 启用的 WebAssembly 文件。我们会示范如何使用 CRI-0 工具。

# 开始

## 先决条件

请安装以下容器管理工具。

* [cri-o](https://cri-o.io/)
* [crictl](https://github.com/kubernetes-sigs/cri-tools)
* [containernetworking-plugins](https://github.com/containernetworking/plugins)
* Optional [buildah](https://github.com/containers/buildah) or [docker](https://github.com/docker/cli) for building container image

## 使用 pre-built runw

### 环境

我们预先构建的二进制文件是基于“ubuntu 20.04”的,它有以下依赖项:

* libLLVM-10

你需要使用以下方法安装依赖项:

```bash
sudo apt install -y \
llvm-10-dev \
liblld-10-dev
```

### 从发布页面获得预先构建的 runw

```bash
wget https://github.com/second-state/runw/releases/download/0.1.1/runw
```

> 如果你没有使用 Ubuntu 20.04,你需要构建自己的 RUNW 二进制文件。按照附录中的说明操作。

## 安装 runw 到 cri-o

```bash
# 获得 wasm-pause 实用程序
sudo crictl pull docker.io/beststeve/wasm-pause

# 安装 runw 到 cri-o
sudo cp -v runw /usr/lib/cri-o-runc/sbin/runw
sudo chmod +x /usr/lib/cri-o-runc/sbin/runw
sudo sed -i -e 's@default_runtime = "runc"@default_runtime = "runw"@' /etc/crio/crio.conf
sudo sed -i -e 's@pause_image = "k8s.gcr.io/pause:3.2"@pause_image = "docker.io/beststeve/wasm-pause"@' /etc/crio/crio.conf
sudo sed -i -e 's@pause_command = "/pause"@pause_command = "pause.wasm"@' /etc/crio/crio.conf
sudo tee -a /etc/crio/crio.conf.d/01-crio-runc.conf <:/root/runw \
secondstate/runw:latest
(docker)$ cd /root/runw
(docker)$ mkdir -p build && cd build
(docker)$ cmake -DCMAKE_BUILD_TYPE=Release .. && make -j
(docker)$ exit
```