-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
remote_download_minimal: downloaded inputs shouldn't be deleted after the build #12855
Comments
Before this change, when remote build without bytes is enabled, intermediate outputs which are also inputs to local actions will be downloaded for local execution. After build finished, these downloaded files are deleted to keep Bazel's view of the output base identical with the output base i.e. files that Bazel thinks exist only remotely actually do. However, these intermediate outputs maybe used later in which case Bazel need to download them again which is a performance issue. #12855 This change fix the issue by removing the code used to delete downloaded files. Bazel should be able to take the local file as the source of truth if it exists (otherwise, it is a bug). This is also an essential step to implement separation of downloads. #12665 PiperOrigin-RevId: 363131672
Fixed by f0c32de. |
Thank you! |
@coeuvre One "benefit" of this issue, that I've come to like since filing the bug, is that it allows large working sets to happen on space constrained machines (ones that the build would fail on before reaching the end, where one could call |
I don't think unconditionally delete downloaded intermediate outputs is a good way to manage the content of output base. One way I could image is that we can collect the usages of these downloaded output files and delete those which are not used after a certain period of time. |
For my (new) specific use case, the build will fail if it doesn't delete the intermediate outputs during the build, since the local machine doesn't have enough space to have all of them at once. If it deletes as it goes the build succeeds. I'm not saying that my use case warrants a change, but this might count as a breaking change because of that? |
|
Hmm. I was seeing that the local inputs were deleted during the build. For example, we run tests locally, so the tests themselves are being downloaded, but then deleted right after each one is run (at least it looks that way). |
I'm running into an issue on HEAD (though it probably existed since this was fixed), where even though the inputs are no longer deleted, they aren't used on subsequent runs, causing them to be downloaded again. If I generate the inputs locally, so they aren't downloaded for the local action, they aren't downloaded on subsequent runs. Of note for this, the inputs being downloaded are outputs (though not all the outputs) from previous actions in the graph. |
Can you please create a new issue and maybe include a repro there? |
Before this change, when remote build without bytes is enabled, intermediate outputs which are also inputs to local actions will be downloaded for local execution. After build finished, these downloaded files are deleted to keep Bazel's view of the output base identical with the output base i.e. files that Bazel thinks exist only remotely actually do. However, these intermediate outputs maybe used later in which case Bazel need to download them again which is a performance issue. bazelbuild#12855 This change fix the issue by removing the code used to delete downloaded files. Bazel should be able to take the local file as the source of truth if it exists (otherwise, it is a bug). This is also an essential step to implement separation of downloads. bazelbuild#12665 PiperOrigin-RevId: 363131672
Description of the problem / feature request:
When using
--remote_download_minimal
, downloaded inputs shouldn't be deleted after the build.Feature requests: what underlying problem are you trying to solve with this feature?
Currently, when bazel needs to download inputs for a locally run action while using
--remote_download_minimal
, it deletes these inputs after the build:bazel/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java
Lines 788 to 810 in 570f019
This makes incremental compilation less efficient.
For example, if we set a bundling rule to run locally, bazel will download all of the various artifacts that need to be bundled together, and if we incrementally only change a single artifact in that bundle, bazel will have to re-download all of the artifacts, even though they didn't change since the last build. The fact that disk_cache doesn't work with remote builds ensure that this is a slow download as well.
What operating system are you running Bazel on?
macOS 10.15.7
What's the output of
bazel info release
?release 4.0.0rc10
Have you found anything relevant by searching the web?
The text was updated successfully, but these errors were encountered: