feat: GTFS validation worker wrapping the validator CLI
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 18/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend, cloud, data-engineering
Direzione di ricerca
Read the existing parquet_builder worker first to see how a containerized worker, TaskExecutionTracker (with try_acquire/heartbeat/mark_completed/record_attempt) and MemorySampler are wired today, then limit_gcp_memory and shared/helpers/sizing.py for the memory/tier math. The new pieces are the Python chunked extraction from GCS, the CLI subprocess invocation with a tier-derived heap, the report upload to <feed>/<dataset>/, and a new validator_policy.py for escalation/demotion. Done looks like a worker that produces report_<ver>.json/.html and system_errors_<ver>.json, clears the volume, and queues process-validation-report with the same payload as the current gtfs-validator-web flow.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the problem
Dataset validation goes through gtfs-validator-web in another region: every run uses 4 vCPU / 16 GiB, datasets and reports cross regions, and the workflow polls GCS for up to 60 min. See product-tasks#234.
Proposed solution
A worker in mobility-feed-api, built as a container (Python + JRE + pinned gtfs-validator-cli.jar), following the parquet_builder pattern:
- Tracking:
TaskExecutionTracker(task_name="gtfs_validation", run_id=<validator version>)(existing task name).try_acquirewithK_REVISION,heartbeatwhile the JVM runs,mark_completed/mark_failed, andrecord_attemptwith tier, peak memory and input size. A delivery that failstry_acquirereturnsskipped. - Input handling (the validator reads files only during the load phase, but keeps a zip input open until the run ends):
- Never pass a URL or a non-local NIO path to the CLI: both load the whole zip into the heap.
- Candidates, chosen by measuring peak volume + peak JVM memory per tier in dev:
- Streamed, chunked extraction in Python straight from GCS; Python deletes each extracted file once the JVM has closed it, so the volume is empty for validation and reports.
- Baseline: zip downloaded to the volume.
- Runs the CLI as a subprocess, heap set from the tier memory minus the volume (as
limit_gcp_memorydoes), and samples the JVM withMemorySampler. - Uploads
report.json,report.html,system_errors.jsonasreport_<ver>.json,report_<ver>.html,system_errors_<ver>.json(publicRead) to<feed>/<dataset>/, clears the volume, then queuesprocess-validation-reportwith the same payload as today. - Keeps the skip-if-reports-exist check,
bypass_db_updateand the reports bucket override. - Sizing with
shared/helpers/sizing.pyand a newvalidator_policy.py: escalates one tier on JVM OOM or a full volume (max 3 attempts); demotes afterDOWNSIZE_STREAKruns underDOWNSIZE_HEADROOM; a locked override blocks both. <ver>must match the version string used today, since file names and DB rows depend on it.
Alternatives you've considered
gtfs-validator-apicalled by a worker or directly by Cloud Tasks: needs a ZIP response or a GCS output option, gives no in-process memory measurement, and leaves no clean way to escalate.- GCS FUSE mount of the datasets bucket: rejected as a risk.
- Lingua principale
- Python
- Stelle
- 34
- Fork
- 7
- Merge medio
- 3g 3h
- PR unite (30g)
- 22
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna 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 MobilityData/mobility-feed-api
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MobilityData/mobility-feed-api#1927 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
MobilityData/mobility-feed-api#1846 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MobilityData/mobility-feed-api#1755 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MobilityData/mobility-feed-api#1647 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MobilityData/mobility-feed-api#836 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di MobilityData/mobility-feed-api
Issue simili
-
backend enhancement priority:P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
geolens-io/geolens#4161 ·
I maintainer di solito rispondono entro 1 giorno
-
pkg:clai2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
pydantic/pydantic-ai#14845 ·
I maintainer di solito rispondono entro 1 giorno
-
Add a languageApertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
LearningCircuit/local-deep-research#9272 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
patrickballard/wheelgap#783 ·