Wire the recommendation's RAM estimate into provisioned ramGb
#19
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
--provisioncurrently sets each EphemeralBuilder'sspec.requirements.ramGbfrom a coarse default (2 GiB/core × cores) unless--node-ram-gbis passed explicitly. But since #15 the estimator already models per-derivation RAM (costmodel.ram_gb+RAM_HEAVY) and the scheduler tracks peak concurrent RAM per node. We should feed that modeled peak-RAM-per-node into the provisionedramGbso the emitted CR requests enough memory for the actual build, instead of a flat per-core guess.Implementation:
peak_ram_gb_per_nodeto the Estimate or a helper alongsideschedule_for). Usecostmodel.ram_gbfor per-drv needs and honormax_jobs.--provision, passram_gb= the modeled peak-per-node (rounded up, min 1) when--node-ram-gbis not given; an explicit--node-ram-gbstill overrides. Keep the 2 GiB/core path only as a final fallback when no model figure is available (e.g. nothing to build).Context: follow-up to #14/#15, discovered while reconciling the provision renderer.
Implemented on main (HEAD
4016f78, 86 tests passing). Addedestimate.peak_ram_gb_per_node(...)which runs the recommended shape's schedule uncapped and sweep-lines each node's task intervals (grouping lanes bylane // max_jobs), summingcostmodel.ram_gbper co-resident build to find the busiest node's peak concurrent RAM.--provisionnow sizes each EphemeralBuilder'sspec.requirements.ramGbfrom that modeled peak (rounded up, min 1) instead of the flat 2 GiB/core default; an explicit--node-ram-gbstill overrides, and a nothing-to-build closure falls back to the per-core default. Verified end-to-end: a chromium-containing closure now emitsramGb: 10(its modeled peak) rather than 2×cores. Tests cover the heavy-derivation sizing, co-resident RAM summation under max_jobs, the explicit-override path, and the empty-closure fallback.