Remote Worker Staging
This guide runs StacyVM as two local processes: one control plane and one remote worker. Use the mock provider first so you can verify worker registration, remote spawn, remote status refresh, remote exec, and remote destroy before introducing Docker, Firecracker, or a real network boundary. Remote worker mode can use a shared worker token for internal staging, per-worker static tokens for migration, or signed worker tokens for production-aligned staging. It is not the full enterprise production target yet because SQLite store semantics are still single-node oriented.Prerequisites
- Built
stacyvmbinary. - One terminal for
stacyvm serve. - One terminal for
stacyvm worker. - A random worker token shared by both processes, a per-worker token configured under
auth.worker_tokens, or a signed-token setup usingauth.worker_signing_key.
Control Plane Config
Createcontrol-plane.yaml:
Worker Config
Createworker.yaml:
Smoke Flow
List workers:worker-a once its heartbeat is fresh:
local, and the scheduler prefers a fresh eligible local worker. Removing that transient registry record forces the next spawn to exercise worker-a.
Expected response fields:
worker.status:
worker.exec and records a normal control-plane exec log:
worker.exec_stream and forwards live stdout/stderr chunks through the normal API streaming response:
worker.logs:
worker.destroy, updates state, and releases the lease:
Automated Smoke Script
You can run the same flow with:worker-a, and destroys it.
Current Limits
- Remote non-streaming exec is routed to remote workers.
- Remote streaming exec is routed through live NDJSON worker RPC responses.
- Remote file APIs are routed to remote workers.
- Remote logs are routed to remote workers.
- Remote preview URL metadata is routed from worker heartbeat capacity. The actual preview ingress still depends on the worker/provider ingress setup, such as Docker plus Traefik on the worker host.
- Shared worker auth is suitable for local/internal staging only. Production-aligned workers should use signed worker identity, secret-file inputs, worker identity certification output, and mTLS when worker RPC crosses a host or network boundary.
- SQLite remains a staging/single-node store. Enterprise multi-worker mode still needs Postgres-grade lease semantics.
- Worker shutdown enters drain mode and rejects new spawns. Fresh draining workers keep existing sandbox ownership; stale/offline remote owners are marked
unhealthy, and expired remote-owned sandboxes becomeexpiredwith their lease released.

