Starbase Worker Binary Responsibilities¶
The Worker binary handles all asynchronous, long-running background jobs:
- Build orchestration — Picks up build jobs from queue, calls Starforge (BuildService port) to submit build to Depot SaaS, streams build logs to ClickHouse as they arrive, polls for completion, updates desired state when image is ready
- Cluster provisioning — Creates new DOKS clusters via DO API (takes 5–15 minutes), installs Envoy Gateway, Fluent Bit, vmagent, Grafana Alloy, Shuttle via Helm/manifests, registers cluster as active
- Database provisioning — Creates DO Managed Postgres instances, configures connection pools, injects connection strings into desired state
- Billing aggregation — Monthly cron that queries Postgres for running totals, generates Stripe invoices, handles proration for mid-month changes
- Cleanup jobs — Removes orphaned resources, suspends services for failed payments, deletes data for cancelled accounts after grace period
Job queue
Postgres table for MVP (simple INSERT to enqueue, SELECT ... FOR UPDATE SKIP LOCKED to
dequeue). Migrate to RabbitMQ when job volume justifies it.
Cross-references
The sync counterpart → §13 · the build pipeline this binary drives → Starforge §16 · build logs → ClickHouse → Starforge §16.6 · billing roll-up → Billing §36 · the desired state a finished build updates → §32.