Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9091d0e
fix documentation for running locally (#84)
voj Mar 23, 2026
9492002
docs: add Strawberry migration log + Phase 0 inventory (solvis, final…
chrisbc Jun 23, 2026
ef51476
chore: migrate Poetry → uv, flake8/black/isort → ruff
chrisbc Jun 23, 2026
47ff2c3
Merge pull request #87 from GNS-Science/poetry2uv
chrisbc Jun 24, 2026
1ca0440
Phase 0: baseline legacy Graphene SDL as migration parity target
chrisbc Jun 24, 2026
1fc51d2
Phase 0: vendor client-query corpus (test-sourced) + replay gate
chrisbc Jun 24, 2026
176a2ae
Phase 0: extend corpus with kororaa frontend queries (gateway -> solvis)
chrisbc Jun 24, 2026
d2a5c6e
Phase 1: stacked-PR CI fix + yarn supply-chain age gate
chrisbc Jun 24, 2026
6e1e86c
Phase 1: FastAPI/Mangum scaffold + container entry swap to Mangum
chrisbc Jun 24, 2026
5847bb7
Phase 2a: PynamoDB -> pydantic + boto3 (keep BinaryLargeObject wrappe…
chrisbc Jun 24, 2026
6b7a14e
Phase 2b: port Graphene schema to Strawberry at byte-identical SDL pa…
chrisbc Jun 24, 2026
f7e640a
Phase 3a: differential parity harness + rupture-detail resolvers
chrisbc Jun 24, 2026
6fd8e37
Phase 3b(i): implement filter_ruptures pagination (differential parity)
chrisbc Jun 24, 2026
c98f39d
Phase 3b: CompositeRuptureSections + node; runtime parity complete
chrisbc Jun 24, 2026
7922243
Phase 4: deploy/CI/deps hardening (clean pass)
chrisbc Jun 24, 2026
c1c2b5e
Phase 5: pre-stage cutover plan (deploy held for creds + go-ahead)
chrisbc Jun 24, 2026
766904f
fix(ci): drop follow_untyped_imports (poetry2uv regression) + SetOper…
chrisbc Jun 24, 2026
3334e10
Merge Graphene→Strawberry migration (Phases 0–5) into deploy-test
chrisbc Jun 24, 2026
a2b42b4
Merge pull request #95 from GNS-Science/migrate/strawberry-combined
chrisbc Jun 24, 2026
cb56c61
fix(app): guard serverless-plugin-warmup event in Mangum handler
chrisbc Jun 24, 2026
9d8760f
docs: consolidate PHASE5_CUTOVER into MIGRATION_LOG + log A/B 9/9 + w…
chrisbc Jun 25, 2026
2b399c3
Merge pull request #96 from GNS-Science/docs/migration-log-consolidation
chrisbc Jun 25, 2026
1caad74
Merge main into deploy-test (forward-port #85 + deploy-workflow fix; …
chrisbc Jun 25, 2026
090c3c2
ci: restore the deliberate dev.yml branches:[main,deploy-test] filter
chrisbc Jun 25, 2026
504e61f
chore(cleanup): delete dead Flask/serverless-wsgi entry
chrisbc Jun 25, 2026
e680ddf
cleanup(1/n): de-graphene colour scale
chrisbc Jun 25, 2026
d4e86b0
cleanup(2/n): de-graphene locations_by_id
chrisbc Jun 25, 2026
2498448
cleanup(3/n): de-graphene filter_ruptures pagination
chrisbc Jun 25, 2026
59b4dbe
cleanup(4/n): de-graphene CompositeRuptureSections resolvers
chrisbc Jun 25, 2026
9c89008
cleanup(5/n): relocate rupture_detail + apply_geojson_style graphene-…
chrisbc Jun 25, 2026
45f3f59
cleanup(6/n): run the test suite against Strawberry; drop graphene fr…
chrisbc Jun 25, 2026
6d27df0
cleanup(7/n): delete the legacy graphene modules — package is graphen…
chrisbc Jun 26, 2026
474e81c
cleanup(8/n): rename strawberry_schema.py -> schema.py
chrisbc Jun 26, 2026
c998c46
cleanup(9/n): drop the legacy graphene/flask dependencies
chrisbc Jun 26, 2026
a30b08d
docs(migration-log): record the legacy-graphene cleanup (PR #98)
chrisbc Jun 26, 2026
cc88a79
fix(tests): structural assertions for geometry/geojson snapshot tests…
chrisbc Jun 26, 2026
ecf0f3b
fix(tests): structural assertion for get_locations (drop 118k-line sn…
chrisbc Jun 26, 2026
ffeda01
Merge pull request #98 from GNS-Science/chore/remove-legacy-graphene
chrisbc Jun 26, 2026
1475e21
test: close the coverage gap from the de-graphene cleanup
chrisbc Jun 26, 2026
aa9a0e0
Merge pull request #99 from GNS-Science/test/coverage-gap
chrisbc Jun 26, 2026
02c4fc2
test: run the SDL parity gate as a CI test (covers schema_parity tool)
chrisbc Jun 26, 2026
c8d6b51
Merge pull request #100 from GNS-Science/test/coverage-gap-2
chrisbc Jun 26, 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
20 changes: 9 additions & 11 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
approvedGitRepositories:
- "**"

enableScripts: true

npmMinimalAgeGate: 7d
nodeLinker: node-modules

# Supply-chain hardening (runbook §4.6): refuse npm packages younger than 7 days,
# but allow project-internal packages through so dev velocity isn't blocked.
npmMinimalAgeGate: "7d"
npmPreapprovedPackages:
- nshm-*
- nzshm-*
- solvis-*
- weka-*
- toshi-*
- "nshm-*"
- "nzshm-*"
- "solvis-*"
- "weka-*"
- "toshi-*"
2 changes: 1 addition & 1 deletion DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public.ecr.aws/lambda/python:3.12
```

### Update the requirements
uv export --format requirements-txt --no-emit-project > requirements.txt
uv export --no-hashes --no-emit-project --format requirements-txt > requirements.txt

### test wsgi handlers

Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN dnf install git-core -y &&\
dnf remove git-core -y &&\
dnf clean all

# lambda entry point
CMD ["solvis_graphql_api.solvis_graphql_api.app"]
ENTRYPOINT ["/bin/bash", "-c"]
# lambda entry point — Mangum handler (was the serverless-wsgi handler.py workaround).
# ENTRYPOINT is the base image's Runtime Interface Client (/lambda-entrypoint.sh); CMD is
# the handler. Matches serverless.yml functions.ecr-app.image.{entryPoint,command}.
CMD ["solvis_graphql_api.app.handler"]
4 changes: 2 additions & 2 deletions MIGRATION_v0.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Since version v0.9.x this API uses a dynamoDB/S3 data_store for the CompositeRup
Below is the one-time script output from the cli which creates the table and pushes up the archive file.

```
% AWS_PROFILE=chrisbc S3_BUCKET_NAME=nzshm22-solvis-graphql-api-prod REGION=ap-southeast-2 DEPLOYMENT_STAGE=prod poetry run cli -T -R ~/Downloads/NSHM_v1.0.4_CompositeSolution.zip NSHM_v1.0.4
% AWS_PROFILE=chrisbc S3_BUCKET_NAME=nzshm22-solvis-graphql-api-prod REGION=ap-southeast-2 DEPLOYMENT_STAGE=prod uv run cli -T -R ~/Downloads/NSHM_v1.0.4_CompositeSolution.zip NSHM_v1.0.4
WARNING: optional `toshi` dependencies are not installed.
Running without `toshi` options
WARNING: geometry.section_distance() uses the optional dependency pyvista.
Expand All @@ -31,7 +31,7 @@ solvis_graphql_api cli uploaded solvis composite solution <solvis_graphql_api.da
And below is the A/B test showing that Prod/Test APIs are working and agree.

```
chrisbc@MLX01 solvis-graphql-api % poetry run cli_ab_test WORK/ab.toml -A prod -B test -v
chrisbc@MLX01 solvis-graphql-api % uv run cli_ab_test WORK/ab.toml -A prod -B test -v
WARNING: optional `toshi` dependencies are not installed.
Running without `toshi` options
config `WORK/ab.toml` has service keys: dict_keys(['prod', 'test', 'dev'])
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Java is required .


```
uv sync
uv sync --all-groups
```

Make sure the dynamodb plugin for local tests is installed
Expand All @@ -39,15 +39,15 @@ yarn sls dynamodb install
### Run full stack locally

```
npx serverless dynamodb start --stage local &\
npx serverless s3 start &\
SLS_OFFLINE=1 uv run yarn sls wsgi serve
# npx serverless dynamodb start --stage local &\
# npx serverless s3 start &\
SLS_OFFLINE=1 uv run uvicorn solvis_graphql_api.app:app --reload
```

then

```
AWS_PROFILE=*** SLS_OFFLINE=1 uv run python ./solvis_graphql_api/scripts/cli.py WORKING/NSHM_v1.0.4_CompositeSolution.zip NSHM_v1.0.4 -R --ensure_table
AWS_PROFILE=*** SLS_OFFLINE=1 uv run cli WORKING/NSHM_v1.0.4_CompositeSolution.zip NSHM_v1.0.4 -R --ensure_table
```

### Unit tests
Expand All @@ -58,5 +58,5 @@ AWS_PROFILE=*** SLS_OFFLINE=1 uv run python ./solvis_graphql_api/scripts/cli.py
### Push a composite solution

```
AWS_PROFILE=*** REGION=ap-southeast-4 DEPLOYMENT_STAGE=dev S3_BUCKET_NAME=nzshm22-solvis-graphql-api-dev uv run python ./solvis_graphql_api/scripts/cli.py WORKING/NSHM_v1.0.4_CompositeSolution.zip NSHM_v1.0.4 -R
AWS_PROFILE=*** REGION=ap-southeast-4 DEPLOYMENT_STAGE=dev S3_BUCKET_NAME=nzshm22-solvis-graphql-api-dev poetry run python ./solvis_graphql_api/scripts/cli.py WORKING/NSHM_v1.0.4_CompositeSolution.zip NSHM_v1.0.4 -R
```
313 changes: 313 additions & 0 deletions docs/MIGRATION_LOG.md

Large diffs are not rendered by default.

23 changes: 2 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,13 @@
"serverless": "^4.29.0",
"serverless-dynamodb": "^0.2.56",
"serverless-plugin-warmup": "^8.3.0",
"serverless-s3-local": "^0.8.5",
"serverless-wsgi": "^3.1.0"
},
"resolutions": {
"@hapi/content": "6.0.1",
"dicer": "0.3.1",
"@smithy/config-resolver": "4.4.17",
"axios": "1.15.2",
"follow-redirects": "1.16.0",
"lodash": "4.18.1",
"@koa/router": "10.0.0",
"brace-expansion": "2.0.3",
"fast-xml-parser": "5.7.0",
"glob": "10.5.0",
"koa": "2.16.4",
"minimatch": "9.0.7",
"tar": "7.5.11"
"serverless-s3-local": "^0.8.5"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"smoke": "uv run python scripts/smoke_test.py",
"requirements_1": "serverless requirements clean",
"requirements_2": "serverless requirements cleanCache",
"dummy_pkg": "serverless package --stage dummy",
"deploy": "serverless deploy --stage ${STAGE}",
"sls_doctor": "serverless doctor"
},
"packageManager": "yarn@4.14.1"
"packageManager": "yarn@4.10.3"
}
39 changes: 22 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [
{name="NSHM Compute Working Group", email="nshm@gns.cri.nz"}
]
readme = "README.md"
requires-python = ">=3.12"
requires-python = ">=3.12,<4.0"
license = "AGPL-3.0-or-later"
classifiers=[
'Development Status :: 2 - Pre-Alpha',
Expand All @@ -16,24 +16,21 @@ classifiers=[
'Programming Language :: Python :: 3.12',
]
dependencies = [
"flask>=3.0.3,<4.0.0",
"flask-cors>=6.0,<7.0.0",
"geopandas>=1.0.0,<2.0.0",
"graphene>=3.3,<4.0.0",
"graphql-server==3.0.0b7",
# --- new Strawberry / FastAPI / Mangum stack ---
"strawberry-graphql>=0.243",
"fastapi>=0.115",
"mangum>=0.18",
"pydantic>=2.0",
# relay global-id / cursor encoding used by the schema (was transitive via graphene)
"graphql-relay>=3.2",
# --- data + compute (unchanged) ---
"matplotlib>=3.10.7,<4.0.0",
"nzshm-common>=0.9.0,<1.0",
"nzshm-model>=0.14.0,<1.0",
"pandas>=3.0.0,<4.0.0",
"pynamodb>=6.0.0,<7.0.0",
"pyyaml>=6.0.1,<7.0.0",
"serverless-wsgi>=3.0,<4.0",
"pyyaml>=6.0.1",
"solvis>=1.2.0,<2.0",
]

[tool.hatch.build.targets.wheel]
packages = ["solvis_graphql_api"]

[project.scripts]
cli = 'solvis_graphql_api.scripts.cli:cli'
cli_ab_test = 'solvis_graphql_api.scripts.cli_ab_test:cli'
Expand All @@ -43,16 +40,21 @@ dev = [
"bump2version",
"click",
"deepdiff",
"httpx",
"moto",
"mypy",
"pip-audit",
"pre-commit",
"pytest-cov",
"pytest",
"ruff",
"uvicorn",
"safety",
"sgqlc",
"shapely",
"toml",
"tox",
"tox-uv",
"twine",
"types-python-dateutil",
"types-PyYAML",
Expand All @@ -63,17 +65,19 @@ dev = [
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["solvis_graphql_api"]

[tool.uv]
exclude-newer = "1 week"
# nzshm* packages ship fresh — always resolve to latest.
exclude-newer-package = { "nzshm-common" = false, "nzshm-model" = false }

[tool.ruff]
line-length = 120
line-length = 120 # matches prior flake8 max-line-length

[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP"]
ignore = ["E203", "E266", "E501"]
select = ["E", "F", "I", "B", "UP"] # G004 (f-string logging) deferred to a follow-up

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
Expand All @@ -82,5 +86,6 @@ ignore = ["E203", "E266", "E501"]
quote-style = "preserve"

[tool.mypy]
plugins = ["strawberry.ext.mypy_plugin"]
ignore_missing_imports = true
exclude = ["solvis_graphql_api/ab_test/client"]
exclude = "solvis_graphql_api/ab_test/client"
Loading
Loading