remote_execution: implement OSS write_action_result
for local_only
cache uploads
#764
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: