-
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
Separate downloads from action execution to provide more download options #12665
Comments
Gibson proposed that we can add |
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
…ing action cache This PR extends `ActionCache.Entry` to store output metadata by having a map of <Path, Metadata>. This map is updated after action execution when we update action cache so that metadata of all outputs of the action are saved. Before checking the action cache (when executing actions), we will load the output metadata into output store if it is remote and the correspondingly local one is missing. With this change, remote output metadata is saved to disk so build without bytes can use them among server restarts. We can also download outputs after action execution since remote output metadata can be accessed outside. Part of #12665. Fixes #8248. Closes #13604. PiperOrigin-RevId: 388586691
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
Has there been any recent work on this? It is very unfortunate that it's not possible to use |
Yes, I am working on similar features for the internal remote executor. Most of changes that are necessary for this feature to work are already open sourced. but there are still some changes to be made for the remote module. I will continue this work after the work for the internal one is done. |
Awesome! Looking forward to the improvements in this area! |
Previously, with `--remote_download_toplevel`, Bazel only downloads toplevel outputs during spawn execution. It has a drawback that, if the toplevel targets are changed in a following invocation, but the generating actions are not able to be executed because of skyframe/action cache, the outputs of new toplevel targets are not downloaded. `ToplevelArtifactsDownloader` fixes that issue by listening to the `TargetCompleteEvent` (which is fired every time after the toplevel target is built event if it hit the cache) and download outputs in the background. Additionally, it can listen to more events during the build hence is more flexible to define additional outputs to be downloaded as toplevel outputs. Working towards #12665. Fixes #13625. Fixes #11834. Fixes #10525. Closes #16524. PiperOrigin-RevId: 483368093 Change-Id: I2184cbbb1d54548498eaa6caa07055a9336fd97e
In the current implementation of remote execution, outputs can only be downloaded when an action executes. We should
separate downloads from action execution so that we can provide more download options to users. For example:
We need a way to specify which files to download after the build (option 2) or with the download flag (option 3). For example:
rg
over a directory)Options for downloading the content of a symlink file:
Related Issues
bazel run
#11920The text was updated successfully, but these errors were encountered: