Go Backend & Bazel Runbooks¶
Assets / CDN cutover (library, music, models, sprites)¶
The assets Go service streams these four prefixes from the bucket. The
front door (Apache today, or the gateway) re-points one prefix at a time;
rollback is a one-line revert. The migration is independent of the Node→Go
gateway cutover.
Populate the bucket:
make assets-sync(after a frontend build, so generated library covers are included). Re-run on every deploy — it’s idempotent (mc mirroruploads only changed/new files).Deploy the assets service: it ships in the Go chart (
deploy/helm/rmhstudios-go, serviceassets, port 7007) via./deploy/deploy-go.sh production(single-node) orREGISTRY=… ./deploy/deploy-go.sh production(multi-node).Smoke-test directly (before routing public traffic):
curl -s -o /dev/null -w "%{http_code}\n" http://<assets-host>:7007/models/<known>.glband a Range request:curl -s -D- -o /dev/null -H 'Range: bytes=0-1023' http://<assets-host>:7007/music/<known>.mp3→ expect206+Content-Range.Cut over the smallest prefix first (
/models).Gateway front door: already routed (Task 4) once the gateway is the edge.
Apache front door: replace
Alias /models …+ProxyPass /models !withProxyPass /models http://<assets-host>:7007/models(+ProxyPassReverse), thenapachectl configtest && systemctl reload apache2. Verify behind Cloudflare; watch error rate, latency, and range behavior.
Roll the rest one at a time:
music→sprites→library.Phase 4 — slim the image: activate the
.dockerignoreexclusion forpublic/library(uncomment it in the “Assets/CDN cutover — Phase 4” block).public/modelsno longer exists (its two unused.glbfiles were deleted), and the Dockerfile’s public-root sanity check already targetspublic/robots.txt, so no Dockerfile change is needed here. Rebuild and confirm the image is ~500 MB lighter.Rollback (any phase): re-point the prefix back to the Apache
Alias/ disk (or remove the gateway prefix) and reload.