Skip to content

Populate domain graph: ingest, tiles, epochs, mosaics - #36

Merged
davecoulter merged 3 commits into
mainfrom
feature/domain-graph-population
Jul 28, 2026
Merged

davecoulter merged 3 commits into
mainfrom
feature/domain-graph-population

Conversation

@davecoulter

Copy link
Copy Markdown
Owner

Summary

  • Adds four new domain services (ingest_service, tile_service, epoch_service, mosaic_service) plus project_service, each with a matching FastAPI route and diffpype-manage CLI command (API/CLI parity throughout), and a populate-demo-project CLI coordinator that drives all four end-to-end for dev/demo use.
  • Adds two migrations: Project.slug + IngestBatch (0009), and Level3Mosaic.ra/decl barycenter columns closing GitHub issue Add computed barycenter coords to Level3Mosaic #27 (0010).
  • run_ingest_batch streams one file at a time (download -> parse -> delete, incremental progress) rather than materializing a whole batch first; both run_ingest_batch and run_mosaic_drizzle route to heavy_memory. Both dispatch-time service functions now mark their job row FAILED (instead of leaving it orphaned PENDING) if the Celery broker is unreachable at dispatch.
  • CLI status output gets ANSI coloring (TTY-only, NO_COLOR-aware) and a curated, salient column set for mosaic-status (no raw MOC dump, no bare FK ids); MosaicStatus's API response drops the same footprint payload for the same reason. tile_service.tile_with_most_calibrations replaces a naive "first tile in the list" selection with one chosen by actual data overlap.
  • S3StorageService no longer forces empty/local-only credential kwargs onto boto3, so it works against both MinIO (static keys) and real AWS (default credential chain) unchanged.

CLI Verification

All steps completed prior to PR creation via genTests.

  • Branch confirmed: feature/domain-graph-population
  • Images rebuilt: docker compose build api worker_light worker_heavy
  • Containers recreated: docker compose up -d
  • Migrations applied: 0009, 0010 (alembic upgrade head, verified via downgrade/upgrade round-trip)
  • Test suite passed: uv run pytest --cov=src --cov-fail-under=90 -q — 227 passed, 94.4% coverage
  • Sphinx build passed (local, -W, zero warnings)
  • pre-commit run --all-files — ruff, ruff-format, mypy all clean
  • docs/diagrams/infrastructure_topology.md — N/A, no service/topology change (local storage bind mount is a volume addition to existing services, not a new service or inter-service connection)

Application QA

All steps completed and verified prior to PR creation via genTests, against real ingested JWST FITS data (not synthetic fixtures).

  • Real ingest of a real FITS batch — confirmed streaming (bounded memory) and per-file progress after fixing an initial OOM (whole-batch-in-memory bug)
  • Instrument/band matching against real FITS headers — confirmed after fixing case-sensitive matching + an incomplete seed filter list
  • Tile tessellation + real spatial association — confirmed real tile/calibration overlaps via direct DB inspection
  • Epoch clustering over real MJDs — confirmed
  • Mosaic creation and status polling (CLI + API) — confirmed curated, salient output after removing raw MOC/bare-FK noise from both boundaries
  • Worker crash mid-task (real docker compose kill worker_heavy injection) — confirmed row correctly surfaces as stuck in_process, no silent auto-completion on worker restart
  • DB down before dispatch — confirmed clean, fast failure with no orphaned row; API reconnects cleanly once DB returns
  • Redis down before dispatch — confirmed and fixed a real gap (row previously left permanently orphaned pending; now marked failed)
  • populate-demo-project full coordinator run — confirmed end-to-end (ingest -> tiles -> epochs -> mosaic all complete) after fixing a naive tile-selection bug
  • CLI status ANSI coloring — confirmed color in an interactive terminal, plain text when piped, and NO_COLOR override respected
  • Fresh visualization against a clean re-ingest — confirmed real persisted tiles and image footprints render correctly

🤖 Generated with Claude Code

Populates the doc 26 domain schema end-to-end: real FITS ingest,
spatial tiling, MJD-based epoch clustering, and mosaic job dispatch,
so the future Aladin UI and JWST pipeline docs have real, tested
services and data to build on instead of empty tables.
@github-actions

github-actions Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Test Results

268 tests  +130   268 ✅ +130   24s ⏱️ +17s
  1 suites ±  0     0 💤 ±  0 
  1 files   ±  0     0 ❌ ±  0 

Results for commit a9bc784. ± Comparison against base commit ddf8466.

♻️ This comment has been updated with latest results.

@davecoulter
davecoulter merged commit 37da9b2 into main Jul 28, 2026
3 checks passed
@davecoulter
davecoulter deleted the feature/domain-graph-population branch July 28, 2026 20:40
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