You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+14-42
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1

2
2

3
3
4
-
##runwasi
4
+
# runwasi
5
5
6
6
> Warning: Alpha quality software, do not use in production.
7
7
8
8
This is a project to facilitate running wasm workloads managed by containerd either directly (ie. through ctr) or as directed by Kubelet via the CRI plugin.
9
9
It is intended to be a (rust) library that you can take and integrate with your wasm host.
10
10
Included in the repository is a PoC for running a plain wasi host (ie. no extra host functions except to support wasi system calls).
11
11
12
-
###Community
12
+
## Community
13
13
14
14
- If you haven't joined the CNCF slack yet, you can do so [here](https://slack.cncf.io/).
15
15
- Come join us on our [slack channel #runwasi](https://cloud-native.slack.com/archives/C04LTPB6Z0V)
16
16
on the CNCF slack.
17
17
- Public Community Call on Tuesdays every other week at 9:00 AM PT: [Zoom](https://zoom.us/my/containerd?pwd=bENmREpnSGRNRXdBZWV5UG8wbU1oUT09), [Meeting Notes](https://docs.google.com/document/d/1aOJ-O7fgMyRowHD0kOoA2Z_4d19NyAvvdqOkZO3Su_M/edit?usp=sharing)
18
18
19
-
###Usage
19
+
## Usage
20
20
21
21
runwasi is intended to be consumed as a library to be linked to from your own wasm host implementation.
22
22
@@ -158,9 +158,12 @@ You can use the provided `containerd-shim-myshim-v1` binary as the shim to speci
158
158
159
159
Shared mode requires precise control over real threads and as such should not be used with an async runtime.
160
160
161
-
### Examples
161
+
Check out these projects that build on top of runwasi:
> Note: `make build` will only build one binary. The `make install` command copies the binary to $PATH and uses symlinks to create all the component described above.
211
+
207
212
Build the test image and load it into containerd:
208
213
209
214
```
210
215
make test-image
211
216
make load
212
217
```
213
218
214
-
####Demo 1 using wasmedge
219
+
### Demo 1 using container image that contains a Wasm module.
215
220
216
-
Run it with `sudo ctr run --rm --runtime=io.containerd.[ wasmedge | wasmtime ].v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello'`. You should see some output repeated like:
217
-
218
-
```terminal
219
-
sudo ctr run --rm --runtime=io.containerd.wasmedge.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello'
220
-
221
-
hello
222
-
exiting
223
-
```
224
-
225
-
#### Demo 2 using wasmtime
226
-
227
-
Run it with `sudo ctr run --rm --runtime=io.containerd.[ wasmedge | wasmtime ].v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm`.
228
-
You should see some output repeated like:
221
+
Run it with `sudo ctr run --rm --runtime=io.containerd.[ wasmedge | wasmtime | wasmer ].v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello'`. You should see some output repeated like:
229
222
230
223
```terminal
231
224
sudo ctr run --rm --runtime=io.containerd.wasmtime.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm
@@ -243,32 +236,11 @@ So they'll continue singing it forever just because...
243
236
(...)
244
237
```
245
238
246
-
#### Demo 3 using wasmer
247
-
248
-
Run it with `sudo ctr run --rm --runtime=io.containerd.[ wasmedge | wasmtime | wasmer ].v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm`.
249
-
You should see some output repeated like:
250
-
251
-
```terminal
252
-
sudo ctr run --rm --runtime=io.containerd.wasmer.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm
253
-
254
-
This is a song that never ends.
255
-
Yes, it goes on and on my friends.
256
-
Some people started singing it not knowing what it was,
257
-
So they'll continue singing it forever just because...
258
-
259
-
This is a song that never ends.
260
-
Yes, it goes on and on my friends.
261
-
Some people started singing it not knowing what it was,
262
-
So they'll continue singing it forever just because...
263
-
264
-
(...)
265
-
```
266
-
267
-
To kill the process from demo 2, you can run in other session: `sudo ctr task kill -s SIGKILL testwasm`.
239
+
To kill the process, you can run in other session: `sudo ctr task kill -s SIGKILL testwasm`.
268
240
269
241
The test binary supports commands for different type of functionality, check [crates/wasi-demo-app/src/main.rs](crates/wasi-demo-app/src/main.rs) to try it out.
270
242
271
-
####Demo 4 using OCI Images with custom WASM layers
243
+
### Demo 2 using OCI Images with custom WASM layers
272
244
273
245
The previous demos run with an OCI Container image containing the wasm module in the file system. Another option is to provide a cross-platform OCI Image that that will not have the wasm module or components in the file system of the container that wraps the wasmtime/wasmedge process. This OCI Image with custom WASM layers can be run across any platform and provides for de-duplication in the Containerd content store among other benefits. To build OCI images using your own images you can use the [oci-tar-builder](./crates/oci-tar-builder/README.md)
0 commit comments