Add the simulation job store and background result collection without leases
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #848 di @anth-volk — chiusa senza merge
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 1
- Merge medio
- 1g 21h
- PR unite (30g)
- 57
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine-sim-api
-
Update policyengine to 6.7.3Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
PolicyEngine/policyengine-sim-api#823 ·
I maintainer di solito rispondono entro 1 giorno
-
Integration tests fail due to missing UV virtual environment setupForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
PolicyEngine/policyengine-sim-api#314 ·
I maintainer di solito rispondono entro 1 giorno
-
Use disclosure-controlled UK geography outputs for constituency and local authority impactsForse già presa @PavelMakarchuk l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
PolicyEngine/policyengine-sim-api#859 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
PolicyEngine/policyengine-sim-api#858 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Update policyengine to 6.9.0Forse già presa @policyengine l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 20/100
PolicyEngine/policyengine-sim-api#856 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PolicyEngine/policyengine-sim-api
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ansys/pyansys-common-mcp#213 ·
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
freedomofpress/dangerzone#1594 ·
I maintainer di solito rispondono entro 3 giorni
-
priority:P1 status:in-review type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
randomparity/kdive#3317 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:ci
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mesonbuild/meson#16281 ·
I maintainer di solito rispondono entro 1 giorno