The of-watchdog implements an HTTP server listening on port 8080, and acts as a reverse proxy for running functions and microservices. It can be used independently, or as the entrypoint for a container with OpenFaaS.
This version can run webassembly with wasmer-gpu
implemented in rust
.
The behavior is same as of-watchdog
, and add the mode wasm
to support new feature.
Wasm Mode (mode=wasm) (default)
Running WebAssembly instance in thread pool, a function is served as a thread in process.
-
Compute resource isolation
- CPU: now only use one thead in thread pool to run functions.
- Memory: strong memory isolation. todo: 64bit memory support
- GPU: now it can use cuda. todo: resource limitation
-
FileSystem
- use
wasm_root
as file system root for webassembly likingchroot
. - when multi webassembly instances access the same file in
wasm_root
, we use thecopy on write
strategy likingfork
- use
-
Network
- pending
Configuration
For the full configuration you can see in watchdog
The extra environment variable for wasm
mode:
key | description | default |
---|---|---|
wasm_root |
The file system root for webassembly instance | / |
use_cuda |
If enable cuda support | false |
min_scale |
min replicas for function instances, also is the init replicas | 1 |
max_scale |
max replicas for function instances | 4096 |
wasm_c_target |
(compiler feature only) compile target |
host target |
wasm_c_cpu_features |
(compiler feature only) compile target cpu features |
host default |
example
You can download some example wasm module file in wasm-cuda-simple-examples
Then run:
fprocess=/wasm_root/bin/device use_cuda=true ./watchdog
Status:
mode | status |
---|---|
"streaming" | |
"serializing" | |
"http" | |
"static" | |
"wasm" |