-
Notifications
You must be signed in to change notification settings - Fork 233
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_execution: implement OSS write_action_result
for local_only
cache uploads
#764
base: main
Are you sure you want to change the base?
remote_execution: implement OSS write_action_result
for local_only
cache uploads
#764
Conversation
69c97fc
to
24771e8
Compare
@JakobDegen @ndmitchell PTAL if you get a chance. I think I've solved every major follow up for this change from the original PR, including Neil's (I know it's been a long time!), so I think this is OK to merge and strictly an improvement. |
586bb96
to
762456a
Compare
We're very interested in this - it would be a dramatic improvement for the way we use buck2 at System Initiative. Yum. |
bdad79a
to
a7dc8a3
Compare
b9d43ba
to
0878208
Compare
0878208
to
33b0fc1
Compare
b57bed5
to
f95ec50
Compare
f95ec50
to
ed6a836
Compare
ed6a836
to
895849d
Compare
ba3e981
to
5e8cc1d
Compare
…` cache uploads Forward port of part of <facebook#477>, which implements code in the OSS path for putting results of actions marked `local_only = True` into the RBE `ActionCache`. For people actually using the "remote execution" part of RBE and not just a cache, this rather large omission in the system will often be transparently mitigated because RBE services will not only record `ActionCache` entries on your behalf, they will also implement "EX-to-AC" forwarding where any execution calls will immediately get looked up in the `ActionCache` anyway as an optimization. Which means you'll never see this for things that properly hit CAS inputs/outputs. However, a `CommandExecutorConfig` configured with `remote_enabled = False` can still enable `remote_cache_enabled = allow_cache_uploads = True` which will both enable the ActionCache/CAS support, and also allow uploads to those interfaces too. The most useful example of this type of setup is in a CI system like GitHub Actions: where you run the build inside a container or image that provides something quasi-hermetic (e.g. including your toolchains), while the RBE system is purely a cache storing inputs/outputs/ActionCache entries and never uses remote execution. The hope is that this functionality will soon be plug-and-play on GitHub using an RBE-to-GHA caching proxy, so Buck2 projects will be able to get a quick and easy cache, but without RE. Therefore this functionality will become highly useful. Co-authored-by: Austin Seipp <[email protected]>
5e8cc1d
to
f780555
Compare
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Forward port of part of #477, which implements code in the OSS path for putting results of actions marked
local_only = True
into the RBEActionCache
.For people actually using the "remote execution" part of RBE and not just a cache, this rather large omission in the system will often be transparently mitigated because RBE services will not only record
ActionCache
entries on your behalf, they will also implement "EX-to-AC" forwarding where any execution calls will immediately get looked up in theActionCache
anyway as an optimization. Which means you'll never see this for things that properly hit CAS inputs/outputs.However, a
CommandExecutorConfig
configured withremote_enabled = False
can still enableremote_cache_enabled = allow_cache_uploads = True
which will both enable the ActionCache/CAS support, and also allow uploads to those interfaces too.The most useful example of this type of setup is in a CI system like GitHub Actions: where you run the build inside a container or image that provides something quasi-hermetic (e.g. including your toolchains), while the RBE system is purely a cache storing inputs/outputs/ActionCache entries and never uses remote execution.
The hope is that this functionality will soon be plug-and-play on GitHub using an RBE-to-GHA caching proxy, so Buck2 projects will be able to get a quick and easy cache, but without RE. Therefore this functionality will become highly useful.
Testing
I can submit tests too, though I'm not sure where. But, using the testing example from #477, running
./buck2 clean && BUCK_LOG=buck2_execute_impl=debug ./buck2 build -v3 //:
where./buck2
is the dotslash build from the2024-09-02
tag gets me:The
(Not supported)
comes directly from the previous code and is the error mentioned by Neil and Cormac in the previous issue.Executing with this patch (truncated output of the exact same command above):
And then running the command again, showing a cache hit: