Add the simulation job store and background result collection without leases
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
- #848 von @anth-volk — ohne Merge geschlossen
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 20/100
Rechercherichtung
The issue specifies the simulation.jobs and simulation.job_results tables, collection and sweep routes, and concurrency tests, but names no source files or test paths. Start by locating the API's database models, route registration, and test conventions, then trace how Modal calls and Cloud Tasks are handled. Done means jobs can be submitted idempotently, results collected safely without leases, status read from the database, and the stated operator prerequisites are configured; linked PR #848 is already open.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Context
Step 1 of the API v2 migration (item 1A-4, result collection option B) needs a durable record of every calculation the Simulation Entrypoint sends to Modal, and a way to store each finished result without relying on clients that poll. The migration plan's rules: client polling never advances work, and Modal applications get no database credentials.
Scope
simulation.jobs: one row per calculation, recording the submitter, an input hash that includes the policyengine.py bundle version, the Modal call ID, status, timings and any error.- Idempotent submission:
INSERT ... ON CONFLICTon the input hash, so identical requests share one job. - A conditional
pending->dispatchingupdate before the Modalspawn, so one Modal call starts per job. - An authenticated internal collection route that Cloud Tasks calls: it checks the Modal call without waiting, writes a finished result to Postgres with a conditional update (
... WHERE status = 'running') so a second collector changes nothing, and re-enqueues itself with backoff while the call runs. No Postgres leases. simulation.job_resultsfor results that are not reports (report results go tosimulation.report_results, added separately).- A sweep route that Cloud Scheduler calls, which enqueues a collection task for unfinished jobs not checked recently.
- Status reads that use only the database and accept either a job UUID or a Modal
fc-...call ID. - Tests showing the conditional writes are safe when two collectors run at once.
Nothing in production submits jobs yet; no job kind is registered until Step 2.
Operator prerequisites (both environments, before merge)
- Create the Cloud Tasks queue, its invoker service account and the IAM bindings (the Simulation Entrypoint runtime service accounts may create tasks and act as the invoker; the invoker may invoke the Cloud Run service).
- Create the Cloud Scheduler job that calls the sweep route with the invoker's OIDC token, audience set to the stable service URL.
- Confirm the Simulation Entrypoint's ingress setting accepts requests from Cloud Tasks and Cloud Scheduler.
- Set the
RECONCILIATION_QUEUEandRECONCILIATION_INVOKER_SERVICE_ACCOUNTvariables in this repository'sbetaandprodGitHub environments.
- Vorherrschende Sprache
- Python
- Sterne
- 1
- Forks
- 1
- Ø Merge
- 1 T. 16 Std.
- Gemergte PRs (30 T.)
- 61
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PolicyEngine/policyengine-sim-api
-
Update policyengine to 6.7.3Evtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 70/100
PolicyEngine/policyengine-sim-api#823 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Integration tests fail due to missing UV virtual environment setupEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
PolicyEngine/policyengine-sim-api#314 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Update policyengine to 6.10.1Evtl. vergeben @policyengine hat das heute übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 20/100
PolicyEngine/policyengine-sim-api#905 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Calculate a household under several policies in one call on Modal (v2 household functions)Evtl. vergeben @anth-volk hat das vor 1 Tag übernommen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
PolicyEngine/policyengine-sim-api#902 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add simulation and report definitions to the simulation schemaEvtl. vergeben @anth-volk hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
PolicyEngine/policyengine-sim-api#899 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in PolicyEngine/policyengine-sim-api
Ähnliche Issues
-
Python Volcengine provider returns failures instead of raising themEvtl. vergeben @Ricardo-M-L hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
agent-infra/sandbox#248 ·
-
Textractor leaves empty temporary files when remote retrieval failsEvtl. vergeben @HuaTNA hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
test(bm_generation): pin the learning parameters and CPU sync shortcutEvtl. vergeben @iloveeyjafjalla hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
qboson/kaiwu-pytorch-plugin#1341 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
elder-plinius/V3R1T4S#625 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
foxglove/mcap#1907 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag