Add Docker Compose setup for full-stack local development#15
Add Docker Compose setup for full-stack local development#15anshjaiswal12 wants to merge 22 commits into
Conversation
…iddleware-audit Merging Olufemi's API middleware and auth modules
…tics-statistics Merging Francis's analytics statistics and reporting modules
Defines responsibilities, deliverables, and collaboration guidelines for the Carbon Analytics & Validation role. Co-Authored-By: Francis Umo <francis.umo@climatevision.org>
Defines responsibilities, deliverables, and collaboration guidelines for the API Development & Integration role. Co-Authored-By: Olufemi Taiwo <olufemi.taiwo@climatevision.org>
…role-document Merged by Mary Oshadare
…e-document Merged by Mary Oshadare
…mate-Vision#7) * feat(data): add GEE tile downloader with analysis-aware band selection - Downloads real Sentinel-2 composites via Google Earth Engine - Reads required bands from config.yaml per analysis_type - Includes SCL band for downstream cloud masking - Synthetic fallback with explicit is_synthetic flag when GEE unavailable - Fix .gitignore so src/climatevision/data/ is no longer ignored * feat(data): add analysis-specific Sentinel-2 band mapping utilities - get_bands_for_analysis() reads correct bands from config.yaml - get_band_indices() maps band names to canonical 13-band stack positions - is_analysis_enabled() and list_enabled_analysis_types() for config validation - Includes SCL band helpers for downstream cloud masking * feat(data): integrate SCL cloud masking and export new pipeline modules - apply_scl_cloud_mask() masks cloudy pixels using Sentinel-2 SCL band - Default clear labels: vegetation, bare soils, water, snow - Update __init__.py to expose gee_downloader and band_mapping utilities * refactor(data): address PR review feedback - Remove duplicated config logic in gee_downloader.py; import from band_mapping - Cache config.yaml load in band_mapping.py via lru_cache - Read synthetic tile size from config.yaml instead of hardcoding 256 - Remove unused json import in gee_downloader.py - Add shape validation in apply_scl_cloud_mask --------- Co-authored-by: Adeolu Mary Oshadare <adeolu@placeholder.com>
…ing (Climate-Vision#8) * feat(inference): make pipeline analysis-aware with dynamic model loading - _load_model() now accepts analysis_type and reads in_channels/num_classes from config.yaml - Per-analysis-type model cache prevents cross-contamination between deforestation/ice/flood models - _find_best_checkpoint() prefers config.yaml weight path per analysis type - run_inference() accepts analysis_type, pads/crops to correct n_channels, and returns dynamic class counts - run_inference_from_file() and run_inference_from_gee() propagate analysis_type parameter * feat(api): wire analysis_type into prediction endpoints - Pass body.analysis_type to run_inference_from_gee() in /api/predict - Pass analysis_type to run_inference_from_file() in /api/predict/upload - Enables the API to load the correct model and return correct class counts per analysis type --------- Co-authored-by: Olufemi Taiwo <Olufemitaiwo23@gmail.com>
… flag, add config health validation - Add cv_dev development key bypass for local testing - Require X-API-Key on all mutation endpoints (POST predict, orgs, alerts, subscriptions) - Surface is_synthetic at root of inference response for frontend demo banners - Expand /api/health to validate config alignment (bands vs in_channels, classes vs num_classes)
- Add FastAPI test client fixture - Create CI workflow for Python (flake8, pytest) and frontend (npm build) - Bootstrap tests/ directory structure
- Parametrize UNet init for all 3 analysis types (4ch/2cl, 4ch/3cl, 3ch/3cl) - Validate forward pass output shapes - Add Siamese change detection forward shape test
- Link to 6 active good-first-issue and help-wanted issues - Add claim workflow for new contributors - Include time estimates and skill-building map
- ../components/map/ -> ../components/Map/ - Fixes vite build failure on Linux (case-sensitive filesystem)
- Fixes pip install failure for gdal and rasterio on Ubuntu runners - Adds libgdal-dev, gdal-bin, libgl1-mesa-glx
- gdal Python package requires exact system GDAL version matching - rasterio covers all GDAL functionality we actually use - Simplify CI system deps to libgl1 only (for opencv runtime)
- Fixes ModuleNotFoundError: No module named 'climatevision' - pip install -e . registers src/ as an importable package
- ForestDataset with DataLoader support - Training/validation augmentation pipelines - Synthetic tile generation for demo/fallback mode
- Add DONE/PENDING task list for April 2026 sprint - Include actual .github/workflows/ci.yml code in role doc - Update local CI check commands to match current workflow
Goldokpa
left a comment
There was a problem hiding this comment.
Great contribution @anshjaiswal12 — Docker Compose support is exactly what was needed for issue #13. The overall approach is solid: the node_modules volume trick, BACKEND_URL proxy in vite.config.ts, and restart policies are all correct. However there are blocking issues before this can merge.
MUST FIX:
- PR targets
maininstead ofdevelop— Per CONTRIBUTING.md all PRs must targetdevelop. Please change the base branch using the Edit button at the top of this PR. - Backend Dockerfile missing CPU-only pip flag — The PR description mentions preventing multi-GB NVIDIA downloads, but the Dockerfile does not include
--extra-index-url https://download.pytorch.org/whl/cpu. Without this, PyTorch will pull CUDA wheels and the image will exceed several GB. Add this flag to the pip install line or provide arequirements-docker.txtpinning CPU wheels. - No healthcheck — frontend starts before backend is ready —
depends_on: backendonly waits for container start, not for FastAPI to be ready. Add a healthcheck on the backend service and usecondition: service_healthyin the frontend depends_on. The /health endpoint already exists in the app. - Backend volume
.:/appmounts everything — This is intentional for hot-reload but should be documented with a comment, and it means the Dockerfile COPY is ignored at runtime.
SUGGESTIONS (non-blocking):
- Remove the
3000:3000port — "in case it's overridden" is not a good pattern; document the env var override instead. -
- Note in README that the frontend
.envcopy step is not required for Docker Compose (BACKEND_URL is set via compose env, not .env).
- Note in README that the frontend
-
-
- Add a note that this is a dev-only setup and a production Dockerfile (nginx + built assets) is a separate follow-up.
What's done well: .dockerignore files are correct, vite.config.ts proxy change is non-breaking for manual setup, README section is clear and well-structured.
- Add a note that this is a dev-only setup and a production Dockerfile (nginx + built assets) is a separate follow-up.
-
Please retarget to develop and address items 1-3 — happy to approve once those are done!
|
Hi, I noticed this PR has requested changes and one required CI check still pending. If the original contributor is unavailable, I would be happy to help address the remaining requested changes or update the Docker Compose setup/documentation. Please let me know if I can take this up. |
|
Hi, I noticed there is already an open PR for this issue. I’ll avoid duplicating the work. If help is needed with the requested changes or Docker Compose documentation, I’d be happy to contribute. |
|
Thanks for the patience here, everyone. @anshjaiswal12 — the PR has been waiting on the changes I requested for a while now, so I want to make sure it doesn't stall. If you're still planning to push the fixes (the multi-stage Dockerfile + the README/QUICKSTART updates noted above), please drop a comment and we'll hold the slot for you.\n\n@spandanaerukull — thanks for offering to pick this up. If we don't hear back from @anshjaiswal12 in the next 5–7 days, please feel free to open a follow-up PR addressing the requested changes (multi-stage Dockerfile, |
|
📢 Heads-up: repo history was rewritten today (2026-05-18) We force-pushed a cleaned history across all branches to remove an internal directory from past commits. Your code and this PR are unaffected — only the commit SHAs underneath have shifted. GitHub will re-render the diff against the new base automatically. If you have a local clone, please bring it back in sync before pushing anything else: # Option A (simplest): fresh start
git clone https://github.com/Climate-Vision/ClimateVision.git
# Option B: rebase the existing PR branch in your fork
git fetch origin
git checkout <your-branch>
git rebase origin/main # likely no conflicts
git push --force-with-leaseDo not Apologies for the interruption — really appreciate your patience here. If anything looks off after rebasing, leave a comment and I'll help unblock right away. Thanks for contributing 🙏 |
Resolves #13.
What was added
docker-compose.ymlconfiguration linking the FastAPI backend and React Vite frontend.Dockerfileusing the--extra-index-urlpip parameter preventing multi-gigabyte NVIDIA GPU metadata from downloading recursively for local API contexts.README.md.How to test
cp .env.example .env && cp frontend/.env.example frontend/.envdocker-compose up -d --buildWhy it improves DX
Local environment onboarding is extremely unified, ensuring engineers bypass OS-dependency nuances directly through Docker mappings orchestrating both ends simultaneously while maintaining HMR.