Skip to content

feat(uv): monitor wheel build memory#1174

Merged
xangcastle merged 1 commit into
aspect-build:mainfrom
tamird:feat-wheel-build-memory-monitor
Jun 24, 2026
Merged

feat(uv): monitor wheel build memory#1174
xangcastle merged 1 commit into
aspect-build:mainfrom
tamird:feat-wheel-build-memory-monitor

Conversation

@tamird

@tamird tamird commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Large source-built wheels can exhaust memory before their action logs show
enough evidence to size a scheduler reservation.

Add an explicit monitor_memory package override that samples approximate
Linux procfs RSS for the PEP 517 frontend and its descendants. Emit the
first sample, 256 MiB high-water crossings, and a final peak. Preserve
earlier samples across procfs races and identify a direct SIGKILL as a
possible OOM.

Keep diagnostics independent from resource_set. The monitor inherits the
Bazel process group and never installs signal handlers or kills child
processes, so Bazel retains cancellation ownership. Only opted-in generated
build tools carry the monitor dependency.

Apply monitoring only to generated sdist actions. Selecting a compatible
prebuilt wheel produces no report; prebuilt-only packages and complete
custom BUILD replacements reject the override.

Add an explicit monitor_memory package override for source-built wheels.
Sample the build process tree through Linux procfs and emit flushed
high-water reports so failed or OOM-killed builds leave evidence for
calibrating resource_set.

Keep monitoring independent from scheduler reservations. Launch the PEP
517 frontend in the existing Bazel process group and leave cancellation
to Bazel; the sampler observes descendants but never signals them.

Only add the monitor dependency to opted-in generated build tools. Reject
prebuilt-only packages and custom BUILD replacements that have no
generated wheel action to instrument.
@tamird

tamird commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Extracted from #1140. That patch coupled memory diagnostics to resource
reservations and took ownership of the build process group; this replacement
makes monitoring explicit and leaves cancellation to Bazel.

@xangcastle xangcastle merged commit ea28d93 into aspect-build:main Jun 24, 2026
9 checks passed
@tamird tamird deleted the feat-wheel-build-memory-monitor branch June 24, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants