feat: Add an opt-in zero-downtime rolling swap to deploy-vps #92
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/blocked
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions!92
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/91-rolling-deploy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue
Closes #91
Problem
deploy-vps recreates every container, so each deploy stops the running one before the new one is up. That gives about 10 s of 502s per deploy (rihla, 8 Oct).
Solution
rolling-services. For each listed service:rolling-settle-seconds(default 10), so the proxy routes to the new one first;docker stop, so its stop signal andstop_grace_periodapply, then remove it.--no-deps.container_name, keep a healthcheck, add a Traefik retry (×5) and therolling-deploy@filetransport (1 s dial timeout), setstop_grace_period.Review notes
stop -t 0mutant fails the graceful case.Risks and trade-offs
WIP: feat: Add an opt-in zero-downtime rolling swap to deploy-vpsto feat: Add an opt-in zero-downtime rolling swap to deploy-vpsReviewed at
367319238f. CI green (validate: checker, harness tests, behaviour tests).Verified against #91:
--no-recreate --scale, waits on it by id, settles, then stops the old one;unhealthy, noHEALTHCHECK, 30 s ofunknownor the budget all remove the new replicas and exit 1 before anything old is touched. Live runs 4678/4679 (0 failed) and the rollback run 4675 (3,336/3,336) are on the issue.docker stopwithout-t, so the container's ownStopTimeoutfromstop_grace_periodapplies; a behaviour case asserts nostop -t.up --force-recreate --remove-orphansline is unchanged and the new code is behind-z/-nguards; the only additions on that path are two no-op validations and two env assignments on the ssh line. Fifteen consumers use this action and none sets the input yet.container_namegoes.^[A-Za-z0-9][A-Za-z0-9_.-]*$and the settle against^[0-9]+$before they enter the single-quoted ssh command;grep -qxFon the service list; stale exited/created/dead replicas removed before counting soupcannot revive one and count it as serving; first deploy scales to 1 and stops nothing.ifblocks out of the action, so a renamed guard fails loudly rather than testing nothing.One note, non-blocking: on a rollback the other services already run the new revision while the rolled one stays on the old, until the next deploy. The README's "a schema both versions can run against" covers the database; a sentence saying the mixed state is expected after a failed swap would save a diagnosis.