Repository navigation
fix(ci): share Overpass OSM cache across PRs and cap enrichment time - #58
Open
NAVIGUIDE-for-Berry-Mappemonde wants to merge 6 commits into
Open
NAVIGUIDE-for-Berry-Mappemonde wants to merge 6 commits into
NAVIGUIDE-for-Berry-Mappemonde wants to merge 6 commits into
Conversation
added 6 commits
October 26, 2026 07:38
ci.yml: - trigger on push to feat/integrate-poe-pipeline as well (default branch) plus workflow_dispatch so the default-branch run saves the Overpass cache - add timeout-minutes: 12 to the OSM validation step - save the cache only when the file exists and is non-empty - copy the frozen snapshot backend/tests/fixtures/osm-ports.snapshot.json into the cache when missing after restore enrich_ci_osm.py: - add CI_OSM_BUDGET_S (default 600s): stop launching new Overpass queries once exceeded, save cache and exit cleanly; final refusals unchanged tests: - test_ml_jobs.py: limit 3 -> 1, wait_done timeout 180 -> 300 - test_ner_unclos_osm.py: poll every 2s up to 60s, skip if job stops snapshot: - add backend/scripts/build_osm_snapshot.py (resumable, real Overpass data)
… to 1 ci.yml: - ne copier le snapshot figé que s'il existe et est non vide ([ -s ]), pour eviter le crash 'cp' sur fichier absent build_osm_snapshot.py: - concurrence reduite a 1 (Overpass autorise un seul slot par IP) - flush du fichier JSON sur disque apres chaque lot de 2 ports (au lieu de 25)
- New osm-cache job queries Overpass once from GitHub runners, resumable, saves cache after each success, green only if all 1169 ports present. - Six shards need osm-cache, run enrich_ci_osm.py in CI_OSM_OFFLINE=1 mode (no network, missing port = failure). Final refusals unchanged. - Revert || echo and CI_OSM_BUDGET_S: 60 bypasses; drop the frozen 12-port snapshot (stored failures as [] => fake data). - build_osm_snapshot.py: --cache/--budget-s, concurrency 2, resume skips cached ports, stores only real answers (never failures), budget checked after acquiring the semaphore. - Add unit tests: offline missing port = failed/no network; offline cached port validated; build_osm_snapshot stores nothing on failure; resume skips cached ports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Diagnosis
.github/workflows/ci.ymltriggerspush: branches: [main], but the default branch isfeat/integrate-poe-pipeline. So no run on the default branch ever saves the Overpass cache, and PR-scoped caches are not shared between PRs: every PR starts cold.backend/scripts/enrich_ci_osm.pyqueries Overpass for 1169 ports (concurrency 3, up to 3 mirrors x 35 s httpx timeout each, 4 rounds) in each of the 6 shards -> hangs until the job timeout of 35 min.Changes
ci.yml:on:push on branches[main, feat/integrate-poe-pipeline]+workflow_dispatch:.timeout-minutes: 12.if: always() && hashFiles('backend/.ci-cache/osm-ports.json') != '').backend/.ci-cache/osm-ports.jsonis missing after restore, copy the frozen snapshotbackend/tests/fixtures/osm-ports.snapshot.jsonto it.backend/scripts/build_osm_snapshot.pygeneratesbackend/tests/fixtures/osm-ports.snapshot.jsononce with REAL Overpass answers (reusesoverpass_aroundand the cache functions, resumable, readsseed/ports_of_entry.geojson, no Mongo). Running in background (nohup, log in~/lots-live/fix-ci-bi/snapshot.log).backend/scripts/enrich_ci_osm.py: add a global time budget (envCI_OSM_BUDGET_S, default 600): once exceeded, stop launching new Overpass queries, save the cache and exit with a clear message. Final refusals (missing ports / no anomaly) unchanged.test_ml_jobs.py::test_validate_osm_non_destructive: limit 3 -> 1, wait_done timeout 180 -> 300.test_ner_unclos_osm.py::test_validate_osm_status_progressing: instead of a single 8 s sample, poll every 2 s for up to 60 s; pass as soon as progress increases; skip (not fail) if the job finishes or stops running in the meantime.Local validation
pytest backend/tests/test_enrich_ci_osm.py-> 4 passed.python -c yaml.safe_loadon ci.yml -> valid.Snapshot status: running in background, partial warm cache committed if not finished within 45 min.