Repository navigation
Description
Summary
The US builds need one machine with about 128 GiB of memory. The ACS local and county line runs for hours; the national release runs for days. Today these builds run on a local Mac, and Modal cannot take the long stages or the county stages. A GCP Compute Engine VM is a plain Linux machine. Route A and the county line can run there the same way they run on the Mac, after one portability fix and a settings file.
This issue asks for that setup, one measured county-line build on a VM, and a data ruling before any PUF-derived file goes to GCP. It is part of #922: it gives the County Files a second build host.
Facts below are from main at f1f5f73c9 (16 November).
Why not Modal for these stages
- A Modal call lasts at most 24 h. The national release took 33 h (September) and 57 h (October) on the Mac, so it cannot run as one call.
- When a preemptible call is cut, it starts again from zero, and Modal bills the lost time. The only measured run, the 23 September materialize attempt, was cut twice: about 0.67 cuts an hour (95% interval 0.08–2.4, from one run). At that rate a 5 h stage finishes without a cut about 3% of the time. Non-preemptible calls cost 3× as much.
- The two stages measured on Modal ran 2.2–3.9× slower than on the Mac.
- The Modal stage plan withholds the
block_v1location flags (US household location v1: one census block per household, every geography derived #1047). It cannot pass--county-factseither, and Pin US county facts beside the main feed for the county rung #1614 makes its check refuse a county materialize.
Cost
| Modal, preemptible | Modal, non-preemptible | GCP Spot | GCP on-demand | |
|---|---|---|---|---|
| Machine | 4 cores (8 vCPU), 128 GiB | same | 16 vCPU, 128 GB (e2- or n2-highmem-16) | same |
| Per hour | $1.21 | $3.63 | $0.43 (e2) – $0.63 (n2) | $0.72 (e2) – $1.05 (n2) |
| What a cut does | The call starts again from zero; the lost time is billed | No cuts | The VM stops and keeps its disk; someone restarts it. Google publishes no cut rate | No cuts |
| National build (base + release): time | 74–224 h | 74–224 h | 34–116 h | 34–116 h |
| National build: cost | $130–390, only if the release is split into pieces of 1 h or less | $270–810, with the release split into calls under 24 h | e2 $17–58, n2 $24–81, if never cut | e2 $27–92, n2 $38–129 |
| ACS local build: time | 10–16 h | 10–16 h | 3.8–7.5 h | 3.8–7.5 h |
| ACS local build: cost | $13–20 if never cut; materialize finishes without a cut 1–3% of the time | $39–60 | e2 $1.90–3.80, n2 $2.60–5.20, if never cut | e2 $3–6, n2 $4.20–8.40 |
- Modal times. The base is measured: 1 h 45 min and $5.67, from one receipt. Materialize is projected from the 23 September attempt: 5.3–6.9 h. The other stages are the Mac times × 2.2–3.9, the slowdown on the two measured stages.
- Modal prices. The list prices in
docs/us-modal-stage-runbook.md("Resources and cost"). Each stage uses its own resource class. Volume storage is not counted. - GCP prices. us-central1, from a third-party price index (gcloud-compute.com, 15 November 2026); the on-demand rates match Google's list rates. They include a 500 GB balanced disk at about $0.07 an hour, an estimate that was not checked.
- GCP times. Not measured. The range runs from Mac speed to twice the Mac's time.
- County rows. The county rung adds rows to materialize and to the joint solve. Their time and memory cost is not measured yet (Make the county rung a production county calibration for the County Files #1630).
What the setup needs
- Portability fix.
tools/route_a/route_a.shcalls macOSstat -f %zat lines 130 and 541. Line 130 is inverify_inputs, so on Linux every input fails its size check and the run stops before the base. A portable size read, for examplewc -c < "$path", works for both lines.tools/route_a/README.md:77also says the driver usesstat -f. The rest of the drivers is already portable:du -sk,hostname -s, andtools/build_us_acs_local_release.py:549reads Linuxru_maxrssunits. - Settings. Set
DISK_PATH(default/System/Volumes/Data),PE,UVandAGENT_SECRETinroute_a.env. The secret helper must answerget HUGGING_FACE_TOKEN_MAX(tools/route_a/with_hf_token.sh). On a VM it can read GCP Secret Manager. - Telemetry. Install the emitter with
uv tool install microcosm-emitter(0.15.0 or later), asdocs/orrery-publication.mdsays, and add the collector token. - Supervision. Run the driver under tmux or a systemd unit instead of launchd. The stage supervisor (
tools/route_a/supervise.py) uses psutil and works on Linux. The release stage allows up to 110 GiB RSS, needs 50 GiB of free RAM to start, and has a 345,600 s wall limit. - Machine. 16 vCPU and 128 GB (e2-highmem-16 or n2-highmem-16), a 500 GB balanced disk, Ubuntu LTS, git and uv. Past full materialize runs peaked at 75.6–93.9 GB (the county rung doc in Make the county rung a production county calibration for the County Files #1630). Check the peak on the first run.
- Outputs. Copy outputs back with
gcloud compute scp, rsync or a GCS bucket. Or publish from the VM:microcosm-publish-release-buildhas no host check, and it needs the emitter, an HF write credential and network access. Then copy back only the receipts and evidence. Published sizes: the ACS local build 766b7c7 is 9.84 GB, nationalspm-20260915is 0.85 GB, and the b5db384 recert is 2.55 GB. Egress from GCP costs about $0.12/GB (not checked). - Credentials. Use a fine-grained HF write token for the
policyengine/populace-usrepositories, not a personal token. Keep it in Secret Manager and revoke it after the run. - Teardown. Delete the VM and its disk after each run, and set a billing budget alert.
- Country-agnostic. Keep host paths, inputs and credentials as settings, so a UK build can use the same recipe.
Data placement
- County line. The ACS staging and the county release appear to read only public or published inputs: the published national release (the donor) and its manifest, ACS PUMS, the SIPP 2023 public-use file, the Census ladders, and the Chronicle feed and county facts. Confirm this before the first run.
- National base and release. The base reads the IRS PUF. Max's 29 September ruling allows the PUF on the
policyengineModal volumes, for the base only. The release reads the base's unpublished output. Running either on GCP needs a new ruling that covers the project, the region, disk encryption, who can reach the VM, and deletion after the run.
Platform differences
The same stage code on the same inputs gives different outputs on linux/amd64 and macOS arm64. In the #1191 evidence (docs/evidence/us-release-reimputation-1191/README.md), the traditional 401(k) leaf differed on 21,764 persons between the two platforms. A VM build will therefore not match a Mac build byte for byte. Compare gates, totals and fit, not digests.
Steps
- The portability fix, in one small PR.
- A GCP project with billing, a budget alert and a VM template.
- One county-line build on the VM: the ACS staging, then the county release from Make the county rung a production county calibration for the County Files #1630, on-demand. Record wall time, peak memory and cost for each stage. Compare its gates, totals and county fit with a Mac run of the same commit.
- The PUF ruling. Then the Route A base and release on the VM, with the release on-demand.
Acceptance
- The portability fix is merged, and
verify_inputspasses on Linux. - One county-line build ran on a VM, with a receipt: stage times, peak memory, cost, output digests, and the comparison with the Mac run.
- No VM or disk is left after the run.
- A written ruling exists before any PUF file or unpublished PUF-derived file is on GCP.
Not in scope
- Changes to the Modal runner.
- New orchestration code. The VM runs the existing drivers.
- Making GCP the default build host.
Open questions
- Who owns the GCP project and its billing?
- Spot or on-demand for each stage? A Spot VM that is cut stops and keeps its disk, but GCP does not restart it and publishes no cut rate. On-demand suits the release. Spot may suit short stages and the base, which resumes from its last outer stage.
- Does a build on a VM count as the from-scratch receipt that
docs/us-release-build-rule.mdasks for?
Related
#922 (parent), #1614, #1630, #1047, #1585, #1191, docs/us-modal-stage-runbook.md
🤖 Generated with Claude Code
Activity