Skip to content

Commit

Permalink
feat: bump wws to 0.6.0. Ensure latest container is built too
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelmmiguel committed Dec 1, 2022
1 parent 5b4ca6d commit be99d39
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ jobs:
file: image/Prebuilt.dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wasm-workers-server"
description = "Wasm Workers Server is a blazing-fast self-contained server that routes HTTP requests to workers in your filesystem. Everything run in a WebAssembly sandbox"
version = "0.5.1"
version = "0.6.0"
edition = "2021"
license = "Apache-2.0"
homepage = "https://workers.wasmlabs.dev/"
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Arguments:
Options:
--host <HOSTNAME> Hostname to initiate the server [default: 127.0.0.1]
-p, --port <PORT> Port to initiate the server [default: 8080]
--prefix <PREFIX> Prepend the given path to all URLs [default: ]
-h, --help Print help information
-V, --version Print version information
```
Expand Down Expand Up @@ -75,17 +76,17 @@ curl https://raw.githubusercontent.com/vmware-labs/wasm-workers-server/main/inst

### Running in a container

If you don't want to install anything locally you can just run `wws` from the `projects.registry.vmware.com/wasmlabs/containers/wasm-workers-server:latest` container image. All you need to do is:
If you don't want to install anything locally you can just run `wws` from the `ghcr.io/vmware-labs/wws:latest` container image. All you need to do is:

- Map a local folder with workers to `/app` within the container
- Expose port `8080` from the container

Here is how to quickly run a container with an ad-hoc worker from the /tmp/wws-app folder:
Here is how to quickly run a container with an ad-hoc worker from the `/tmp/wws-app` folder:

```bash
mkdir /tmp/wws-app 2>/dev/null;
echo 'addEventListener("fetch", (e) => { return e.respondWith(new Response("Hello from WWS\n"));});' > /tmp/wws-app/index.js;
docker run --rm -v /tmp/wws-app:/app -p 8080:8080 projects.registry.vmware.com/wasmlabs/containers/wasm-workers-server:latest
docker run --rm -v /tmp/wws-app:/app -p 8080:8080 ghcr.io/vmware-labs/wws:latest
```
## Language Support

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ sidebar_position: 3

# Running in a container

For convenience we have published a container image that contains Wasm Workers Server. It is available at `projects.registry.vmware.com/wasmlabs/containers/wasm-workers-server:latest`. Any container that runs it will get the `wws` binary, running and:
For convenience we have published a container image that contains Wasm Workers Server. It is available at `ghcr.io/vmware-labs/wws:latest`. Any container that runs it will get the `wws` binary, running and:

- Looking for workers in the `/app` folder
- Listening on `0.0.0.0:8080` inside the container

The image is based on `debian:bullseye-slim` + the `wws` binary. It includes support for the `linux/amd64` and `linux/arm64/v8` platforms. The image size should be around `~100MiB`
The image is built from `scratch`. It only includes the `wws` binary. The container supports multiple architectures: `linux/amd64` and `linux/arm64` platforms. The image size is just `27MiB`.

## Running a local container

A typical one-liner to run a local container for development purposes would look like:

```bash
docker run -v /path/to/workers/on/host:/app -p 8080:8080 \
projects.registry.vmware.com/wasmlabs/containers/wasm-workers-server:latest
ghcr.io/vmware-labs/wws:latest
```

## Other usages
Expand Down
30 changes: 15 additions & 15 deletions examples/pdf-create/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/rust-basic/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/rust-kv/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kits/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-workers-rs"
version = "0.1.0"
version = "0.6.0"
edition = "2021"
license = "Apache-2.0"
homepage = "https://workers.wasmlabs.dev/"
Expand Down
2 changes: 1 addition & 1 deletion kits/rust/worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "worker"
version = "0.1.0"
version = "0.6.0"
edition = "2021"
license = "Apache-2.0"
homepage = "https://workers.wasmlabs.dev/"
Expand Down

0 comments on commit be99d39

Please sign in to comment.