-
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
Allow only downloading important outputs, e.g. with a --remote_download_important #12656
Comments
Hi Gibson, thanks for the proposal! I am working on separating downloads from action execution #12665. It seems to me that the requirements of this proposal can be fulfilled with that change. Please take a look and share your ideas. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
I think currently toplevel mode already only downloads |
When I filed this, |
To be more specific, with command |
I think with our recent changes, |
tl;dr could we add a
--remote_download_important
flag that only downloads "important outputs".Background
We maintain a Remote Execution cluster internally, and want to make it easy for users to get the benefits of remote execution without the pain-points.
When moving locally → remotely, all artifacts are now built on remote executors, and thus not not necessarily downloaded locally. Bazel has a number of flags to control the behaviour, and we need to set good defaults while making it easy for users to override them as needed.
Today we set
-—remote_download_minimal
by default in our sharedbazelrc
.Bazel currently supports the following flags:
--remote_download_outputs=all
→ download everything--remote_download_outputs=toplevel
→ download outputs of top level targets--remote_download_outputs=minimal
→ download only what’s needed for local actionsThere are also some flags that do the same but add some more in-memory options:
--remote_download_minimal
→--remote_download_output=minimal
+ write less to disk--remote_download_toplevel
→--remote_download_output=toplevel
+ write less to diskRequirements
Ideal
Realistic
The core user expectation is probably:
If I run
bazel build //...
I’m just checking things build, and if I runbazel test //...
I’m just checking things test. If I build a specific target, e.g.bazel build src/foo:bar
, I actually want to use that thing, so download it.I might also want to combine these, e.g.
bazel test //... src/foo:bar
to only downloadsrc/foo:bar
but test everything.Either way give me defaults I can easily override on a one-off or per-project level.
Proposal
Default
So the default behaviour we want is that the output that Bazel prints to the screen is what will be downloaded:
bazel build //...
bazel test //...
bazel build //foo:bar
//foo:bar
main outputThis is the same as what
--remote_download_outputs=toplevel
does, except when you pass a wildcard likesrc/...
.We implement this by creating a new option:
Which would expand to:
--experimental_remote_download_outputs=important
--nobuild_runfile_links
--experimental_inmemory_jdeps_files
--experimental_inmemory_dotd_files
Suggested name "important" comes from the fact that these are apparently called "important outputs" in Bazel (see #8739 (comment)).
Overrides
If I don’t want the default behaviour, I have the following options:
--remote_download_output=minimal
--remote_download_output=all
--remote_download_output=toplevel
This should satisfy all the common use-cases (and can be put in a local bazelrc to change the default).
The text was updated successfully, but these errors were encountered: