Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
adac335
fix(config/auth): add util to prevent double slashes
TylerAdamMartinez Jul 20, 2026
5d46d28
test(cypress): add new tests & remove old tests
TylerAdamMartinez Jul 20, 2026
31a840d
Merge pull request #314 from DataIntegrationGroup/task/bdms-937-creat…
TylerAdamMartinez Jul 23, 2026
0a15a2b
feat(biome.json): update toolchain from eslint & prittier to just biome
TylerAdamMartinez Jul 23, 2026
61558c8
BDMS-878: wire geothermal routes/resources + provider auth (Phase 0)
jirhiker Jul 10, 2026
38a430c
BDMS-878: extract reusable EditableDataGrid (Phase 1)
jirhiker Jul 21, 2026
53fc863
BDMS-878: geothermal records data-entry grid (Phase 2)
jirhiker Jul 21, 2026
2726271
BDMS-878: explicit batch save for records grid (Phase 3)
jirhiker Jul 21, 2026
c38c681
BDMS-878: enter new records inline in the grid (Phase 4)
jirhiker Jul 21, 2026
ed8da3b
BDMS-878: tests for records-grid logic + geothermal write errors
jirhiker Jul 21, 2026
c67c079
Show Example nav so the Data Grid (glide editor) is reachable
jirhiker Jul 21, 2026
584e74d
Rename sidebar "Example" nav section to "Sandbox"
jirhiker Jul 21, 2026
bbe07d0
BDMS-878: add Geothermal Records grid to the Sandbox nav
jirhiker Jul 21, 2026
0b8841b
BDMS-878: bypass Geothermal.Admin gate in local dev
jirhiker Jul 21, 2026
5ee85fe
Point geothermal API default at localhost:8000
jirhiker Jul 21, 2026
19184c3
Point geothermal grid at thing/geothermal-well endpoints
jirhiker Jul 21, 2026
09b770f
Fix geothermal getList for paginated envelope (grid picker crash)
jirhiker Jul 22, 2026
cb6e8ea
Map geothermal wells to real API fields (snake_case)
jirhiker Jul 22, 2026
f90af4c
Add geothermal well inventory feature spec (draft)
jirhiker Jul 25, 2026
fb5d0a8
BDMS-878: geothermal well inventory grid — direct entry (P1)
jirhiker Jul 25, 2026
9e855dc
Fix CI access-control matrix + address review feedback
jirhiker Jul 25, 2026
53bad90
BDMS-878: batch-create wells from the inventory grid (P2)
jirhiker Jul 25, 2026
9395344
BDMS-878: CSV load for the well inventory grid (P3)
jirhiker Jul 25, 2026
4d866cb
BDMS-878: dropdown/boolean cells + required validation (P4)
jirhiker Jul 26, 2026
facb306
BDMS-878: county/state are server-derived from lat/lon (not required)
jirhiker Jul 27, 2026
03c241d
BDMS-878: "Save for later" caches the inventory grid locally
jirhiker Jul 27, 2026
281913d
BDMS-878: show row numbers in the inventory grid
jirhiker Jul 27, 2026
79a0965
BDMS-878: map location picker + coord display for inventory
jirhiker Jul 27, 2026
e6dc7ee
Merge pull request #317 from DataIntegrationGroup/task/update-linting…
TylerAdamMartinez Jul 27, 2026
5732c51
feat(package): add unsafe lintting and formatting options
TylerAdamMartinez Jul 27, 2026
8139393
BDMS-878: column header tooltips for the inventory grid
jirhiker Jul 27, 2026
4f89965
Add geothermal gap analysis vs the legacy NM_Wells DB
jirhiker Jul 27, 2026
490f3b2
BDMS-878: expand well model — location, header, structured API (G2/G3…
jirhiker Jul 27, 2026
e323d56
BDMS-878: single-well Create Well form for the inventory
jirhiker Jul 27, 2026
6d47381
BDMS-878: move map picker into Create Well form; grid fixes
jirhiker Jul 27, 2026
ac8456b
BDMS-878: temperature-depth log grid + CSV importer (G1)
jirhiker Jul 27, 2026
0b1bdb4
BDMS-878: auto-set datum to WGS84 when picking location on the map
jirhiker Jul 27, 2026
0f37055
BDMS-878: collapse PLSS into one regex-validated field
jirhiker Jul 27, 2026
11cb8d9
BDMS-878: temp-depth chart + hover validation errors with guidance
jirhiker Jul 27, 2026
08f90bb
BDMS-878: plot any measurement vs depth (selectable series)
jirhiker Jul 27, 2026
5c5741c
BDMS-878: edit an existing grid row via the side panel
jirhiker Jul 27, 2026
d6035bf
chore(docs/tests/ci-test-suite): init file
TylerAdamMartinez Jul 27, 2026
976e455
BDMS-878: show Sandbox nav on preview deploys
jirhiker Jul 27, 2026
f90eca5
BDMS-878: code cleanup — dedupe pickers, dead code, stale docs, tests
jirhiker Jul 27, 2026
c98ea25
Delete the Glide Data Grid specimen page
jirhiker Jul 27, 2026
bd38731
Ignore personal/ephemeral Claude Code files
jirhiker Jul 27, 2026
7915aa0
chore(ci-test-suite): update markdown formatting
TylerAdamMartinez Jul 28, 2026
8fcce46
Add demo mode to hydrograph correction page
jirhiker Jul 28, 2026
403b151
Remove supported-formats caption from correction workbench
jirhiker Jul 28, 2026
577c5da
docs(tests/ci-test-suite): add section Backend Changes That Can Break…
TylerAdamMartinez Jul 28, 2026
9e8dcfa
docs(tests/ci-test-suite): update outdated backend repo name
TylerAdamMartinez Jul 28, 2026
b894a4f
Port wellpy preprocessing into the hydrograph corrector
jirhiker Jul 28, 2026
01b6943
Add a Diver Office water-head demo to the hydrograph corrector
jirhiker Jul 28, 2026
83c36ea
Add a data table view to the correction workbench
jirhiker Jul 28, 2026
500c093
Add a separate raw water-head plot for Diver uploads
jirhiker Jul 28, 2026
06bda3a
Add proposed API contract for uploading corrected transducer data
jirhiker Jul 28, 2026
3124f24
Theme the hydrograph correction UI to match the app
jirhiker Jul 28, 2026
e7db2e9
Merge pull request #319 from DataIntegrationGroup/task/BDMS-1084-test…
TylerAdamMartinez Jul 28, 2026
66ed222
BDMS-878: open geothermal pages to all users on preview deploys
jirhiker Jul 28, 2026
735c04d
Add a Wellntel demo with spurious-reflection removal
jirhiker Jul 28, 2026
3ffb8dc
Handle 1x/2x and adjacent spurious reflections
jirhiker Jul 28, 2026
d159e3d
Add interpolation across removed reflections
jirhiker Jul 28, 2026
955cee1
Add a Wellntel ingest dialog to the hydrograph corrector
jirhiker Jul 28, 2026
632f05d
Document Wellntel ingestion endpoints in the API contract
jirhiker Jul 28, 2026
56da56d
Implement the Wellntel data provider from the wellpy client
jirhiker Jul 28, 2026
aa4af78
Add Publish to Ocotillo implementing the upload contract
jirhiker Jul 28, 2026
c59174e
Add Diver-HUB ingestion to the hydrograph corrector
jirhiker Jul 29, 2026
4b71490
Collapse the demo buttons into a split-button group
jirhiker Jul 29, 2026
39b458f
Collapse the ingest buttons into a split-button group
jirhiker Jul 29, 2026
72e67b3
Flag interpolated observations with per-point correction notes
jirhiker Jul 29, 2026
43309c7
Make offset removal robust to spikes and noise
jirhiker Jul 29, 2026
c9b588c
Turn the workbench side panel into accordions
jirhiker Jul 29, 2026
570fb53
Remove the workbench Upload section
jirhiker Jul 29, 2026
61e9b1a
Make Reset restore the original dataset completely
jirhiker Jul 29, 2026
daf7fd9
Surface Reset to Original in the workbench header
jirhiker Jul 29, 2026
87c0920
Annotate every corrected observation with what changed
jirhiker Jul 29, 2026
b2ee820
Add gap analysis against real wellpy artifacts
jirhiker Jul 29, 2026
e5f997f
Fix Diver Office CSV parsing for real exports
jirhiker Jul 29, 2026
328a5cb
Add field data logger telemetry parser
jirhiker Jul 29, 2026
95a0c80
Add running-baseline reflection detection for dense clusters
jirhiker Jul 29, 2026
63092c4
Support single-anchor water-head conversion
jirhiker Jul 29, 2026
3af235a
Add drift and overpressurization QC warnings
jirhiker Jul 29, 2026
de460ba
Add temperature-aware reflection assist
jirhiker Jul 29, 2026
d498ea7
Use the real wellpy artifacts as the demo datasets
jirhiker Jul 29, 2026
f77f085
Add UI modes and rework the hydrograph corrector layout
jirhiker Aug 4, 2026
ea6c132
Lock the corrector to Simple mode and tidy the chart tooltip
jirhiker Aug 4, 2026
07d8289
Fix loading, empty, and error states on the OSE POD and USGS cards
jirhiker Aug 4, 2026
e2bf2f1
Present the OSE POD and USGS cards as summaries, not attribute dumps
jirhiker Aug 4, 2026
ad4a25d
Replace the indigo primary with an on-brand Ocotillo blue
jirhiker Aug 4, 2026
66d1e18
Replace the favicon with the ocotillo mark
jirhiker Aug 4, 2026
79fa9c3
Merge pull request #318 from DataIntegrationGroup/BDMS-878-geothermal…
jirhiker Aug 4, 2026
b821bdc
Unify the favicon with the UI palette
jirhiker Aug 4, 2026
467df04
Merge pull request #324 from DataIntegrationGroup/feat/on-brand-color…
jirhiker Aug 5, 2026
65bdc15
Merge pull request #320 from DataIntegrationGroup/hydrograph-correcto…
jirhiker Aug 5, 2026
8f725db
Merge pull request #323 from DataIntegrationGroup/fix/well-show-osepo…
jirhiker Aug 5, 2026
bda3a83
BDMS-903: open well show pages in new windows from the well list
jirhiker Aug 5, 2026
0846b00
Merge pull request #325 from DataIntegrationGroup/BDMS-903-open-well-…
jirhiker Aug 5, 2026
1c6056d
Roll back the ocotillo favicon
jirhiker Aug 5, 2026
50cf96f
Merge pull request #327 from DataIntegrationGroup/fix/revert-ocotillo…
jirhiker Aug 5, 2026
f874996
fix(routes): update location routes to match accessControl
TylerAdamMartinez Aug 6, 2026
aee0446
BDMS-878: show Sandbox nav on staging deploys
jirhiker Aug 6, 2026
169a45b
Merge pull request #329 from DataIntegrationGroup/BDMS-878-geothermal…
jirhiker Aug 6, 2026
5795a96
Merge pull request #328 from DataIntegrationGroup/task/bdms-1077-audi…
TylerAdamMartinez Aug 6, 2026
9cc3558
docs(adr): add ADR 0001 on contextual media mapping (BDMS-901)
jirhiker Aug 6, 2026
78f17c8
Add ADR for well ID minting service
jirhiker Aug 6, 2026
3e0546e
Adopt docs/adr/NNNN-kebab-title.md ADR convention
jirhiker Aug 6, 2026
5507744
Renumber well ID minting ADR to 0002
jirhiker Aug 6, 2026
aff3421
Fix stale Summary: minting lives on a Field Planning page
jirhiker Aug 6, 2026
e0bfcb9
Link the Field Planning mockup from the ADR
jirhiker Aug 6, 2026
ea53512
ci(staging): add workflow_dispatch trigger to staging deploy
jirhiker Aug 6, 2026
3d55d1d
fix(usgs): read site metadata from the OGC API instead of NWIS RDB
jirhiker Aug 7, 2026
7b3a656
fix(ci): actually remove the preview origin from authentik on PR close
jirhiker Aug 7, 2026
eb3f83a
docs(agents): add AGENTS.md with model attribution requirement
jirhiker Aug 7, 2026
8aebe11
BDMS-1067: add basemap switcher to the well show map
jirhiker Aug 7, 2026
f02a1e6
BDMS-811: replace Mapbox with MapLibre
jirhiker Aug 7, 2026
c22a52b
fix(well-show): render frequency rows as div, not p
jirhiker Aug 7, 2026
5eedf24
docs(adr): ADR 0003 and 0004 - offline support
jirhiker Aug 7, 2026
a74610d
docs(adr): ADR 0003 and 0004 - offline support
jirhiker Aug 7, 2026
83b8bf3
fix(settings): point geothermal API at the Ocotillo API URL
jirhiker Aug 7, 2026
82f0094
Merge pull request #338 from DataIntegrationGroup/fix/geothermal-api-url
jirhiker Aug 7, 2026
fa07d8c
fix(access-control): open hydrograph correction to AMP.Editor
jirhiker Aug 7, 2026
88e0cc2
Merge pull request #339 from DataIntegrationGroup/fix/hydrograph-corr…
jirhiker Aug 7, 2026
bf24fe3
feat(hydrograph): manual measurement table, stored-data deletion, fie…
jirhiker Aug 7, 2026
96f2b8b
fix(hydrograph): keep zoom and brush across chart rebuilds, scroll th…
jirhiker Aug 7, 2026
67bf4cb
refactor(hydrograph): stabilise the chart option so it can be merged,…
jirhiker Aug 7, 2026
4162efb
Merge pull request #340 from DataIntegrationGroup/feature/hydro-corre…
jirhiker Aug 7, 2026
402cafb
fix(hydrograph): anchor corrections on the manual measurement time, n…
jirhiker Aug 10, 2026
14a950d
fix(hydrograph): give the converted trace a vertex at each manual mea…
jirhiker Aug 10, 2026
3ea92ec
fix(hydrograph): only anchor sensor depth on manuals inside the logge…
jirhiker Aug 10, 2026
4a0e06e
Merge pull request #341 from DataIntegrationGroup/feature/snap-to-man…
jirhiker Aug 10, 2026
64e5e72
feat(geothermal): replace the well dropdown with a search interface
jirhiker Aug 10, 2026
7382ea1
chore(api-types): regenerate from the current schema
jirhiker Aug 10, 2026
fcbc7d9
Merge pull request #343 from DataIntegrationGroup/BDMS-1133
jirhiker Aug 10, 2026
eebe1b8
Merge remote-tracking branch 'origin/staging' into BDMS-811-replace-m…
jirhiker Aug 11, 2026
17437fb
chore(maplibre): drop stale Mapbox config and docs
jirhiker Aug 11, 2026
cc8701d
Merge pull request #336 from DataIntegrationGroup/BDMS-811-replace-ma…
jirhiker Aug 13, 2026
24b2ba9
Merge pull request #333 from DataIntegrationGroup/BDMS-1110-Bug-The-U…
jirhiker Aug 13, 2026
c21a26c
Merge pull request #334 from DataIntegrationGroup/chore/cd-preview-au…
jirhiker Aug 13, 2026
74c93d6
task(analytics-disclosure): add disclosure to the sign in to authenti…
TylerAdamMartinez Aug 14, 2026
042b5df
fix(analytics-disclosure): add disclouse to the authentik sidebar
TylerAdamMartinez Aug 14, 2026
6f9d6d4
fix(analytics-disclosure): update verbage of disclosure statement
TylerAdamMartinez Aug 14, 2026
3aceec2
Merge pull request #345 from DataIntegrationGroup/task/bdms-994-mvp-p…
TylerAdamMartinez Aug 14, 2026
eb76065
Merge pull request #332 from DataIntegrationGroup/claude/cancel-githu…
jirhiker Aug 17, 2026
c81f0d3
Merge branch 'staging' into well-id-minting
jirhiker Aug 17, 2026
432e6c9
Merge pull request #331 from DataIntegrationGroup/well-id-minting
jirhiker Aug 17, 2026
64f893c
Merge pull request #337 from DataIntegrationGroup/offline-support-adrs
jirhiker Aug 17, 2026
632a77c
Merge pull request #330 from DataIntegrationGroup/BDMS-901-Contextual…
jirhiker Aug 17, 2026
9b97560
docs(public-page): add public page content audit
TylerAdamMartinez Aug 19, 2026
5fd11f6
chore(public-page): rm description of Ocotillo requirement
TylerAdamMartinez Aug 20, 2026
b309a4e
ci(cypress): stop waiting on an API container that already died
jirhiker Aug 21, 2026
399cd9d
Merge pull request #351 from DataIntegrationGroup/ci/cypress-seed-ref…
jirhiker Aug 21, 2026
08da678
feat(map): color map symbols with the viridis palette
jirhiker Aug 21, 2026
4a39b89
Potential fix for pull request finding
jirhiker Aug 21, 2026
35f3a6f
fix(map): clamp infinite ramp positions to the nearer end
jirhiker Aug 21, 2026
00e8205
ci(preview): on-demand previews from any branch, teardown, ephemeral …
jirhiker Aug 21, 2026
7da7989
fix(preview): stop envsubst freezing the seed flag into the startup s…
jirhiker Aug 21, 2026
a987f53
fix(preview): stop printing the authentik provider secret into run logs
jirhiker Aug 21, 2026
03ca65a
ci(preview): trigger an ephemeral-backend preview run
jirhiker Aug 21, 2026
6652ce3
ci(preview): surface container logs when an ephemeral backend fails t…
jirhiker Aug 21, 2026
4d8c344
fix(preview): give the ephemeral API the pygeoapi database settings
jirhiker Aug 21, 2026
d0ed57f
feat(map): add place/address geocoder search to the map view
jirhiker Aug 21, 2026
4827b88
ci(preview): halve ephemeral backend sizing and reap it when unwanted
jirhiker Aug 21, 2026
ee4b4f9
fix(geocode): disambiguate Photon results that share a label
jirhiker Aug 21, 2026
55b4e26
Merge pull request #352 from DataIntegrationGroup/ci/bdms-1173-on-dem…
jirhiker Aug 21, 2026
7fd2f29
refactor(map-layers): match OGC collections exactly and drop unpublis…
jirhiker Aug 22, 2026
fef6720
docs: add CLAUDE.md pointing at the agent guide
jirhiker Aug 22, 2026
1e7b505
chore(nav): drop the Sandbox concept
jirhiker Aug 22, 2026
beb14e0
Merge pull request #358 from DataIntegrationGroup/chore/remove-sandbo…
jirhiker Aug 23, 2026
f75b994
Merge pull request #350 from DataIntegrationGroup/BDMS-349-viridis-ma…
jirhiker Aug 24, 2026
6aa55a3
Merge branch 'staging' into chore/bdms-977-978-979-trim-public-ogcapi…
jirhiker Aug 24, 2026
0986a23
chore(map-layers): drop the depth colour ramp the merge left unused
jirhiker Aug 24, 2026
8a4e821
feat(map-layers): register the six geothermal collections
jirhiker Aug 22, 2026
766c06f
feat(collections): offer desktop GIS downloads on the datasets page
jirhiker Aug 23, 2026
9ea3344
feat(collections): add a table view and make it the default
jirhiker Aug 23, 2026
f2de39f
Merge pull request #349 from DataIntegrationGroup/task/bdms-1156-eval…
TylerAdamMartinez Aug 24, 2026
420bb2f
Merge pull request #353 from DataIntegrationGroup/claude/geocoder-map…
jirhiker Aug 24, 2026
bb90620
Merge pull request #359 from DataIntegrationGroup/feature/gis-artifac…
jirhiker Aug 24, 2026
ebd5e87
chore(release): prepare v1.2.0
jirhiker Aug 24, 2026
8af90c6
Merge branch 'production' into release/v1.2.0
jirhiker Aug 24, 2026
b416371
Merge pull request #361 from DataIntegrationGroup/release/v1.2.0
jirhiker Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .claude/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.0.1",
"configurations": [
{
"name": "dev",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev"],
"port": 5173
}
]
}
10 changes: 8 additions & 2 deletions .env.development.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
VITE_APP_TITLE="Ocotillo (Dev)"
VITE_NMBGMR_AMP_API_URL=
VITE_NMBGMR_GEOTHERMAL_API_URL=
VITE_OCOTILLO_API_URL=
VITE_REFINE_PROJECT_ID=
VITE_MAPBOX_TOKEN=
VITE_POSTHOG_KEY=
VITE_POSTHOG_HOST=https://us.i.posthog.com
VITE_APP_TIMEZONE=America/Denver
Expand All @@ -12,3 +10,11 @@ VITE_AUTHENTIK_CLIENT_ID=
VITE_AUTHENTIK_URL=
VITE_AUTHENTIK_REDIRECT_URI=
VITE_TEST_AUTH=true

# Wellntel analytics API (direct access, ported from wellpy)
VITE_WELLNTEL_API_URL=
VITE_WELLNTEL_API_KEY=

# Diver-HUB (VanEssen GroundwaterOnline) API
VITE_DIVERHUB_API_URL=
VITE_DIVERHUB_API_KEY=
10 changes: 8 additions & 2 deletions .env.devserver.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
VITE_APP_TITLE="Ocotillo"
VITE_NMBGMR_AMP_API_URL=
VITE_NMBGMR_GEOTHERMAL_API_URL=
VITE_OCOTILLO_API_URL=
VITE_API_URL=
VITE_REFINE_PROJECT_ID=
VITE_MAPBOX_TOKEN=
VITE_POSTHOG_KEY=
VITE_POSTHOG_HOST=https://us.i.posthog.com
VITE_APP_ENV=development
Expand All @@ -14,3 +12,11 @@ VITE_APP_TIMEZONE=America/Denver
VITE_AUTHENTIK_CLIENT_ID=
VITE_AUTHENTIK_URL=
VITE_AUTHENTIK_REDIRECT_URI=

# Wellntel analytics API (direct access, ported from wellpy)
VITE_WELLNTEL_API_URL=
VITE_WELLNTEL_API_KEY=

# Diver-HUB (VanEssen GroundwaterOnline) API
VITE_DIVERHUB_API_URL=
VITE_DIVERHUB_API_KEY=
10 changes: 8 additions & 2 deletions .env.production.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
VITE_APP_TITLE="Ocotillo"
VITE_NMBGMR_AMP_API_URL=
VITE_NMBGMR_GEOTHERMAL_API_URL=
VITE_OCOTILLO_API_URL=
VITE_API_URL=
VITE_REFINE_PROJECT_ID=
VITE_MAPBOX_TOKEN=
VITE_POSTHOG_KEY=
VITE_POSTHOG_HOST=https://us.i.posthog.com
VITE_APP_ENV=production
Expand All @@ -16,3 +14,11 @@ VITE_APP_TIMEZONE=America/Denver
VITE_AUTHENTIK_CLIENT_ID=
VITE_AUTHENTIK_URL=
VITE_AUTHENTIK_REDIRECT_URI=

# Wellntel analytics API (direct access, ported from wellpy)
VITE_WELLNTEL_API_URL=
VITE_WELLNTEL_API_KEY=

# Diver-HUB (VanEssen GroundwaterOnline) API
VITE_DIVERHUB_API_URL=
VITE_DIVERHUB_API_KEY=
168 changes: 168 additions & 0 deletions .github/preview/api-service.tmpl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Cloud Run service spec for an ephemeral preview backend.
#
# This is the docker-compose stack the Cypress job runs (OcotilloAPI "app" +
# postgis "db") re-expressed as a single multi-container Cloud Run service.
# Sidecars share a network namespace, so "db" becomes 127.0.0.1:5432.
#
# Rendered by _preview_deploy.yml with envsubst and an explicit variable
# allowlist -- every other $VAR below is meant to be evaluated at runtime by the
# container shell, not at render time. Render-time placeholders all carry a
# TPL_ prefix precisely so they cannot collide with a runtime variable:
# envsubst substitutes $VAR as readily as ${VAR}, so an allowlisted name that
# also appears in the startup script would get frozen at render time.
#
# The database is an in-memory tmpfs. Everything in it is lost when the instance
# restarts. That is the point: these previews are disposable.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: ${TPL_API_SERVICE_NAME}
labels:
preview: "true"
preview-branch: ${TPL_SANITIZED_BRANCH}
preview-role: api
preview-expires: "${TPL_EXPIRES_AT}"
annotations:
run.googleapis.com/ingress: all
spec:
template:
metadata:
annotations:
# One always-warm instance: the database lives in that instance's
# memory, so scaling to zero or out to two would lose or fork the data.
autoscaling.knative.dev/minScale: "1"
autoscaling.knative.dev/maxScale: "1"
# Postgres needs CPU between requests to run its background workers.
run.googleapis.com/cpu-throttling: "false"
run.googleapis.com/execution-environment: gen2
run.googleapis.com/container-dependencies: '{"api":["db"]}'
spec:
containerConcurrency: 40
timeoutSeconds: 300
containers:
- name: db
image: postgis/postgis:17-3.5
env:
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: POSTGRES_DB
value: ocotillo_preview
# PGDATA has to be a subdirectory of the mount: the postgis
# entrypoint refuses to initialise into a non-empty directory, and
# a fresh mount point is not guaranteed to look empty to it.
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: pgdata
mountPath: /var/lib/postgresql/data
resources:
limits:
cpu: "1"
memory: 2Gi
startupProbe:
tcpSocket:
port: 5432
periodSeconds: 5
# Cloud Run rejects a probe whose timeout exceeds its period.
timeoutSeconds: 3
failureThreshold: 60

- name: api
image: ${TPL_API_IMAGE}
ports:
- name: http1
containerPort: 8000
env:
- name: MODE
value: development
- name: POSTGRES_HOST
value: 127.0.0.1
- name: POSTGRES_PORT
value: "5432"
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: POSTGRES_DB
value: ocotillo_preview
- name: AUTHENTIK_DISABLE_AUTHENTICATION
value: "${TPL_DISABLE_AUTH}"
- name: AUTHENTIK_URL
value: https://authentik.newmexicowaterdata.org/application/o/ocotillo/
- name: AUTHENTIK_AUTHORIZE_URL
value: https://authentik.newmexicowaterdata.org/application/o/authorize/
- name: AUTHENTIK_TOKEN_URL
value: https://authentik.newmexicowaterdata.org/application/o/token/
- name: AUTHENTIK_CLIENT_ID
value: "${TPL_AUTHENTIK_CLIENT_ID}"
# create_api_app() mounts pygeoapi unconditionally -- the
# MOUNT_PYGEOAPI_IN_API flag in OcotilloAPI's app.yaml reads like an
# opt-out but no Python reads it. Of these, only the password is
# actually required: host/port/db/user each fall back to their
# POSTGRES_* equivalent, while the password is checked for None with
# no fallback and aborts boot. Set the full block anyway, to match
# docker-compose.yml and to keep the next reader out of pygeoapi.py.
- name: PYGEOAPI_POSTGRES_HOST
value: 127.0.0.1
- name: PYGEOAPI_POSTGRES_PORT
value: "5432"
- name: PYGEOAPI_POSTGRES_DB
value: ocotillo_preview
- name: PYGEOAPI_POSTGRES_USER
value: postgres
- name: PYGEOAPI_POSTGRES_PASSWORD
value: postgres
- name: APP_VERSION
value: "${TPL_API_SOURCE_SHA}"
- name: RUN_SEED
value: "${TPL_RUN_SEED}"
# Replaces entrypoint.sh so the seed can run between the migration and
# uvicorn. Cloud Run has no exec, so this is the only hook available.
command:
- sh
- -c
args:
- |
set -e

until PGPASSWORD="$POSTGRES_PASSWORD" pg_isready \
-h "$POSTGRES_HOST" -p "$POSTGRES_PORT" \
-U "$POSTGRES_USER" -d "$POSTGRES_DB"; do
echo "Waiting for postgres at $POSTGRES_HOST:$POSTGRES_PORT..."
sleep 2
done

echo "Applying migrations..."
alembic upgrade head

if [ "$RUN_SEED" = "true" ]; then
echo "Seeding preview database..."
# A seed failure leaves an empty-but-working API, which is more
# useful for a preview than no API at all.
python -m transfers.seed || echo "WARNING: seed failed; continuing with an empty database"
fi

echo "Starting the application..."
exec uvicorn main:app --host 0.0.0.0 --port 8000
# A preview serves a handful of reviewers, and the expensive part of
# startup (migrate + seed) measured in seconds, not minutes. Sized to
# keep the always-warm instance cheap rather than fast.
resources:
limits:
cpu: "1"
memory: 1536Mi
startupProbe:
tcpSocket:
port: 8000
periodSeconds: 10
timeoutSeconds: 5
# Migration + seed can take several minutes on a cold instance.
failureThreshold: 90

volumes:
- name: pgdata
emptyDir:
medium: Memory
sizeLimit: 1Gi
Loading
Loading