{"id":30126634,"url":"https://github.com/philippgackstatter/wow","last_synced_at":"2025-08-10T16:52:20.315Z","repository":{"id":37911426,"uuid":"311751156","full_name":"PhilippGackstatter/wow","owner":"PhilippGackstatter","description":"A WebAssembly container runtime for the Apache OpenWhisk serverless platform","archived":false,"fork":false,"pushed_at":"2022-07-10T08:50:40.000Z","size":183,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-06T01:28:44.336Z","etag":null,"topics":["openwhisk","rust","serverless","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilippGackstatter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-10T18:34:39.000Z","updated_at":"2023-02-04T20:00:30.000Z","dependencies_parsed_at":"2022-07-11T23:33:43.667Z","dependency_job_id":null,"html_url":"https://github.com/PhilippGackstatter/wow","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/PhilippGackstatter/wow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippGackstatter%2Fwow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippGackstatter%2Fwow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippGackstatter%2Fwow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippGackstatter%2Fwow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilippGackstatter","download_url":"https://codeload.github.com/PhilippGackstatter/wow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippGackstatter%2Fwow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269756365,"owners_count":24470560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openwhisk","rust","serverless","wasm"],"created_at":"2025-08-10T16:51:30.454Z","updated_at":"2025-08-10T16:52:20.270Z","avatar_url":"https://github.com/PhilippGackstatter.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eWebAssembly-flavored OpenWhisk\u003c/h1\u003e\n\n\u003cstrong\u003eA WebAssembly-based container runtime for the Apache OpenWhisk serverless platform.\u003c/strong\u003e\n\n\u003c/div\u003e\n\n## Why?\n\nThe cold start problem is well-known in serverless platforms. The first invocation of a function requires provisioning all the resources necessary for its execution. Typically that means starting a docker container, i.e. a `node.js` container to then inject some JavaScript code for execution. This process can take hundreds of milliseconds and is thus unacceptable for latency-critical tasks. This project is an evaluation of using WebAssembly instead of Docker containers to implement serverless functions. The simple idea is that WebAssembly is a lighter-weight sandboxing mechanism so the cold start latency should be much smaller. It builds on top of [`Apache OpenWhisk`](https://github.com/apache/openwhisk) as the serverless platform. There are three repositories relevant to this:\n\n- This repository, which implements the WebAssembly-based container runtime.\n- The [OpenWhisk fork](https://github.com/PhilippGackstatter/openwhisk/tree/invoker-wasm) that implements the runtimes support on the OpenWhisk side\n- The [diploma thesis](https://github.com/PhilippGackstatter/diploma-thesis/) repository, which contains the thesis describing the motivation, background, design and evaluation of this idea.\n\n## Crates Overview\n\nThe project is split into multiple crates, which are:\n\n- `ow-common` contains common types such as the `WasmRuntime` trait or types that represent OpenWhisk payloads.\n- `ow-executor` implements the actual container runtime and the OpenWhisk runtime protocol.\n- `ow-wamr` implements the `WasmRuntime` trait for the [WebAssembly Micro Runtime](https://github.com/bytecodealliance/wasm-micro-runtime/).\n- `ow-wasmer` implements the `WasmRuntime` trait for [Wasmer](https://github.com/wasmerio/wasmer).\n- `ow-wasmtime` implements the `WasmRuntime` trait for [Wasmtime](https://github.com/bytecodealliance/wasmtime).\n- `ow-wasm-action` contains abstractions for building WebAssembly serverless functions (\"actions\" in jOpenWhisk terminology) and has a number of example actions.\n- `ow-wasmtime-precompiler` implements Ahead-of-Time compilation for `wasmtime` (which is part of the runtime as of version `0.26`), making this crate obsolete once `ow-wasmtime` is migrated to that version.\n- `ow-evaluation` contains some tests used for evaluating the performance of the system, such as concurrency tests and cold start tests.\n\n## Tutorial with Wasmtime\n\nAs a small tutorial, let's build the wasmtime executor and run one of the examples.\n\n1. To build the executor with wasmtime run the following command from the root of this repository:\n\n```sh\ncargo build --manifest-path ./ow-executor/Cargo.toml --release --features wasmtime_rt\n```\n\n2. Next we build the `add` example for the `wasm32-wasi` target with:\n\n```sh\ncargo build --manifest-path ./ow-wasm-action/Cargo.toml --release --example add --target wasm32-wasi --no-default-features --features wasm\n\n# Optional step to optimize the compiled Wasm if `wasm-opt` is installed\n# On Ubuntu it can be installed with `sudo apt install binaryen`\nwasm-opt -O4 -o ./target/wasm32-wasi/release/examples/add.wasm ./target/wasm32-wasi/release/examples/add.wasm\n```\n\n3. Precompile the example for efficient execution with wasmtime:\n\n```sh\ncargo run --manifest-path ./ow-wasmtime-precompiler/Cargo.toml --release --bin wasmtime ./target/wasm32-wasi/release/examples/add.wasm\n```\n\n4. Install wsk-cli from https://github.com/apache/openwhisk-cli/releases/tag/1.2.0\n\n5. Clone the openwhisk repo, checkout the appropriate branch and run OpenWhisk in a separate terminal:\n\n```sh\ngit clone git@github.com:PhilippGackstatter/openwhisk.git\ngit checkout invoker-wasm\n./gradlew core:standalone:bootRun\n```\n\nThis will print something like the following:\n\n```\n[ WARN  ] Configure wsk via below command to connect to this server as [guest]\n\nwsk property set --apihost 'http://172.17.0.1:3233' --auth '23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP'\n```\n\nExecute this command.\n\n6. Run the executor in a separate terminal. OpenWhisk will forward execution requests for Wasm to it:\n\n```sh\n./target/release/executor\n```\n\n7. Upload the example zip to OpenWhisk:\n\n```sh\nwsk action create --kind wasm:0.1 add ./target/wasm32-wasi/release/examples/add-wasmtime.zip\n```\n\n8. Run the action. We need to provide the correct parameters for this action, which are defined in our action source file `ow-wasm-action/examples/add.rs`. Let's see what the result of `2+2` is:\n\n```sh\nwsk action invoke --blocking add --param param1 2 --param param2 2\n```\n\nwhich prints:\n\n```json\n{\n  \"activationId\": \"b67ca8877a494fcdbca8877a494fcd73\",\n  \"annotations\": [\n    {\n      \"key\": \"path\",\n      \"value\": \"guest/add\"\n    },\n    {\n      \"key\": \"waitTime\",\n      \"value\": 23\n    },\n    {\n      \"key\": \"kind\",\n      \"value\": \"wasm:0.1\"\n    },\n    {\n      \"key\": \"timeout\",\n      \"value\": false\n    },\n    {\n      \"key\": \"limits\",\n      \"value\": {\n        \"concurrency\": 1,\n        \"logs\": 10,\n        \"memory\": 256,\n        \"timeout\": 60000\n      }\n    },\n    {\n      \"key\": \"initTime\",\n      \"value\": 3\n    }\n  ],\n  \"duration\": 5,\n  \"end\": 1655918974484,\n  \"logs\": [],\n  \"name\": \"add\",\n  \"namespace\": \"guest\",\n  \"publish\": false,\n  \"response\": {\n    \"result\": {\n      \"result\": {\n        \"result\": 4\n      },\n      \"status\": \"success\",\n      \"status_code\": 0,\n      \"success\": true\n    },\n    \"size\": 73,\n    \"status\": \"success\",\n    \"success\": true\n  },\n  \"start\": 1655918974479,\n  \"subject\": \"guest\",\n  \"version\": \"0.0.1\"\n}\n```\n\nAnd we get `4` as a result. And that's it, we've run a serverless function with WebAssembly! Try running one of the other examples in `ow-wasm-action/examples/`, the appropriate compilation commands and features can be found in the `justfile`.\n\n## Building\n\nWe can also use [just](https://github.com/casey/just) to make building a bit easier. The recipes are defined in the `justfile`. If you don't want to install this tool, you can copy the commands from there into your terminal.\n\nThe `just` commands generally run operations for all three runtimes, but if not all tools for all Wasm runtimes are installed, some of the steps can be skipped.\n\nTo build the `executor` with the `wasmtime` runtime, run `just build-amd64 wasmtime_rt`. Other possible values for the runtime argument are `wasmer_rt` and `wamr_rt` to use `wasmer` or `wamr` respectively.\n\nTo build example actions use `just build-wasm-examples`. This requires binaryen's `wasm-opt` to be present in your `PATH`, which optimizes the produced wasm. For convenience you can also skip this part. To precompile the examples use `just precompile`, which requires `wasmer` and `wamrc` to be installed or in your `PATH`. Of course only one of the precompilation steps is necessary to run a given module for a certain runtime, so you can skip some of these steps as well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippgackstatter%2Fwow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilippgackstatter%2Fwow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippgackstatter%2Fwow/lists"}