Skip to content

fix(deploy): mount and sync backend/custom_models to prod#73

Closed
cafca wants to merge 1 commit into
mainfrom
deploy/custom-models-mount
Closed

fix(deploy): mount and sync backend/custom_models to prod#73
cafca wants to merge 1 commit into
mainfrom
deploy/custom-models-mount

Conversation

@cafca
Copy link
Copy Markdown
Owner

@cafca cafca commented Apr 26, 2026

Summary

After merging #72, prod GraphHopper crash-looped with:

Caused by: java.io.FileNotFoundException: /custom_models/beebeebike.json (No such file or directory)

Two missing pieces caused this:

  1. compose.prod.yml had no bind mount for the custom models directory, so even when the file was present on disk, the GH container couldn't see it.
  2. .github/workflows/cd.yml's "Sync runtime config" step only scp'd compose.prod.yml and backend/graphhopper_config.yml; backend/custom_models/* never reached helena.

This PR fixes both so the next CD run keeps prod consistent. Already deployed manually to unblock; this just codifies the fix.

Notes

  • The recipe-style refresh-data.yml workflow is intentionally left alone — its scp source is the OSM extract + tiles only, and once custom models live inside the backend Docker image (planned follow-up) the host-side sync will go away entirely.

Test plan

  • Next CD run on merge picks up backend/custom_models/* and prod GH stays healthy through the deploy.

GraphHopper now loads its routing rules from
`backend/custom_models/beebeebike.json` (added in #72), but neither the
prod compose nor the CD sync step were updated to ship that directory:

- compose.prod.yml didn't bind-mount custom_models, so the GH container
  couldn't see the file even when present on the host.
- The CD `Sync runtime config` step only scp'd compose.prod.yml and
  graphhopper_config.yml, so the custom model never reached helena.

Symptom in prod after merging #72: GH crash-looped with
`/custom_models/beebeebike.json (No such file or directory)`.

This was deployed manually to unblock; the change here is what the next
CD run needs to keep prod consistent.
@cafca
Copy link
Copy Markdown
Owner Author

cafca commented May 7, 2026

Superseded by #75 — moves custom_models into a thin GH image so host-side bind mount + scp sync are no longer needed.

@cafca cafca closed this May 7, 2026
cafca added a commit that referenced this pull request May 7, 2026
Replace the host-side bind mount of `backend/custom_models/` with a
custom GH image that COPYs the dir at build time. CD builds and pushes
`ghcr.io/cafca/beebeebike-graphhopper:latest` alongside the backend
image; `compose.prod.yml` pulls it. Routing rules now ship atomically
with `docker compose pull`, no scp dance, no separate sync path.

CD also gains a post-deploy probe: if the freshly-started GH container
logs `Profile 'X' does not match` (i.e. the new image carries different
priority/speed/distance_influence rules from what the cached graph was
baked against), CD wipes `data/osm/berlin/graphhopper` and reimports.
Cache is preserved across normal backend-only deploys.

Supersedes #73 — the host-side custom_models scp + bind mount approach
becomes unnecessary once the file lives inside the image that reads it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant