Skip to content

Commit 27dd3ed

Browse files
committed
Update README.md
1 parent 141a128 commit 27dd3ed

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,45 @@
55
An example project showing how to build an HTTP server for WASI 0.2 built in
66
Rust.
77

8+
## Installation
9+
10+
The easiest way to try this project is by opening it in a GitHub Codespace. This
11+
will create a VS Code instance with all dependencies installed. If instead you
12+
would prefer to run this locally, you can run the following commands:
13+
14+
```bash
15+
$ curl https://wasmtime.dev/install.sh -sSf | bash # install wasm runtime
16+
$ cargo install cargo-component # install build tooling
17+
$ cargo install wkg # install wasm OCI tooling
18+
```
19+
20+
## Local Development
21+
22+
The HTTP server uses the `wasi:http/proxy` world. You can run it locally in a
23+
`wasmtime` instance by using the following [cargo-component] command:
24+
25+
```rust
26+
$ cargo component run
27+
```
28+
29+
## Working with deployment artifacts
30+
31+
This project automatically published compiled Wasm Components as OCI to GitHub
32+
Artifacts. You can pull the artifact with any OCI-compliant tooling and run it
33+
in any Wasm runtime that supports the `wasi:http/proxy` world. To fetch the
34+
latest published version from GitHub releases and run it in a local `wasmtime`
35+
instance you can run the following command:
36+
37+
```bash
38+
$ wkg pull ghcr.io/yoshuawuyts/rust-wasi-hello:latest
39+
$ wasmtime serve rust-wasi-hello.wasm
40+
```
41+
42+
For production workloads however, you may want to use other runtimes or
43+
integrations which provide their own OCI integrations. Deployment will vary
44+
depending on you providers, though at their core they will tend to be variations
45+
on the pull + serve pattern we've shown here.
46+
847
## Roadmap
948

1049
- [x] Get a base version compiling
@@ -16,7 +55,11 @@ Rust.
1655
- [ ] Automatically publish a package on GitHub Release
1756
- [ ] Add a load-testing example
1857
- [ ] Upstream and integrate `scripts/` into their respective packages
58+
- [ ] Add deploy remote artifact
59+
- [ ] Show wkg pull and run locally
1960

2061
## License
2162

2263
MIT OR Apache-2.0
64+
65+
[cargo-component]: https://github.com/bytecodealliance/cargo-component

0 commit comments

Comments
 (0)