Move runtime artifacts out of the source tree to ~/trips

The dev directory now holds source code + compiled binaries only:
  ~/trips/osm/          OSM PBF extracts (was osm/, 1.4 GB)
  ~/trips/tilecache/    mock tile cache (was mock/.tilecache)
  ~/trips/store/mock/   per-trip uploads + chat logs (was mock/store, PII)
  ~/trips/logs/         server.log
  ~/trips/stale-osm-build/  stale source/tarball dup of ~/osm-build
                           (repo osm/build had no binaries; the live OSRM
                           toolchain + graphs already lived in ~/osm-build)

Code now points at the new locations, all overridable via env:
- mock/server.js: TRIPS_HOME (default ~/trips) for tile cache + store
- setup-osrm.sh / setup-osrm-colombia.sh: OSM_DIR (default ~/trips/osm)
- spatial/compose+import.sh: OSM_DIR (default ~/trips/osm)
- .gitignore: rewritten — no artifact paths remain in-tree
This commit is contained in:
gmp
2026-09-10 10:03:04 -04:00
parent c367eba5cb
commit 3da04c111e
9 changed files with 40 additions and 30 deletions
+4 -4
View File
@@ -18,15 +18,15 @@ nearest, bbox)"). Replaces the flat-file/Overpass approximations.
* Docker with the current user in the `docker` group (on this box:
one-time `sudo usermod -aG docker $USER`, then re-login).
* PBF extracts in `../osm/` (already present: `nh.osm.pbf`,
`colombia.osm.pbf`, US state extracts).
* PBF extracts in `~/trips/osm` (already present: `nh.osm.pbf`,
`colombia.osm.pbf`, US state extracts; override with `OSM_DIR`).
## Usage
```bash
docker compose up -d postgis # first: runs schema.sql
./import.sh ../osm/nh.osm.pbf nh # load New England (default)
./import.sh ../osm/colombia.osm.pbf colombia
./import.sh ~/trips/osm/nh.osm.pbf nh # load New England (default)
./import.sh ~/trips/osm/colombia.osm.pbf colombia
docker compose up -d spatiald # query service on :5005
```
+5 -2
View File
@@ -1,7 +1,10 @@
# PostGIS spatial stack for the trip planner.
#
# docker compose up -d postgis # start the DB (schema.sql runs on first boot)
# ./import.sh ../osm/nh.osm.pbf # import an OSM extract (one-shot osm2pgsql)
# ./import.sh # import ~/trips/osm/nh.osm.pbf (one-shot osm2pgsql)
#
# OSM_DIR (default ~/trips/osm) is where the PBF extracts live — outside the
# dev tree. Export it to override.
# docker compose run --rm spatiald # start the query service on :5005
#
# The PBF extracts live in ../osm (gitignored). osm2pgsql runs as a one-shot
@@ -43,7 +46,7 @@ services:
--flat-nodes=/tmp/flat.nodes --disable-operations
--import-strips=10
volumes:
- ../osm:/data:ro
- ${OSM_DIR:-$HOME/trips/osm}:/data:ro
spatiald:
build: .
+4 -2
View File
@@ -3,7 +3,8 @@
#
# ./import.sh [file.osm.pbf] [extract-name]
#
# file.osm.pbf default: ../osm/nh.osm.pbf (path may be absolute)
# file.osm.pbf default: $OSM_DIR/nh.osm.pbf (OSM_DIR defaults to
# ~/trips/osm — the PBFs live outside the dev tree)
# extract-name default: basename without extension
#
# The PBF must be readable by uid 1001 (the osm2pgsql image user) — the
@@ -12,7 +13,8 @@
set -euo pipefail
cd "$(dirname "$0")"
PBF=${1:-../osm/nh.osm.pbf}
OSM_DIR="${OSM_DIR:-$HOME/trips/osm}"
PBF=${1:-$OSM_DIR/nh.osm.pbf}
NAME=${2:-$(basename "${PBF%.osm.pbf}")}
ABS=$(realpath "$PBF")
[[ -f $ABS ]] || { echo "no such PBF: $ABS" >&2; exit 1; }