mini-lambda is a lightweight, Rust-powered serverless compute platform for running WebAssembly in distributed sandboxed worker processes.
In development! I'm always developing and adding new features, so this README might be outdated.
- Serverless execution: Run uploaded WebAssembly modules in a sandboxed environment.
- Low latency: Ahead-of-time compilation and caching to target sub-50ms cold start times.
- Distributed orchestration: Workers dynamically register and receive jobs from an orchestrator.
- Secure runtime: Sandbox isolation with restricted capabilities.
- Scalable design: Architecture designed to scale horizontally across 100+ distributed nodes.
Prereqs: Rust, cargo.
-
Start the orchestrator (choose bind address):
cargo run -p mini-lambda-orchestrator -- --bind 127.0.0.1:8080
-
Start one or more workers (each binds to an OS assigned port and registers with the orchestrator):
cargo run -p mini-lambda-worker -- --orchestrator 127.0.0.1:8080
-
Submit WASM jobs from the client:
cargo run -p mini-lambda-client -- crates/client/test-wasm/test-wasm.wasm
- By default the client contacts
http://127.0.0.1:8080(the default orchestrator). See CLI options below.
- By default the client contacts
-
Orchestrator
--bind <ADDR:PORT>(default:127.0.0.1:8080)- Example:
cargo run -p mini-lambda-orchestrator -- --bind 0.0.0.0:8080
- Example:
-
Worker
--orchestrator <ORCH_URL>(required)- Examples:
cargo run -p mini-lambda-worker -- --orchestrator 127.0.0.1:8080cargo run -p mini-lambda-worker -- --orchestrator http://127.0.0.1:8080
- Examples:
-
Client
- Positional: path to
.wasmfile --server <ORCHESTRATOR_URL>(default:http://127.0.0.1:8080)- Example:
cargo run -p mini-lambda-client -- test-wasm/test-wasm.wasm --server http://127.0.0.1:8080
- Example:
- Positional: path to
There are a few small unit tests included in the most stable pieces of the codebase (so far):
- Orchestrator: tests for WorkerRegistry (register, pick_and_increment, update_queue, unregister).
- Worker: tests for ModuleCache (LRU bheavior) and QueueTicket (RAII counter behavior).
Note: most of the CLI and networking code is still evolving, so tests currently focus on these more stable parts for now.
Run tests:
- All workspace tests:
cargo test
