fix(compose): keep galaxy.stack label on containers only
Tests · Integration / integration (pull_request) Successful in 1m41s
Tests · Go / test (pull_request) Successful in 2m0s

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:
Ilia Denisov
2026-05-19 01:00:21 +02:00
parent a9087691a3
commit daed2690c1
3 changed files with 26 additions and 17 deletions
+9 -8
View File
@@ -238,22 +238,23 @@ networks:
name: galaxy-dev-internal
driver: bridge
internal: false
labels:
galaxy.stack: dev-deploy
edge:
name: ${GALAXY_EDGE_NETWORK:-edge}
external: true
# Note: `galaxy.stack=dev-deploy` is intentionally stamped only on
# services (containers). Stamping it on networks or named volumes
# changes the compose config-hash for those resources, and on a
# subsequent `compose up` compose tries to recreate them — for the
# `galaxy-dev-postgres-data` volume that means destroying the
# database, and for `galaxy-dev-internal` it can deadlock if any
# container is still attached. Per-container labels are sufficient
# for the CI/cleanup contract; we filter containers, not volumes or
# networks.
volumes:
galaxy-dev-postgres-data:
name: galaxy-dev-postgres-data
labels:
galaxy.stack: dev-deploy
galaxy-dev-caddy-data:
name: galaxy-dev-caddy-data
labels:
galaxy.stack: dev-deploy
galaxy-dev-ui-dist:
name: galaxy-dev-ui-dist
labels:
galaxy.stack: dev-deploy
+3 -4
View File
@@ -218,11 +218,10 @@ services:
networks:
galaxy-net:
name: galaxy-local-dev-net
labels:
galaxy.stack: local-dev
# See note in tools/dev-deploy/docker-compose.yml — labels live only
# on services (containers), not on volumes or networks, to keep the
# compose config-hash for stateful resources stable across deploys.
volumes:
postgres-data:
name: galaxy-local-dev-postgres-data
labels:
galaxy.stack: local-dev