Skip to content

Restore the map pipeline so the mapserver can start - #10

Merged
mattiashem merged 1 commit into
mainfrom
fix/restore-map-pipeline
Nov 6, 2026
Merged

mattiashem merged 1 commit into
mainfrom
fix/restore-map-pipeline

Conversation

@mattiashem

Copy link
Copy Markdown
Contributor

Why

main can't start. code/mapmaker/maps was never committed and terracotta isn't in the requirements, so the app fails at startup. CI stays green because it only checks that the image builds.

What changed

  • Restored code/mapmaker/maps from map-maker (1c17a2b): cog.py, detect.py, variants.py, terracotta_client.py and the colour ramps. The default catalog path is now /data/db/terracotta.sqlite.
  • Adapted makingGeotiff.py to the restored module's spec.build(...) signature, and made tile URLs follow map-maker's conventions.
  • Fixed requirements.txt: added and pinned terracotta==0.10.1, rasterio==1.4.3 and numpy<2, and removed the unused ninja2 and geotiff.
  • Allowed the dashboards to load tiles: Terracotta only allows localhost pages by default. The new terracotta.allowedOrigins chart value defaults to dash.ollebo.com and dash.northamlin.com, and docker-compose.yaml sets the same origins.
  • Sanitised the upload name: /mapmaker now runs the name field through secure_filename.
  • Added .dockerignore so test imagery and local data stay out of the image.

Testing

Tested with ollebo/mapserver:ef4b91a (built by hand and pushed to Docker Hub), installed with this chart on v2cluster and reached through a port-forward:

  • Pod runs with both containers up and 0 restarts, and all three PVCs are Bound
  • Home page loads on empty volumes
  • Uploading a 58 MB orthophoto produces rgb and grayscale variants in about 20 seconds
  • Tiles return 200 image/png
  • Access-Control-Allow-Origin is sent for https://dash.ollebo.com and not for other origins
  • Data survives a pod restart
  • Tiles draw in dash.ollebo.com: not verified. The browser used for testing couldn't reach the port-forward, so its tile requests never got to the server.

Before merging

  • This publishes an image. Merging to main makes CI push to GHCR. GHCR refused an anonymous pull of the chart's default image, so customer installs may fail until that package's visibility is checked.
  • There's still no login. Anyone who can reach the server can upload files, and CORS doesn't restrict who can fetch tiles. Don't expose it publicly yet.

Known gaps, not fixed here

  • The link to Ollebo isn't built: nothing checks OLLEBO_KEY, and dw's mapserver url is hardcoded.
  • The /map page has no map viewer, despite what the README says.
  • The area outside the photo shows as black instead of transparent.
  • The server still runs on Flask's development server.
  • The pod triggers PodSecurity restricted warnings at install.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AwkBcZCmo27zHnnRnAcKiy

start.py and listMaps.py import mapmaker.maps, but that package was never
committed, and terracotta was missing from requirements.txt, so the published
image could not start. Restore the package from map-maker (1c17a2b) and use
its current conventions: RGB is split into one COG per channel, and tile URLs
carry explicit ranges.

Also:
- Allow the Ollebo dashboards in Terracotta's tile CORS; the default is
  localhost only.
- Pin numpy/rasterio/terracotta and drop the unused ninja2 and geotiff.
- Run secure_filename on the /mapmaker name.
- Add a .dockerignore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AwkBcZCmo27zHnnRnAcKiy
@mattiashem
mattiashem merged commit 41e72b5 into main Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants