Repository navigation
Platform testing on OasisModels - #65
Merged
Merged
Conversation
- .github/workflows/platform-tests.yml: reusable (workflow_call) and manual platform test workflow, taking server/worker images to test (same inputs as OasisPiWind's integration.yml). PRs run PiWind/test_1. - Complex model runners: add run_outputs() (needed for distributed v2 runs) and return results; set model_custom_gulcalc in the workers' oasislmf.json so v2 loss chunks use the custom gulcalc. - Skip PiWindComplexModel/test_2 on the platform (implicit runner discovery can't be expressed with the shared worker config). - Log server requests in the test stack (gunicorn access log). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model data is built with OASIS_INT=i8, OASIS_FLOAT=f8 and OASIS_AREAPERIL_TYPE=u8 (as in tests/test_1/env.json). Without them the worker read the vulnerability file with the default types and failed with "vulnerability_id 2 has damage_bin_id bigger that expected maximum". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Optional redis channel layer in the platform stack (compose profile `channel-layer`, pytest --channel-layer, workflow input channel_layer). Servers before 2.5.7 always send queue status through it and fail generate_inputs with a 500 without one. - Inner job name is just the stack (api, db, storage), callers' job names say what's being checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ha-Ree
reviewed
Nov 24, 2026
| # TODO: testing only, set back to 'main' before OasisModels#65 is merged | ||
| # (fix/oasis-models-testing has the OasisPlatform fixes these tests found) | ||
| PLATFORM_BRANCH: ${{ inputs.platform_branch || 'fix/oasis-models-testing' }} | ||
| OASISLMF_REF: ${{ inputs.oasislmf_branch || 'fix/default-samples-distributed' }} |
Contributor
There was a problem hiding this comment.
Pr desc says these need to be changed before release
Ha-Ree
reviewed
Nov 24, 2026
| "DynamicFootprint/test_1", # gulmc dynamic footprint | ||
| "PiCyber/test_1", # other peril / class of business, accounts-only portfolio | ||
| "PiWindDtype/test_1", # 64-bit dtypes (OASIS_INT / OASIS_FLOAT / OASIS_AREAPERIL_TYPE) | ||
| "PiWindS3/test_1", # (skipped at the moment pending a fix) |
Ha-Ree
requested changes
Nov 24, 2026
Ha-Ree
approved these changes
Nov 24, 2026
Ha-Ree
left a comment
Contributor
There was a problem hiding this comment.
Good to go when partner pr is in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Revert before merging: for testing only,
.github/workflows/platform-tests.ymlbuilds the platform images from the OasisPlatform branchfix/oasis-models-testing(jobplatform-images,PLATFORM_BRANCHdefault, markedTODO). That branch has the platform fixes these tests found. Set the default back tomainbefore this PR is merged.Runs the OasisModels test cases through a real OasisPlatform (API server + workers) as well as the MDK. Replaces PiWind's
test_piwind_integrationaction: each case's portfolio goes through input generation and losses on the platform, and the outputs are compared with the sameexpected_results/outputthe MDK tests use.How it works
tests/test_platform_runs.pystarts a minimal platform stack with testcontainers'DockerComposefor the whole session, then runs each selected case through the API with theoasislmfAPIClient.tests/compose/docker-compose.platform.yml: shared stack (server, server/celery DBs, RabbitMQ broker, v1 or v2 worker monitor) chosen with compose profiles:v1/v2, databasepostgres/mysql(mysql.env), storage shared-fs /s3(moto,s3.env).OASIS_ANALYSIS_STATUS_URL) and celery-beat.<Model>/docker/worker-container.ymlextends the stack'sworkertemplate with the model id and data mounts. One worker is started per selected model. Each worker self-registers asOasisLMF/<Model>/<api-version>.<Model>/docker-compose.yml+.envrun the same stack by hand:cd PiWind && docker compose up -d --wait. The olddocker/docker-compose*.ymlfiles are removed.docker/Dockerfile(installscomplex_model_wrapperon top of the given worker image).expected_results/output(rel. tolerance 1e-4), ignoringanalysis_settings.jsonand the platform-onlycombine/dir.--update-resultsregenerates them.tests/model_discovery.py(test cases, skip lists,env.json) is now used by bothtest_model_runs.pyandtest_platform_runs.py.Test-only process limits
Every celery / gunicorn container defaults to one process per CPU. With 13 model workers on a 16-core machine that was 164 celery processes and the run was OOM-killed.
tests/platform_stack.pysets, for tests only:docker-compose.test-limits.yml)A plain
docker compose upin a model folder keeps the image defaults. Worker task retries are set to 0 so failures surface at once (takes effect in images that include OasisPlatform#1521, merged after 2.5.9).Running
The file is only collected when passed explicitly or with
--platform-tests, so a plainpytestdoesn't start containers. Container logs, the generated stack config and each case's inputs / outputs / run logs go to--platform-logs.Workflow:
.github/workflows/platform-tests.ymlpull_request(develop, main),workflow_dispatch,workflow_call. All run every enabled case by default;platform_testsselects a subset.integration.yml:server_image/server_tag,worker_image/worker_tag,worker_api_ver,db,storage,debug_mode,oasislmf_branch,pytest_opts, plusmodels_branchandstorage_suffixfor callers.platform-logs(container logs + stack config) andplatform-runs(per-case inputs, outputs and run logs).model-tests.yml: passesGITHUB_TOKENto the ODS_Tools git install, which lists OED spec release tags through the GitHub API and was hitting the unauthenticated rate limit.Model changes
ri_output: false) in 9 cases whose tests have no RI files. The MDK only warns about this, but the platform errors: DeterministicModel/test_1, PiWindAbsoluteDamage/test_1–2, PiWindComplexModel/test_2, PiWindPostLossAmplification/test_1, PiWindSinglePeril/test_1, PiWindVulnerability/test_1–3.run_analysis/run_outputsfor v2 chunked runs, and the custom gulcalc is set withmodel_custom_gulcalcin the worker'soasislmf.json.PiWind/model_data, which theirmodel_datasymlinks point to.OASIS_INT=i8,OASIS_FLOAT=f8,OASIS_AREAPERIL_TYPE=u8(same astests/test_1/env.json).Platform status
12 cases enabled. On 2.5.9 images (v2, postgres, shared-fs), 11 of them passed locally in ~16 min. PiWindDtype was failing before its env var fix and hasn't been re-run on the platform since. The GitHub runner (4 vCPU) is roughly 3× slower than local.
Skipped on the platform (
PLATFORM_SKIP_REASONS), on top of the MDK skip list:PiWindS3: v2 workers replace the model'smodel_storage_jsonwithNone, so model data isn't read from S3. Fix committed on OasisPlatformfix/oasis-models-testing(keep the model'smodel_storage_jsonin v2 loss tasks).PiWindPostcode/test_1: nonumber_of_samples, and chunked runs ignoremodel_default_samples, so they run 0 samples. model_default_samples ignored in chunked loss runs (0 samples on the platform) OasisLMF#2314, fix in Use stored run settings in chunked loss steps (model_default_samples ignored) OasisLMF#2313.PiWindComplexModel/test_2: tests implicit model runner discovery (nomodel_package_dir).PiWindPostcode/test_4: its exposure pre-analysis settings file lives in the test directory.Related upstream
gc.freeze)model_default_samplesignored in chunked loss runs🤖 Generated with Claude Code