Skip to content

Fix simulation worker startup after PolicyEngine 4.12 deploy #535

@anth-volk

Description

@anth-volk

The merged simulation API deploy for PolicyEngine 4.12 failed beta integration tests because the Modal simulation worker image cannot import the packaged simulation helpers at container startup.

Failed deploy:

Observed failures:

  • test_calculate_specific_model
  • test_budget_window_multi_year_batch_completes

Modal staging worker logs for policyengine-simulation-py4-12-0 show both run_simulation and run_budget_window_batch crash-looping before user code executes:

ModuleNotFoundError: No module named 'fastapi'

The import chain is:

/root/app.py
from policyengine_api_simulation.release_bundle import get_bundled_country_model_version

/root/policyengine_api_simulation/__init__.py
from fastapi import FastAPI

The worker image explicitly installs the PolicyEngine runtime dependencies, tables, and logfire, but not fastapi, so importing any policyengine_api_simulation.* submodule triggers package __init__ and crashes the worker container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions