Repository navigation
warpline 0.2.0
warpline-core is now embeddable: hold a Runtime, publish components and
invoke them from your own app. See examples/storefront for a complete
reference integration.
Added
warpline_core::Runtime(withRuntimeConfigandRuntimeBuilder):
stage,activate,activate_digest,deactivate,active,publish,invokeandgc
behind one cheap-to-clone handle that owns the component cache and epoch
ticker. TypedInvokeError,PublishErrorandError;InvokeError
hashttp_status().- Admission control: a memory-weighted admission budget (503 when it cannot
admit an invocation), a per-tenant in-flight limit (429 when the tenant is
busy), an output size cap (502) and cancellation-safe metering.
Runtime::invokere-validates the limits it is given
(InvokeError::InvalidLimits, 400). warpline_core::pg(cargo featurepostgres, on by default):migrate,
connect,Authenticator(per-instance auth cache), tenant admin
(create_tenant,patch_tenant,tenant_limits,LimitsPatch; the control plane's
PATCH behaviour is unchanged, now a library function), a usage
summary and a batching, retryingPgMeter. Auth lookups time out after
2 s; if Postgres is down, cached entries are served stale for up to
max(10 x TTL, 5 min), otherwise the lookup fails (host and control
answer 503).Usage,MeterSinkand
Limitslive at the crate root.- Metric
warpline_meter_dropped_total;PgMeterwarns when metering
events are dropped. warpline-hostcargo featureembed-control(default on) gating the
warpline-controldependency andWARPLINE_EMBED_CONTROL.examples/storefront: an axum app embedding warpline-core, a Rust
wasm32-wasip2checkout hook, a fraud-service mock, docker compose, a
demo.shwalkthrough and an end-to-end test.- CI job for the example (including a live demo run), release workflow
publishing via crates.io trusted publishing, Dependabot.
Changed (breaking)
- Postgres schema. Everything now lives in a dedicated
warpline
schema, created by a single squashed migration. Data from 0.1 inpublic
is not migrated: start fresh, or copy the tenants and API keys across
manually. - Migrations are explicit. Nothing migrates implicitly any more; call
warpline_core::pg::migrate(&pool)at startup. The host and control
binaries do it for you. - Embedding API.
Runtimereplaces the free functions. The component
cache, registry, sandbox andHostCtxare private; onlywarpline_core::digest
stays public. Public structs and enums that may grow are#[non_exhaustive]. KvStore::getis fallible (returns aResult), so a store outage is
no longer indistinguishable from a missing key.- New HTTP status codes from the invoke path: 503 (overloaded), 429
(tenant busy) and 502 (guest output too large), in addition to the
existing mapping. Clients that only handled the old set should treat them
as retryable (503, 429) or as a guest error (502). cpu_uscounts epoch ticks (ticks x 1 ms) rather than wall-derived
microseconds. A 1 ms budget gets an extra tick plus a bounded
instantiation grace.warpline-hostdepends onwarpline-controlonly behind the
embed-controlfeature. Library users who disable default features lose
WARPLINE_EMBED_CONTROL.- Environment variables. Empty values now count as unset, and an
unparsableWARPLINE_AUTH_CACHE_TTL_SECSmakes the binary refuse to start
instead of silently using the default. - Auth caches are per
Authenticator, not process-global.
Fixed
- Registry: GC no longer misbehaves on unreadable pointers, a read-only
cwasm directory is tolerated, and re-uploading a module bumps its mtime so
GC keeps it.PublishError::Registryreports storage failures accurately. - Cold cache misses load the on-disk cwasm before queueing for a compile
permit, take the permit asynchronously (no deadlock on a small blocking
pool), and recompiles are gated on the compile semaphore. - CPU budget: exact tick accounting (no off-by-one), and at most the
instantiation grace is forgiven when starting the call budget; guest start
functions that loop are now covered by tests. - Control: the pointer is activated inside the quota transaction and
restored (or removed) if the commit fails, and reconciled under the lock;
lock waits for publish and reconcile are bounded; uploads survive client
disconnects;activate_digestvalidates its input; a cached tenant that
was deleted now yields 401; graceful shutdown. - Host: the embedded control task is awaited with a timeout on shutdown, the
metrics recorder is installed first, andmetrics_handle()no longer
panics if a recorder already exists. IssuedKeyredacts the API key in itsDebugoutput;Debugimpls added
for public types.- Documentation errors in the README, PROGRESS and doc comments (caps, env
and status tables).
Removed
- The free-function invoke API and public access to the cache, registry and
sandbox internals (useRuntime). - The core
auth.rsmodule and the Postgres metering inmeter.rs(now
pg::Authenticatorandpg::PgMeter) and the
process-global auth cache. - Unused dependencies in
warpline-hostandwarpline-control. - The separate second migration (squashed into
0001_warpline.sql).