Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add the Simulation Entrypoint's own Postgres schema, persistence library and migration chain

Chiusa
#844 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #847 di @anth-volk — chiusa senza merge

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
github-actions, google-cloud, postgresql, python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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-chain with ownership rules for the Simulation Entrypoint's own schema:
    • one Alembic chain at migrations/, schema simulation, version table simulation.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).
  • Add libs/policyengine-simulation-persistence with 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 in GET /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_migrator and simulation_runtime database roles in the staging and production v2 databases. simulation_migrator must be able to create the simulation schema (or the schema must be created in advance and owned by it).
  • Store the migrator URL as the SIMULATION_MIGRATION_DATABASE_URL secret in this repository's beta and prod GitHub environments.
  • Store the runtime URL in Secret Manager in the Simulation Entrypoint's Google Cloud project, readable only by sim-entry-beta-runtime and sim-entry-prod-runtime (and listable by the deploy service account), and set its name as the SIMULATION_DATABASE_URL_SECRET_NAME variable in beta and prod.
Lingua principale
Python
Stelle
1
Fork
1
Merge medio
1g 16h
PR unite (30g)
60

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PolicyEngine/policyengine-sim-api

Tutte le issue di PolicyEngine/policyengine-sim-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.