Skip to content

Use policyengine bundle installs for simulation workers#572

Draft
anth-volk wants to merge 1 commit into
mainfrom
codex/policyengine-bundle-simulation-api
Draft

Use policyengine bundle installs for simulation workers#572
anth-volk wants to merge 1 commit into
mainfrom
codex/policyengine-bundle-simulation-api

Conversation

@anth-volk

Copy link
Copy Markdown
Contributor

Fixes #571

Summary

  • Build the simulation Modal image by running uvx --from policyengine==VERSION policyengine bundle install VERSION instead of directly installing country packages.
  • Install certified bundle datasets into /opt/policyengine/data and expose POLICYENGINE_DATA_FOLDER plus POLICYENGINE_BUNDLE_RECEIPT to the worker.
  • Prefer local receipt-backed certified datasets for default bundle dataset requests, while preserving explicit dataset overrides.
  • Route gateway version lookup by .py bundle version first, with country package version registries kept as fallback.
  • Add registry-updater coverage for writing simulation-api-policyengine-versions.

Validation

  • uv run pytest tests/test_release_bundle.py tests/test_modal_bundle_image.py tests/gateway/test_endpoints.py tests/test_update_version_registry.py -q
  • uv run ruff check src/policyengine_api_simulation/release_bundle.py src/modal/app.py src/modal/gateway/endpoints.py src/modal/utils/update_version_registry.py tests/test_release_bundle.py tests/test_modal_bundle_image.py tests/gateway/test_endpoints.py tests/test_update_version_registry.py fixtures/gateway/test_endpoints.py
  • uv run ruff format --check src/policyengine_api_simulation/release_bundle.py src/modal/app.py src/modal/gateway/endpoints.py src/modal/utils/update_version_registry.py tests/test_release_bundle.py tests/test_modal_bundle_image.py tests/gateway/test_endpoints.py tests/test_update_version_registry.py fixtures/gateway/test_endpoints.py
  • git diff --check -- projects/policyengine-api-simulation/fixtures/gateway/test_endpoints.py projects/policyengine-api-simulation/src/modal/app.py projects/policyengine-api-simulation/src/modal/gateway/endpoints.py projects/policyengine-api-simulation/src/policyengine_api_simulation/release_bundle.py projects/policyengine-api-simulation/src/modal/utils/update_version_registry.py projects/policyengine-api-simulation/tests/gateway/test_endpoints.py projects/policyengine-api-simulation/tests/test_release_bundle.py projects/policyengine-api-simulation/tests/test_update_version_registry.py projects/policyengine-api-simulation/tests/test_modal_bundle_image.py

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.

Use policyengine bundles for simulation worker installs

1 participant