fix(compose): keep galaxy.stack label on containers only
The previous commit stamped `galaxy.stack=<value>` on services, volumes, and networks. Putting it on volumes/networks changes their compose config-hash on every label revision, so `docker compose up` tries to recreate them — which on the long-lived dev environment either destroys the postgres data volume or deadlocks while trying to remove `galaxy-dev-internal` with containers still bound to it. Observed live: run #184 hung in compose recreate after the three stateful services were stopped, with no recovery. Containers alone are sufficient for the cleanup contract (we filter containers, not volumes or networks). Roll back the label on volumes and networks in both compose files and capture the rule in docs/ARCHITECTURE.md so the next contributor does not reintroduce it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+14
-5
@@ -832,14 +832,14 @@ Environments:
|
||||
|
||||
### Container labels
|
||||
|
||||
Every Docker resource Galaxy creates carries an opinionated label so
|
||||
that host-side tooling (Makefiles, CI workflows, `preclean.sh`) can
|
||||
scope its operations to Galaxy-owned objects and never touch unrelated
|
||||
workloads on the shared daemon.
|
||||
Every Galaxy-managed Docker **container** carries an opinionated
|
||||
label so that host-side tooling (Makefiles, CI workflows,
|
||||
`preclean.sh`) can scope its operations to Galaxy-owned containers
|
||||
and never touch unrelated workloads on the shared daemon.
|
||||
|
||||
| Label | Values | Set by | Used by |
|
||||
|-------|--------|--------|---------|
|
||||
| `galaxy.stack` | `local-dev`, `dev-deploy`, `integration` | `tools/{local-dev,dev-deploy}/docker-compose.yml` for compose-managed resources; backend reads `BACKEND_STACK_LABEL` and stamps engines it spawns. | `tools/{local-dev,dev-deploy}/Makefile`, `.gitea/workflows/dev-deploy.yaml`. |
|
||||
| `galaxy.stack` | `local-dev`, `dev-deploy`, `integration` | `tools/{local-dev,dev-deploy}/docker-compose.yml` for compose-managed services; backend reads `BACKEND_STACK_LABEL` and stamps engines it spawns. | `tools/{local-dev,dev-deploy}/Makefile`, `.gitea/workflows/dev-deploy.yaml`. |
|
||||
| `galaxy.backend` | `1` | `backend/internal/dockerclient` adapter on every engine container. | `integration/scripts/preclean.sh`. |
|
||||
| `galaxy.game_id` | `<uuid>` | Backend on engine create. | Reconciler reattach loop. |
|
||||
| `galaxy.engine_version` | `<semver>` | Backend on engine create. | Reconciler version checks. |
|
||||
@@ -853,6 +853,15 @@ scoped by their compose project name (`galaxy-dev`, `galaxy-local-dev`),
|
||||
which Compose enforces on `docker compose up/down`; the labels make the
|
||||
contract explicit and survive hand-rolled cleanup commands as well.
|
||||
|
||||
**Scope deliberately limited to containers.** Labels are NOT stamped
|
||||
on named volumes or user-defined networks. Adding labels there would
|
||||
change the compose config-hash for the volume/network on every label
|
||||
revision and force `docker compose up` to recreate them — which for a
|
||||
postgres data volume means destroying the database, and for a shared
|
||||
network can deadlock if any container is still attached. Containers
|
||||
alone are sufficient for the cleanup contract; stateful resources stay
|
||||
untouched by compose between deploys.
|
||||
|
||||
## 19. Deployment Topology (informational)
|
||||
|
||||
- MVP runs three executables: one `gateway` instance, one `backend`
|
||||
|
||||
Reference in New Issue
Block a user