Skip to content

Move visual assets to R2 and deploy MapLibre static rendering - #25

Open
ewlarson wants to merge 6 commits into
developfrom
feature/r2-maplibre-production
Open

ewlarson wants to merge 6 commits into
developfrom
feature/r2-maplibre-production

Conversation

@ewlarson

@ewlarson ewlarson commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Generated thumbnails and static maps accumulated in PostgreSQL and Redis, leaving too little production disk headroom for nightly reindexing. This release stores image bytes in Cloudflare R2, preserves existing asset IDs and resource links, and serves immutable copies through assets.geo4lib.app. A private MapLibre Native service renders new campus and resource maps through Celery.

Production deployment and migration are complete. All 261,905 asset records were copied and checksum-verified against 255,240 immutable objects before local bodies were cleared. Protected metadata, link, schema, and verification backups were copied off-server and checked. Redis cleanup removed 249,661 exact byte matches while preserving seven unmatched entries (under 1 MB), broker queues, task results, and aliases. Ordinary VACUUM and Redis persistence compaction increased available disk space from roughly 36 GiB to 98.9 GiB (77% used). Redis memory is now about 231 MiB.

New image bodies are no longer retained in PostgreSQL or Redis; new aliases expire after 24 hours. R2 objects are not expired solely by age. The original Redis snapshot schedule was restored, with AOF persistence enabled throughout maintenance.

Validation: 2,014 backend tests passed, 82 skipped, 1 xpassed; lint and deployment invariants passed. The concurrent-update cleanup guard was also tested against an isolated PostgreSQL 15 instance. Production checks after cleanup passed for all eight asset kinds, SHA-256, MIME types, CDN caching, CORS, Celery connectivity, and Elasticsearch health/writeability. The final follow-up commit only records the completed operations in the runbook.

The deployed application image is 71c0b18; maintenance utilities and the complete runbook are included here. R2-compatible reads are required after cleanup: database-only rollback requires restoring image bodies first. See docs/r2-visual-assets.md for verification evidence and recovery details.

@ewlarson
ewlarson marked this pull request as ready for review October 27, 2026 00:13
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.

1 participant