Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.1.0] Reduce retention and early materialization of VirtualActionInput #25008

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

iancha1992
Copy link
Member

b82dcdc introduced a way for parameter files to be materialized lazily and in a streaming fashion. For this to be effective, the contents of VirtualActionInputs should not be retained and, ideally, never or only briefly materialized in full.

This is achieved by replacing the digest computations with a streaming approach and avoiding retention of VirtualActionInput in MerkleTrees, which may be cached. All cache protocols are streamlined to accept a Blob, which is a closeable supplier of InputStreams that is automatically closed after the upload has completed (which may require retries).

Along the way, file nodes in MerkleTrees are stored unwrapped to reduce memory usage.

Closes #24891.

PiperOrigin-RevId: 718042524
Change-Id: I1567cf6ca36cbf5e1146c91df34157c9192bb822

bazelbuild@b82dcdc introduced a way for parameter files to be materialized lazily and in a streaming fashion. For this to be effective, the contents of `VirtualActionInput`s should not be retained and, ideally, never or only briefly materialized in full.

This is achieved by replacing the digest computations with a streaming approach and avoiding retention of `VirtualActionInput` in `MerkleTree`s, which may be cached. All cache protocols are streamlined to accept a `Blob`, which is a closeable supplier of `InputStream`s that is automatically closed after the upload has completed (which may require retries).

Along the way, file nodes in `MerkleTree`s are stored unwrapped to reduce memory usage.

Closes bazelbuild#24891.

PiperOrigin-RevId: 718042524
Change-Id: I1567cf6ca36cbf5e1146c91df34157c9192bb822
@iancha1992 iancha1992 added team-Performance Issues for Performance teams team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Jan 21, 2025
@iancha1992 iancha1992 requested a review from a team as a code owner January 21, 2025 22:16
@iancha1992 iancha1992 enabled auto-merge January 22, 2025 19:18
@iancha1992 iancha1992 added this pull request to the merge queue Jan 23, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2025
…nput` (#25008)

b82dcdc
introduced a way for parameter files to be materialized lazily and in a
streaming fashion. For this to be effective, the contents of
`VirtualActionInput`s should not be retained and, ideally, never or only
briefly materialized in full.

This is achieved by replacing the digest computations with a streaming
approach and avoiding retention of `VirtualActionInput` in
`MerkleTree`s, which may be cached. All cache protocols are streamlined
to accept a `Blob`, which is a closeable supplier of `InputStream`s that
is automatically closed after the upload has completed (which may
require retries).

Along the way, file nodes in `MerkleTree`s are stored unwrapped to
reduce memory usage.

Closes #24891.

PiperOrigin-RevId: 718042524
Change-Id: I1567cf6ca36cbf5e1146c91df34157c9192bb822

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 23, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Jan 24, 2025
Merged via the queue into bazelbuild:release-8.1.0 with commit 16f6d5a Jan 24, 2025
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Performance Issues for Performance teams team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants