| name | devshard-update |
|---|---|
| description | Update a Gonka devshard gateway to a new image version without dropping in-flight /v1/chat/completions requests, driven by a JSON config. Single-instance blue/green (temp gateway + nginx switch + drain + config-driven temp escrows + import); a recover command reclaims stranded temp escrows; multi-instance pools use a rolling update. |
Companion to README.md (manual steps + the command) and scripts/update.sh.
cp scripts/update.config.sample.json update.config.json # edit: image tags, models[], nginx, compose
./scripts/update.sh --config update.config.json run # dry run — prints the plan
./scripts/update.sh --config update.config.json run --run # executeAdd --yes for unattended. Everything is config-driven (models included) — nothing is hardcoded.
- Treat any live gateway host as production. Show the exact command and get approval before running it.
- Dry-run first (
runwithout--run) and read the plan. - MAIN's image comes from the compose file; the
bump-main-imagestep rewrites the tag fromimage.from_tagtoimage.to_tag. - Temp escrows must cover every model MAIN serves —
preflightfails closed if a served model has no temp coverage and isn't inallow_unavailable_models. - Public verification runs only if
nginx.public_base_urlis set — never trust loopback. - Do not assume the nginx config path — inspect with
docker exec <proxy> sh -lc 'nginx -T'.
scripts/update.config.sample.json — blocks: image {repository, from_tag, to_tag}, models[] {model, escrow_count, escrow_amount}, allow_unavailable_models[], escrow, main, temp, nginx, compose, timeouts, rotation. Any field is overridable by the matching env var.
Full-flow order (aborts on the first failed gate and names the step):
init → preflight → disable-main-rotation → create-temp-gateway → create-temp-escrows → check-temp → switch-to-temp → check-alias-temp → drain-main → bump-main-image → update-main → check-main-direct → switch-to-main → check-alias-main → drain-temp → stop-temp → import-temp → activate-temp → restore-main-rotation → status.
- Single step:
./scripts/update.sh --config <file> <step> --run. - Resume:
... run --run --from-step drain-main. - Recover stranded temp escrows after an aborted run:
./scripts/update.sh --config <file> recover --run(add--settleto settle them instead of folding into main). plan/validate/list-stepsfor inspection (no side effects).
ssh -p <port> <user>@<host> "$(cat <<'REMOTE'
set -euo pipefail
cd <deploy-dir>
./scripts/update.sh --config update.config.json run --run --yes
REMOTE
)"