fix(dev-deploy): seed geoip onto a named volume #15

Merged
developer merged 1 commits from feature/dev-deploy-geoip-volume into development 2026-05-19 00:02:12 +00:00
Owner

Summary

Fix the docker restart galaxy-dev-backend failure observed while diagnosing the previous sandbox-cancel bug. The compose file used to bind-mount the geoip database via a relative path, which compose resolved against the Gitea runner's ephemeral workspace (/home/runner/.cache/act/<hash>/...). The runner deletes that workspace once the workflow ends, so any later docker restart failed with not a directory.

This PR replaces the bind-mount with a named volume galaxy-dev-geoip-data, seeded at deploy time by both the workflow and the Makefile.

Changes

  • tools/dev-deploy/docker-compose.yml — backend mounts galaxy-dev-geoip-data:/var/lib/galaxy:ro instead of the relative bind. New volume declared in the top-level volumes: block.
  • .gitea/workflows/dev-deploy.yaml — new Seed geoip volume step (right after UI seed) copies the fixture into the named volume via an ephemeral alpine container.
  • tools/dev-deploy/Makefile — new seed-geoip target performs the same copy from the persistent checkout. Added as a dependency of up and rebuild so make -C tools/dev-deploy up populates the volume without operator action.
  • tools/dev-deploy/README.md — make-targets table updated.
  • tools/dev-deploy/KNOWN-ISSUES.md — restart-failure entry downgraded to a fixed postmortem.

Test plan

  • docker compose config -q — clean.
  • End-to-end on the dev host: make -C tools/dev-deploy up brings every service healthy; docker restart galaxy-dev-backend now succeeds and the backend goes healthy in ~6s.
  • Pre-existing sandbox engine galaxy-game-80f3ce86-... survived both make up and the restart untouched (still Up 23+ minutes).
  • Gitea CI on the PR: workflow paths only match tools/dev-deploy/** and .gitea/workflows/dev-deploy.yaml, none of which are in go-unit / integration filters, so the PR may simply have no CI runs to wait on; the real validation will be the post-merge auto-deploy.
## Summary Fix the `docker restart galaxy-dev-backend` failure observed while diagnosing the previous sandbox-cancel bug. The compose file used to bind-mount the geoip database via a relative path, which compose resolved against the Gitea runner's ephemeral workspace (`/home/runner/.cache/act/<hash>/...`). The runner deletes that workspace once the workflow ends, so any later `docker restart` failed with `not a directory`. This PR replaces the bind-mount with a named volume `galaxy-dev-geoip-data`, seeded at deploy time by both the workflow and the Makefile. ## Changes - **`tools/dev-deploy/docker-compose.yml`** — backend mounts `galaxy-dev-geoip-data:/var/lib/galaxy:ro` instead of the relative bind. New volume declared in the top-level `volumes:` block. - **`.gitea/workflows/dev-deploy.yaml`** — new `Seed geoip volume` step (right after UI seed) copies the fixture into the named volume via an ephemeral alpine container. - **`tools/dev-deploy/Makefile`** — new `seed-geoip` target performs the same copy from the persistent checkout. Added as a dependency of `up` and `rebuild` so `make -C tools/dev-deploy up` populates the volume without operator action. - **`tools/dev-deploy/README.md`** — make-targets table updated. - **`tools/dev-deploy/KNOWN-ISSUES.md`** — restart-failure entry downgraded to a `fixed` postmortem. ## Test plan - [x] `docker compose config -q` — clean. - [x] End-to-end on the dev host: `make -C tools/dev-deploy up` brings every service healthy; `docker restart galaxy-dev-backend` now succeeds and the backend goes healthy in ~6s. - [x] Pre-existing sandbox engine `galaxy-game-80f3ce86-...` survived both `make up` and the restart untouched (still Up 23+ minutes). - [ ] Gitea CI on the PR: workflow paths only match `tools/dev-deploy/**` and `.gitea/workflows/dev-deploy.yaml`, none of which are in `go-unit` / `integration` filters, so the PR may simply have no CI runs to wait on; the real validation will be the post-merge auto-deploy.
developer added 1 commit 2026-05-18 23:59:56 +00:00
`docker restart galaxy-dev-backend` failed with "not a directory"
after every dev-deploy workflow run. Root cause: the compose file
bind-mounted the geoip database via a relative path
(`../../pkg/geoip/test-data/test-data/GeoIP2-Country-Test.mmdb`).
When the Gitea runner invoked `docker compose up`, the path
resolved against the runner's ephemeral workspace under
`/home/runner/.cache/act/<hash>/hostexecutor/...`. The bind source
baked into the running container therefore pointed at that
ephemeral path; the runner deleted the workspace once the workflow
finished, and any later `docker restart` could not remount.

Replace the bind with a named volume `galaxy-dev-geoip-data`,
seeded at deploy time:

- `tools/dev-deploy/docker-compose.yml`: mount
  `galaxy-dev-geoip-data:/var/lib/galaxy:ro` instead of a relative
  bind. Declare the volume in the top-level `volumes:` block.

- `.gitea/workflows/dev-deploy.yaml`: new `Seed geoip volume` step
  (placed right after the existing UI-volume seed) copies the
  fixture from `pkg/geoip/test-data/test-data/` into the named
  volume via an ephemeral alpine container, the same pattern UI
  seeding already uses.

- `tools/dev-deploy/Makefile`: new `seed-geoip` target performs
  the same copy from the persistent checkout. `up` and `rebuild`
  now depend on it, so a hand-run `make -C tools/dev-deploy up`
  populates the volume without operator action.

- `tools/dev-deploy/README.md`: updated the make-targets table to
  list `seed-geoip`.

- `tools/dev-deploy/KNOWN-ISSUES.md`: the entry for the restart
  failure is downgraded to a "fixed" postmortem; the symptom,
  cause, and where the fix lives are kept for future reference.

Verification on the dev host (this branch checked out):

  $ make -C tools/dev-deploy up                # populates the volume, brings stack healthy
  $ docker restart galaxy-dev-backend          # used to error "not a directory"
  $ until [ "$(docker inspect -f '{{.State.Health.Status}}' galaxy-dev-backend)" = "healthy" ]; do sleep 2; done
  $ echo "ok"                                   # backend up 6s, healthy

The pre-existing sandbox engine `galaxy-game-80f3ce86-...` survived
both `make up` and `docker restart` untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
developer merged commit 82bdb6777a into development 2026-05-19 00:02:12 +00:00
developer deleted branch feature/dev-deploy-geoip-volume 2026-05-19 00:02:12 +00:00
Sign in to join this conversation.