Add the Simulation Entrypoint's own Postgres schema, persistence library and migration chain
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #847 来自 @anth-volk —— 已关闭,未合并
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 15/100
调研方向
Start by reading the repository rule sim.stage12.no-migration-chain and the existing migration and deploy workflows. The issue names libs/policyengine-simulation-persistence, migrations/, and GET /ready as the main entry points; map their existing conventions before changing them. Done means the migration chain passes upgrade, check, downgrade, and upgrade on fresh PostgreSQL, deploy applies it before the candidate, and the existing pass-through routes and Stage 12 comparison still behave as before.
由索引模型根据 Issue 内容生成。
描述
Context
Step 1 of the API v2 migration (item 1A-2) gives the Simulation Entrypoint its own durable state in the v2 Postgres database. Today the repository rule sim.stage12.no-migration-chain forbids any Alembic chain here: the only tables the simulation services touch are the temporary Stage 12 comparison tables, which the Public API owns and migrates.
Scope
- Replace
sim.stage12.no-migration-chainwith ownership rules for the Simulation Entrypoint's own schema:- one Alembic chain at
migrations/, schemasimulation, version tablesimulation.alembic_version; - the Modal executor and gateway never depend on the persistence library;
- no Modal secret or deployment receives a simulation database URL (the Stage 12 secret stays the only database credential in Modal until Stage 12 is removed).
- one Alembic chain at
- Add
libs/policyengine-simulation-persistencewith an initial revision, and a CI job that runs the chain's upgrade,alembic check, downgrade and upgrade on a fresh PostgreSQL. - Add a deploy job that applies the migrations before the Simulation Entrypoint candidate deploys, using a migrator URL that only that job receives.
- Give the Simulation Entrypoint
SIMULATION_DATABASE_URL(runtime role) from Secret Manager, and report the database's migration revision inGET /ready.
The old-gateway pass-through routes and the Stage 12 comparison must behave exactly as before; nothing in production reads or writes the new schema yet.
Operator prerequisites (both environments, before merge)
Merging to main deploys staging and then production, and the deploy requires these:
- Create the
simulation_migratorandsimulation_runtimedatabase roles in the staging and production v2 databases.simulation_migratormust be able to create thesimulationschema (or the schema must be created in advance and owned by it). - Store the migrator URL as the
SIMULATION_MIGRATION_DATABASE_URLsecret in this repository'sbetaandprodGitHub environments. - Store the runtime URL in Secret Manager in the Simulation Entrypoint's Google Cloud project, readable only by
sim-entry-beta-runtimeandsim-entry-prod-runtime(and listable by the deploy service account), and set its name as theSIMULATION_DATABASE_URL_SECRET_NAMEvariable inbetaandprod.
- 主要语言
- Python
- 星标
- 1
- 派生
- 1
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 57
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PolicyEngine/policyengine-sim-api 的其他 Issue
-
Update policyengine to 6.7.3可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 半天 新手友好度 70/100
PolicyEngine/policyengine-sim-api#823 ·
维护者通常 1 天内回复
-
Integration tests fail due to missing UV virtual environment setup可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
PolicyEngine/policyengine-sim-api#314 ·
维护者通常 1 天内回复
-
Use disclosure-controlled UK geography outputs for constituency and local authority impacts可能已有人在做 @PavelMakarchuk 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
PolicyEngine/policyengine-sim-api#859 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
PolicyEngine/policyengine-sim-api#858 · 1 条评论 ·
维护者通常 1 天内回复
-
Update policyengine to 6.9.0可能已有人在做 @policyengine 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 20/100
PolicyEngine/policyengine-sim-api#856 ·
维护者通常 1 天内回复
查看 PolicyEngine/policyengine-sim-api 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
ansys/pyansys-common-mcp#213 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
freedomofpress/dangerzone#1594 ·
维护者通常 3 天内回复
-
priority:P1 status:in-review type:bug
难度 2/5 1-3 小时 新手友好度 75/100
randomparity/kdive#3317 · 1 条评论 ·
维护者通常 1 天内回复
-
area:ci
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
mesonbuild/meson#16281 ·
维护者通常 1 天内回复