Commit Graph

41 Commits

Author SHA1 Message Date
4051506b95 fix(landscape): guard redelivery, detach terminal writes, bound workers
F2: Execute had no status guard, so a redelivered or stale message reran a
finished run. Runs that are neither queued nor running are logged and acked
without work; "running" still executes so a worker that crashed mid-run
recovers.

F4: failRun, finishNodeFailed and MarkRunFailed wrote the terminal status on
the caller's context, which is exactly the context that is already cancelled
when the run failed because of a shutdown or a sibling node — the write was
refused and the run stayed stuck in "running". They now write on a
context.WithoutCancel copy with a 10s timeout; the consumer's best-effort
MarkRunFailed does the same.

F5: peak memory scaled with the host's core count. LP_MAX_WORKERS (default 8)
is now the total window-worker budget of a run and LP_MAX_NODES (default 2) the
node fan-out; each node gets max(1, workers/nodes) through the new
landscape.ComputeWithWorkers. Compute and service.ComputeFunc keep their
signatures: Compute delegates with MaxWorkersPerNode, and a legacy ComputeFunc
handed to NewLandscapeService is wrapped.

F6: the stage loop used a plain errgroup, so a failing node let its siblings
run to completion. It now uses errgroup.WithContext and passes the group
context into runNode, cancelling siblings mid-compute.

F7: wrap every float32 product in an explicit conversion so the compiler
cannot fuse it into an FMA, keeping the kernels bit-identical to numpy's
per-op rounding.

F8: README's builder package list now matches the Dockerfile (adds g++), and
the Landscape section documents the memory model and the two new knobs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 14:44:34 +05:00
bcda76003c fix(datasets): accept BigTIFF headers and sanitise object keys
F1: ValidateFileContent rejected the pipeline's own output. GDAL writes a
BigTIFF header ("II+\0" / "MM\0+") whenever BIGTIFF=IF_SAFER kicks in for a
large raster, so accept both alongside the classic TIFF magic and reword the
error to "file is not a valid TIFF/BigTIFF GeoTIFF". GodalIO.Create now
delegates to an unexported createGTiff so a test can force BIGTIFF=YES and
assert the produced header passes the check.

F3: a user-supplied filename went straight into the S3 object key for dataset
uploads and for both dataset and dataset-group SLD uploads, so "../../x.sld"
escaped the dataset's own prefix. Reduce every such name to its base with a
shared safeObjectName helper, rejecting names with no usable base.

F9: rename the shadowing inner "raw" in the PATCH dg_id case to "s".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 14:44:21 +05:00
6aec00ee29 fix(landscape): accept an empty run body; pin the builder's Alpine release
POST /landscape/runs documents an optional body, but DecodeJSON returned
io.EOF on an empty one and the handler turned that into 400 — breaking the
most common call, an all-defaults run. decodeRunRequest now treats io.EOF as
the zero request; a malformed body is still 400.

The Dockerfile's Alpine ABI coupling was enforced only by a comment: a
floating golang:1.26-alpine builder against a pinned alpine:3.24 runtime
would build green and die at startup on a libgdal soname mismatch as soon as
the Go image rolls forward. Both stages are now pinned to 3.24.

Also: the route-mount test walks the router so all six routes are asserted
(GET /slots and GET /results included), and the spec documents the 404 those
two return when migration 00011's seeded groups are absent.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 14:22:26 +05:00
ad3c9fbdcd feat(landscape): HTTP API, worker consumer, wiring, docs
Adds the /landscape routes (slots, slot upload, runs, run detail, results),
mounts them in the router, wires the landscape repository, job publisher,
godal raster IO and Compute into the composition root, and registers the
gis-landscape-runner consumer in the worker.

Also fixes the Dockerfile so the image actually runs: godal's cgo needs g++,
and the runtime base must match the builder's Alpine release or libgdal's
soname does not resolve.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 14:11:57 +05:00
d74277552f fix(landscape): bound node fan-out, cover override resolution, test the run consumer
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:49:27 +05:00
5fba77b59c feat(landscape): run planning/execution service with fingerprint reuse; RabbitMQ job
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:40:25 +05:00
ff6d5fc412 fix(landscape): bound Compute's per-worker memory and clean up on failure
Review round 1: size per-worker buffers off the largest actual window
instead of WindowSize^2 (avoids allocating ~200+ MiB per worker for
small/partial rasters), cap workers at 8 regardless of GOMAXPROCS, remove
partially-written outputs when a run fails, wrap input-open errors with
node/group context, guard checkGrids against a node with no inputs, and
clamp a non-positive WindowSize so raster.Windows can't loop forever.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:30:23 +05:00
bc524f3d98 feat(dataset-groups): CRUD, latest-in-group, group SLD with dataset fallback, CreateRasterFromFile
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:29:01 +05:00
32eba016b3 feat(landscape): window executor Compute with worker pool and grid checks
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:21:12 +05:00
831ddd1154 feat(landscape): computation graph, params and per-pixel kernels
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:16:17 +05:00
922812b765 feat(datasets): periods (start_date/end_date), dg_id column, date filters; rename observation dates
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:16:07 +05:00
37d4f3519b feat(raster): IO abstraction with godal implementation; cgo Dockerfile
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:14:48 +05:00
5ca6d9e662 feat(landscape): run/node domain, seed migration, repository
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:13:32 +05:00
91c2cab66e docs: Landscape Program implementation plan
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:08:25 +05:00
bea7e116a0 build: pin toolchain go1.26.2 (local SDK is incomplete)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:00:01 +05:00
c930f5928b docs: Landscape Program + dataset groups design spec
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 12:57:53 +05:00
1e0844ca82 feat: Add SLD endpoints, add date_to to vector_with_kato 2026-08-01 22:09:59 +05:00
00a0cd1b8e feat: Add PUT and PATCH datasets endpoints 2026-07-21 00:19:52 +05:00
47b2e8653d fix: Fix processing for vector attributres table 2026-07-10 23:34:19 +05:00
017f869380 feat: Remove geometry and properties from GET /datasets/{id} endpoint, new endpoint for download cog file 2026-07-02 16:27:36 +05:00
d5c291fb9b feat: cache geojson data for vector files 2026-07-01 17:40:25 +05:00
ec8a014e82 feat: Remove redundant GeoJSON formats and return only mapped result for vector_with_kato 2026-07-01 17:29:22 +05:00
6113202704 fix: Mark dataset as failed for PostGIS errors 2026-07-01 16:58:51 +05:00
f74253140f fix: Change geojson properties structure 2026-07-01 00:48:02 +05:00
8d9e11db0c feat: Filters for datasets enpoint 2026-07-01 00:28:07 +05:00
27a8d8b4f5 feat: Districts table and geojson stub 2026-07-01 00:23:22 +05:00
0b45636e5b feat: Districts table and geojson stub 2026-06-30 23:29:31 +05:00
f364ce4c6e fix: Fix vector with KATO geometry 2026-06-28 18:48:24 +05:00
4fdd12e9a3 fix: docker service depends_on 2026-06-28 00:44:15 +05:00
30f7ae1e07 feat: reprocess all command 2026-06-28 00:40:50 +05:00
1e71b94fdb fix: Fix geometry parsing 2026-06-28 00:37:29 +05:00
7c469a524b feat: Add reprocess command 2026-06-27 23:30:54 +05:00
ae32d9067d fix: Platform arch for postgres 2026-06-27 19:51:15 +05:00
bcfb27ea4d fix: Platform arch for postgres 2026-06-27 19:48:59 +05:00
148d1fb841 fix: Code for category 2026-06-27 19:35:53 +05:00
46add88fd5 fix: Fix entrypoint 2026-06-25 01:26:16 +05:00
e0a902f498 feat: Docker compose worker server 2026-06-25 01:23:20 +05:00
ddbf41dbeb Second checkpoint 2026-06-25 01:19:59 +05:00
9cf791b789 Second checkpoint 2026-06-25 01:17:42 +05:00
854ef138d0 First checkpoint 2026-06-04 20:52:28 +05:00
b08e71b3bb First checkpoint 2026-06-04 19:26:38 +05:00