Repository navigation
feat(data): show the OSM extract's age and let Nominatim follow its feed - #737
Merged
Merged
Conversation
An OSM extract's header says when its data is current to and which diff feed continues it. data-manager now reads both when it downloads a PBF, and once at startup for a PBF downloaded before, and records them with the dataset. The admin data route reports them for the file the inventory found, and the Data workflows OSM card shows the time, its age, a flag past 30 days and the feed. Nominatim's replication URL, update mode and intervals were fixed in its manifest: the planet feed with the image's default mode `none`, so a regional import never applied diffs. They are now NOMINATIM_REPLICATION_URL, NOMINATIM_UPDATE_MODE, NOMINATIM_REPLICATION_UPDATE_INTERVAL and NOMINATIM_REPLICATION_RECHECK_INTERVAL, with the same defaults, documented with the regional Geofabrik feed. Part of #303
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What changed and why
The first two of #303's three parts. The third, the scheduled refresh, comes in a separate PR because it needs a new ops-agent operation for data-manager.
OSM extract age in the admin panel. The admin panel only showed when the PBF was downloaded, which says nothing about how current the data is. A mirror can serve a weeks-old file today. The extract's own header has the real time (
osmosis_replication_timestamp) and the diff feed that continues it (osmosis_replication_base_url). Geofabrik and the planet dumps set both.osmium. It records them on theosm-pbfdataset when it downloads, and once at startup for a PBF that was downloaded earlier.GET /api/admin/services/dataaddsosmExtract { timestamp, replicationUrl? }. It only uses the dataset whose file name and size match what the ops-agent inventory found, so a record of an older or different file is never shown. If data-manager can't be reached, the field is left out. The ops-agent contract is unchanged.NOMINATIM_REPLICATION_URL.Nominatim replication is now configurable. The manifest hard-coded the planet feed and set no
UPDATE_MODE. The mediagis 5.3 image defaults that mode tonone, so Nominatim never applied diffs and search stayed at its import date.NOMINATIM_REPLICATION_URL,NOMINATIM_UPDATE_MODE,NOMINATIM_REPLICATION_UPDATE_INTERVALandNOMINATIM_REPLICATION_RECHECK_INTERVAL.none, 86400 s and 900 s), so existing installs behave exactly as before..env.example,configuration.mdandpreparing-data.mdexplain that a regional import must follow its own Geofabrik feed. Otherwise the planet diffs pull in changes from everywhere, the same ruleOVERPASS_DIFF_URLalready documents.Related work
Part of #303. Still to do: an optional data-manager schedule that runs the checksummed PBF download, then rebuilds and restarts the consumers. That needs a typed ops-agent operation data-manager may call; today all lifecycle and build operations are API-only.
Verification
npx vitest run services/data-manager/__tests__ apps/api/src/services/osm-extract.test.ts apps/api/src/routes/__tests__/admin-services-sdk.test.ts apps/web/src/components/admin/services scripts/ops-authority-inventory.test.ts packages/core/src/api/contracts/service-admin.test.ts packages/core/src/services: everything passes except four tests inpackages/core/src/services/__tests__(checkout-layout,deployment-user,traefik-files). Those four fail identically onmainin this environment, which runs as root.tsc --noEmitpasses inpackages/core,services/data-manager,apps/apiandapps/web.check-openapi,check-api-sdk,check-data-manager-openapi,check-data-manager-sdkandcheck-ops-authoritypass.start.sh,init.shandconfig.sh, not from a running instance.Release and upgrade impact
@openmapx/extension-clibundles the data-manager dataset schema, which gains two optional fields, so there's a patch Changeset. No operator action: the new Nominatim settings default to the old fixed values. To keep search current on a regional install, setNOMINATIM_REPLICATION_URLto the extract's feed (shown on the OSM card) andNOMINATIM_UPDATE_MODE=continuous, then recreate Nominatim.