Add Leaflet interactive map, tile generator compose, auto-sync cache, deploy docs

index.py rewritten as a continuous Leaflet map: rotated L93 tiles, stackable
visualization layers (per-layer opacity, drag-reorder persisted in
localStorage), tile info panel, live rebuild after each tile during a run.
Leaflet is vendored in assets/vendor/ so the map works fully offline;
georeferencing falls back rasterio -> pyproj -> affine so the lightweight
webapp (no GDAL) is supported.

docker-compose.worker.yml adds the tile generator service (full image + GPU)
that remote webapps call via LIDAR_GENERATION_URL, plus a one-shot process
profile. webapp.py gains LIDAR_AUTO_SYNC_SECONDS periodic cache refresh and
LIDAR_REGEN_CIDR restricting generation to the local network. run.sh
--serve-webapp now mounts ~/.ssh read-only so the rsync sync works.

docs/DEPLOY_WEBAPP.md completed for Raspberry Pi deployment: prerequisites,
git clone install, SSH key setup, first sync, update procedure and
troubleshooting.
This commit is contained in:
Antoine Jacquin
2026-09-04 21:36:14 +02:00
parent 422f58d772
commit 23969c9e14
17 changed files with 1828 additions and 336 deletions

57
docker-compose.worker.yml Normal file
View File

@ -0,0 +1,57 @@
# Machine de traitement — générateur de tuiles (cf. docs/DEPLOY_WEBAPP.md).
#
# Tourne sur la machine puissante (GPU + PDAL) et expose l'API que les
# webapp distantes (Raspberry Pi, docker-compose.webapp.yml) appellent :
# dessin d'une zone → téléchargement IGN + traitement GPU ici, les tuiles
# sont relues par la webapp via son LIDAR_SYNC_CMD (rsync).
#
# docker compose -f docker-compose.worker.yml up -d --build
# docker compose -f docker-compose.worker.yml logs -f worker
# docker compose -f docker-compose.worker.yml down
#
# Traitement batch ponctuel des dalles présentes dans input/ :
# docker compose -f docker-compose.worker.yml run --rm --build process [-r 0.5,0.2 | --force]
services:
# Générateur de tuiles : API de génération (webapp complète, GPU)
worker:
build: .
image: lidar-lidar
container_name: lidar-worker
init: true
user: "1000:1000"
gpus: all # retirer cette ligne sur une machine sans GPU
ports:
- "8973:8973" # joignable par la webapp distante (LIDAR_GENERATION_URL)
volumes:
# input/ en écriture : l'API y télécharge les dalles IGN manquantes
- ./input:/data/input
- ./output:/data/output
environment:
- TZ=Europe/Paris
- LIDAR_INPUT_DIR=/data/input
- LIDAR_OUTPUT_DIR=/data/output
# Les générations lancées depuis une webapp distante utilisent le GPU
- LIDAR_GPU=1
- LIDAR_WORKERS=2
# Protéger l'API si le réseau n'est pas de confiance : même valeur que
# LIDAR_REMOTE_TOKEN sur chaque webapp distante (sinon, laisser commenté)
# - LIDAR_API_TOKEN=change-moi
command: python3 -m uvicorn lidar_pipeline.webapp:app --host 0.0.0.0 --port 8973
restart: unless-stopped
# Traitement ponctuel des dalles input/ (une passe puis arrêt)
process:
build: .
image: lidar-lidar
container_name: lidar-process
init: true
user: "1000:1000"
gpus: all # retirer cette ligne sur une machine sans GPU
volumes:
- ./input:/data/input
- ./output:/data/output
environment:
- TZ=Europe/Paris
command: ["python3", "-m", "lidar_pipeline", "/data/input", "-o", "/data/output", "-r", "0.5,0.2", "-g", "all"]
profiles:
- process