-
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 remote-caching for Symlink and SolibSymlink actions #11119
Comments
I am not sure that what you're proposing is the right solution. Caching symlinks remotely is generally pure overhead because the amount of data in the symlink itself is minimal, and they still have to be created locally. Can you say why Bazel is downloading file repeatedly? What does that have to do with symlinks? |
Thanks for the reply. I will try to present the use case again:
It doesn't necessarily have to do with symlinks but rather to all native actions that bypass the
Because the staged inputs from the
Not necessarily. One example would be for builds running purely with remote-execution, there is no need for any kind of local execution.
I don't understand what is meant by pure overhead here? Do you mean uploading the result of the symlink is an overhead? I agree but that would still happen only once. And while it is overhead, it is has a very small cost to it I believe? |
I don't understand what you're saying. I think you're saying that symlink actions have their inputs staged locally when build-without-the-bytes is active, i.e., the inputs are unnecessarily downloaded to the local machine. How about we don't do that? I would expect uploading a symlink to a remote cache to be several orders more expensive than a kernel call to create a symlink locally, and similarly, making a remote call to download the symlinks to be infinitely more expensive than ... not doing that, because we have all the information in Bazel already, so there's really no point in making any remote call at all. |
That would be the best thing to do I suppose. This is not easily achieved I think. Because Bazel expects all inputs to be staged locally before executing an action (which would happen in the case of the the symlink not being cached). If you could give me some pointer on how this can be implemented I would be happy to come up with some changes for review. |
Except it doesn't expect inputs to be staged when executing an action remotely? |
For remotely executed actions it doesn't indeed. There are two issues though:
|
My point is that executing symlink actions remotely is pointless because you'd still need to re-create the symlinks locally. Symlink actions don't actually need the inputs available locally - (on Linux) it's perfectly fine to create a dangling symlink. |
I see what you mean. I will try this out and check the consequence of this on actions that depend on the symlink action. |
I don't think the solution I proposed is very good. I have noticed this with other actions as well and it leads to a lot of inefficiencies. I think the strategy to unlink files after each command needs to be revisited. |
I am working on the action rewinding feature. Once landed we can discover new inputs during executing phase which means we don't have to ensure all the inputs are presented before execution. This might be helpful with the performance of symlink actions.
Can you share some details of what actions and why they are inefficient?
Can you share your concerns and suggestions?
It seems that we already have a need for symlinking remotely. #11942 (comment) |
Let's say you have a large binary that can be compiled/built remotely but requires some hardware to run so the test execution needs to be local. Let's say the test is super simple (like a smoke test) but you want to force execution so you do
What would be reasonable might be to not waste download efforts. If Bazel fetches the input artifact to the local cache then it should stay there. The reason it doesn't stay there currently I think is because of the local action cache not being aware of those artifacts being present. |
This would be awesome btw. Is there someplace I can track progress on this? |
Sorry for the delay. I was OOO.
Good point! I will look into this.
This is still under the design stage and will publish once finalized. |
I believe this was fixed in 32b0f5a. Internal actions that create a symlink should no longer cause the symlink's target to be downloaded when |
Description of the problem / feature request:
Bazel does not cache Symlink and SolibSymlink actions. Since the remote-cache API allows caching of symlinks this should be possible to implement.
Feature requests: what underlying problem are you trying to solve with this feature?
When used on a clean output base but with the entire build/test cached remotely this leads to unnecessary downloads or action outputs even when the actual build/test action is already cached. Coupled with the
--remote_download_minimal
this leads to repeated downloads for a fully cached build without even shutting down the bezel server. For larger binaries/libraries this leads to significant time wastage.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
And create a build file
Now run the command:
Everything should be sent to the remote cache now. Now clean your output base to simulate another system running the same build. Then re run the build.
Bazel will download the remote binaries again on repeated invocations (remote_download_minimal ensures that we don't even need a clean anymore).
What operating system are you running Bazel on?
Linux
What's the output of
bazel info release
?3.0.0
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.NA
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?NA
Have you found anything relevant by searching the web?
There is #6862 but it doesn't cover this particular usage pattern.
Any other information, logs, or outputs that you want to share?
The problem can be circumvented by using
--remote_download_outputs=all
or eventoplevel
in some scenarios depending on the dependency graph but this is suboptimal.The text was updated successfully, but these errors were encountered: