Skip to content

Commit 73df350

Browse files
authored
Merge pull request #568 from Mossaka/modify-readme2
docs: clarify how the binary works
2 parents 096d64b + 5bb1904 commit 73df350

File tree

1 file changed

+14
-42
lines changed

1 file changed

+14
-42
lines changed

README.md

+14-42
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
![runwasi logo light mode](./art/logo/runwasi_icon1.svg#gh-light-mode-only)
22
![runwasi logo dark mode](./art/logo/runwasi_icon3.svg#gh-dark-mode-only)
33

4-
## runwasi
4+
# runwasi
55

66
> Warning: Alpha quality software, do not use in production.
77
88
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.
99
It is intended to be a (rust) library that you can take and integrate with your wasm host.
1010
Included in the repository is a PoC for running a plain wasi host (ie. no extra host functions except to support wasi system calls).
1111

12-
### Community
12+
## Community
1313

1414
- If you haven't joined the CNCF slack yet, you can do so [here](https://slack.cncf.io/).
1515
- Come join us on our [slack channel #runwasi](https://cloud-native.slack.com/archives/C04LTPB6Z0V)
1616
on the CNCF slack.
1717
- 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)
1818

19-
### Usage
19+
## Usage
2020

2121
runwasi is intended to be consumed as a library to be linked to from your own wasm host implementation.
2222

@@ -158,9 +158,12 @@ You can use the provided `containerd-shim-myshim-v1` binary as the shim to speci
158158

159159
Shared mode requires precise control over real threads and as such should not be used with an async runtime.
160160

161-
### Examples
161+
Check out these projects that build on top of runwasi:
162+
- [spinkube/containerd-shim-spin](https://github.com/spinkube/containerd-shim-spin)
163+
- [deislabs/containerd-wasm-shims](https://github.com/deislabs/containerd-wasm-shims)
162164

163-
#### Components
165+
166+
### Components
164167

165168
- **containerd-shim-[ wasmedge | wasmtime | wasmer ]-v1**
166169

@@ -204,28 +207,18 @@ make build
204207
sudo make install
205208
```
206209

210+
> 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+
207212
Build the test image and load it into containerd:
208213

209214
```
210215
make test-image
211216
make load
212217
```
213218

214-
#### Demo 1 using wasmedge
219+
### Demo 1 using container image that contains a Wasm module.
215220

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:
229222

230223
```terminal
231224
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...
243236
(...)
244237
```
245238

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`.
268240

269241
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.
270242

271-
#### Demo 4 using OCI Images with custom WASM layers
243+
### Demo 2 using OCI Images with custom WASM layers
272244

273245
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)
274246

0 commit comments

Comments
 (0)