Skip to content

Commit e571172

Browse files
Update the section about running a simple WASI app with runwasi (#214)
Signed-off-by: vincent <[email protected]>
1 parent 3703c09 commit e571172

File tree

2 files changed

+18
-68
lines changed
  • docs/develop/deploy/cri-runtime
  • i18n/zh/docusaurus-plugin-content-docs/current/develop/deploy/cri-runtime

2 files changed

+18
-68
lines changed

docs/develop/deploy/cri-runtime/containerd.md

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,28 @@ sidebar_position: 1
44

55
# Deploy with containerd's runwasi
66

7-
<!-- prettier-ignore -->
8-
:::info
9-
Work in Progress
10-
:::
11-
127
The containerd-shim [runwasi](https://github.com/containerd/runwasi/) project supports WasmEdge.
138

149
## Prerequisites
1510

1611
1. [Install Rust](https://www.rust-lang.org/tools/install) because we need to compile the runwasi project.
1712

18-
2. Install WasmEdge
19-
20-
Run the following command lines to install WasmEdge.
21-
13+
2. Download the runwasi project
2214
```bash
23-
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
24-
sudo -E sh -c 'echo "$HOME/.wasmedge/lib" > /etc/ld.so.conf.d/libwasmedge.conf'
25-
sudo ldconfig
15+
$ git clone https://github.com/containerd/runwasi.git
2616
```
2717

28-
3. Download the runwasi project and test
29-
30-
After that, run the following command line to download the runwasi project and test.
18+
3. Build and install the wasmedge-containerd-shim
3119

3220
```bash
33-
$ git clone https://github.com/second-state/runwasi.git
34-
$ cd runwasi
35-
$ cargo test -- --nocapture
36-
# the output should be the following connent.
37-
running 3 tests
38-
test instance::tests::test_maybe_open_stdio ... ok
39-
test instance::wasitest::test_delete_after_create ... ok
40-
test instance::wasitest::test_wasi ... ok
21+
cd runwasi
22+
make build-wasmedge
23+
INSTALL="sudo install" LN="sudo ln -sf" make install-wasmedge
4124
```
4225

43-
4. Build the wasmedge-containerd-shim
26+
## Run a simple Wasi app
4427

4528
```bash
46-
rustup default nightly
47-
make build FEATURES=wasmedge
48-
sudo make install RUNTIME=wasmedge
29+
make load
30+
sudo ctr run --rm --runtime=io.containerd.wasmedge.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello'
4931
```
50-
51-
## Run a simple Wasi app
52-
53-
<!-- prettier-ignore -->
54-
:::info
55-
Work in Progress
56-
:::

i18n/zh/docusaurus-plugin-content-docs/current/develop/deploy/cri-runtime/containerd.md

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,28 @@ sidebar_position: 1
44

55
# Deploy with containerd's runwasi
66

7-
<!-- prettier-ignore -->
8-
:::info
9-
Work in Progress
10-
:::
11-
127
The containerd-shim [runwasi](https://github.com/containerd/runwasi/) project supports WasmEdge.
138

149
## Prerequisites
1510

1611
1. [Install Rust](https://www.rust-lang.org/tools/install) because we need to compile the runwasi project.
1712

18-
2. Install WasmEdge
19-
20-
Run the following command lines to install WasmEdge.
21-
13+
2. Download the runwasi project
2214
```bash
23-
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
24-
sudo -E sh -c 'echo "$HOME/.wasmedge/lib" > /etc/ld.so.conf.d/libwasmedge.conf'
25-
sudo ldconfig
15+
$ git clone https://github.com/containerd/runwasi.git
2616
```
2717

28-
3. Download the runwasi project and test
29-
30-
After that, run the following command line to download the runwasi project and test.
18+
3. Build and install the wasmedge-containerd-shim
3119

3220
```bash
33-
$ git clone https://github.com/second-state/runwasi.git
34-
$ cd runwasi
35-
$ cargo test -- --nocapture
36-
# the output should be the following connent.
37-
running 3 tests
38-
test instance::tests::test_maybe_open_stdio ... ok
39-
test instance::wasitest::test_delete_after_create ... ok
40-
test instance::wasitest::test_wasi ... ok
21+
cd runwasi
22+
make build-wasmedge
23+
INSTALL="sudo install" LN="sudo ln -sf" make install-wasmedge
4124
```
4225

43-
4. Build the wasmedge-containerd-shim
26+
## Run a simple Wasi app
4427

4528
```bash
46-
rustup default nightly
47-
make build FEATURES=wasmedge
48-
sudo make install RUNTIME=wasmedge
29+
make load
30+
sudo ctr run --rm --runtime=io.containerd.wasmedge.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello'
4931
```
50-
51-
## Run a simple Wasi app
52-
53-
<!-- prettier-ignore -->
54-
:::info
55-
Work in Progress
56-
:::

0 commit comments

Comments
 (0)