Omnia Wasm Runtime
The Omnia Wasm runtime provides a thin wrapper around wasmtime for ergonomic integration of host-based services for WASI components.
It allows you to declaratively assemble a runtime that provides specific capabilities (like HTTP, Key-Value, Messaging) to guest components, backed by real host implementations.
Quick Start
Use the runtime! macro to configure which WASI interfaces and backends your host runtime needs. This generates a runtime_run function that handles the entire lifecycle.
use runtime;
use WasiHttpCtx;
use KeyValueDefault;
use DefaultOtel;
// Define the runtime with required capabilities
runtime!;
async
Core Traits
The runtime is built around a set of traits that allow services to be plugged in:
| Trait | Purpose |
|---|---|
Host<T> |
Links a WASI interface (e.g., wasi:http) into the wasmtime::Linker. |
Server<S> |
Starts a server (e.g., HTTP listener, NATS subscriber) to handle incoming requests. |
Backend |
Connects to an external service (e.g., Redis, Postgres) during startup. |
State |
Manages per-request state and provides access to the component instance. |
FromEnv |
Configures backend connections from environment variables. |
Features
jit(default): Enables Cranelift JIT compilation, allowing you to run.wasmfiles directly. Disable this to only support pre-compiled.bincomponents (useful for faster startup in production).
Configuration
The runtime and its included services are configured via environment variables:
RUST_LOG: Controls logging verbosity (e.g.,info,debug,omnia=trace).OTEL_GRPC_URL: Endpoint for OpenTelemetry collector (ifomnia-otelis used).
Architecture
See the workspace documentation for the full architecture guide and list of available WASI interface crates.
License
MIT OR Apache-2.0