feat: single-node Zopu runtime deployment for Debian

Lane D deliverable: reproducible execution-plane deployment on a fresh
Debian dedicated server (~12 cores, 40 GB RAM, single-node).

Artifacts:
- bootstrap.sh: Docker Engine, Bun, repo clone, build, systemd install,
  firewall (deny-by-default), optional Tailscale, disk monitor cron
- .env.template: all 8 environment groups documented (Convex, Gitea,
  model gateway, AgentOS/RivetKit, Zopu agent, daemon, Docker sandbox,
  service auth)
- systemd units: zopu-daemon, zopu-agent (both Restart=always),
  zopu-health timer (60s), zopu-docker-cleanup timer (daily)
- scripts: health-check, update, rollback, docker-cleanup, disk-monitor
- Caddyfile: optional reverse proxy (documentation-only by default)
- README.md: full runbook with start/stop/log/update/rollback/cleanup
  procedures, topology documentation, and boundary notes

Verified topology (from installed RivetKit source):
- registry.start() boots an in-process RivetKit engine (envoy mode) with
  a native Rust sidecar at http://localhost:6420 (DEFAULT_ENDPOINT in
  chunk-YDUQHING.js line 4751). createClient() connects back to it.
- No separate Rivet Engine process required for single-node operation.
- Linux x64 sidecar packages (@rivet-dev/agentos-sidecar-linux-x64-gnu)
  are available as optional dependencies.

Docker / Orb boundary:
- Docker Engine installed and zopu user in docker group.
- No Docker-backed sandbox code wired; Orb lane contract not yet landed.
- Volume pruning omitted from docker-cleanup.sh to protect durable data.

Validated: bash -n on all 6 shell scripts; mocked health-check smoke
(nc-based TCP probes, mocked systemctl/docker); systemd unit structural
checks. No JS/TS/agent files changed.
This commit is contained in:
-Puter
2026-07-24 20:44:47 +05:30
parent b5c40755cf
commit 8f0b915f4b
15 changed files with 1193 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
# Caddyfile — Minimal reverse proxy for the Zopu agent service.
#
# This is OPTIONAL. The agent service does not need to be publicly exposed
# for the execution plane to function. Use Caddy only when an HTTP endpoint
# is genuinely needed (e.g., a webhook ingress from Convex site functions).
#
# In the default single-node deployment, the agent listens on localhost:3583
# and is reachable over Tailscale. Install Caddy only if you need TLS
# termination or a public ingress point.
#
# --- Private/Tailscale deployment (recommended) ---
#
# Listen only on the Tailscale interface. Replace the hostname with your
# Tailscale machine name or IP.
#
# http://zopu-runtime.tail-xxxx.ts.net {
# reverse_proxy localhost:3583
# }
#
# --- Public deployment with automatic TLS (only if needed) ---
#
# agent.example.invalid {
# reverse_proxy localhost:3583
# }
# Default: do not ship an active Caddyfile. The file is documentation.