trails/infrastructure/scripts/poi-import.service
Ullrich Schäfer e703843b9b
poi-index: extract pipeline (BRouter host) + import job (flagship) + e2e
- poi-extract.sh: PBF download -> osmium tags-filter -> centroid NDJSON +
  manifest, published via the Caddy sidecar at vSwitch-only /poi/*
- osmium-filters.txt + poi-selectors.sql generated from map-core selectors,
  guarded by sync tests so poiCategories stays the single source of truth
- poi-import.sh: checksum verify -> classify into category rows ->
  70% guard (--bootstrap override) -> atomic rename swap; node_exporter
  textfile metric for import outcome
- systemd service+timer units for both halves (monthly, offset)
- cd-infra.yml: ship infrastructure/scripts to the flagship
- e2e: mock /api/pois instead of /api/overpass

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 22:48:32 +02:00

19 lines
928 B
Desktop File

# POI import — one-shot unit driven by poi-import.timer. Runs on the flagship
# as root (the deploy user), pulling the artifact the BRouter host published and
# swapping it into planner.pois. Install: copy to /etc/systemd/system/, then
# `systemctl enable --now poi-import.timer`. See infrastructure/scripts/README
# / the poi-index change docs. Requires BROUTER_AUTH_TOKEN in the environment
# file below (reuse the deployed /opt/trails-cool/.env).
[Unit]
Description=Import the trails.cool POI index artifact into planner.pois
Wants=network-online.target
After=network-online.target docker.service
[Service]
Type=oneshot
WorkingDirectory=/opt/trails-cool
EnvironmentFile=/opt/trails-cool/.env
# Optional: expose import-outcome metrics to node_exporter's textfile collector.
Environment=NODE_EXPORTER_TEXTFILE_DIR=/var/lib/node_exporter/textfile_collector
ExecStart=/opt/trails-cool/scripts/poi-import.sh
TimeoutStartSec=2h