Add the simulation job store and background result collection without leases
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #848 của @anth-volk — đã đóng, không merge
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 1
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 57
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PolicyEngine/policyengine-sim-api
-
Update policyengine to 6.7.3Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
PolicyEngine/policyengine-sim-api#823 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Integration tests fail due to missing UV virtual environment setupCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
PolicyEngine/policyengine-sim-api#314 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use disclosure-controlled UK geography outputs for constituency and local authority impactsCó thể đã có người làm @PavelMakarchuk đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
PolicyEngine/policyengine-sim-api#859 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
PolicyEngine/policyengine-sim-api#858 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update policyengine to 6.9.0Có thể đã có người làm @policyengine đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 20/100
PolicyEngine/policyengine-sim-api#856 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PolicyEngine/policyengine-sim-api
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ansys/pyansys-common-mcp#213 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
freedomofpress/dangerzone#1594 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
priority:P1 status:in-review type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
randomparity/kdive#3317 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ci
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
mesonbuild/meson#16281 ·
Maintainer thường phản hồi trong vòng 1 ngày