Split remote providers into their own crates - #19958
Conversation
0d32612 to
419288c
Compare
…rced by coherence)
419288c to
db46815
Compare
| async fn get_action_result( | ||
| &self, | ||
| action_digest: Digest, | ||
| build_id: &str, |
There was a problem hiding this comment.
This has changed from context: &process_execution::Context to just build_id: &str, because that's all that's used and it ensures that this code doesn't need to depend on process_execution.
|
|
||
| const REAPI_ADDRESS_SCHEMAS: [&str; 4] = ["grpc://", "grpcs://", "http://", "https://"]; | ||
|
|
||
| // TODO(#19902): a unified view of choosing a provider would be nice |
There was a problem hiding this comment.
These two functions are very similar, but I haven't tried to merge them as part of this work. There's two closely-related points in #19902 for follow-up ("tweaking the internal Rust details of how the remote providers are built to have less duplication", "improving how the options are fed through").
|
|
||
| pub(crate) const STORE_BATCH_API_SIZE_LIMIT: usize = 4 * 1024 * 1024; | ||
|
|
||
| pub fn big_file_fingerprint() -> Fingerprint { |
There was a problem hiding this comment.
The functions here have moved to testutil so they can be used by the remote_provider_... tests without duplication.
tgolsson
left a comment
There was a problem hiding this comment.
Looks overall good, one comment. A bit hard to follow each individual move as I'm not familiar with all the code involved, but it mostly seems sensible.
If I have to make one complaint; it's that the remote_provider/remote_provider_xxx scheme is a bit redundant -- I'd repeat the domain if it wasn't nested, but when nesting it just leads to paths that are overly long -- it's a lot easier to distinguish remote_provider/{src,opendal,reapi,traits}/. And if you're in an shell, tab completion works better.
| parking_lot = { workspace = true } | ||
| opendal = { workspace = true } | ||
| remote_provider = { path = "../../remote_provider" } | ||
| remote_provider_reapi = { path = "../../remote_provider/remote_provider_reapi" } |
There was a problem hiding this comment.
This isn't in your graph in the PR description; and it seems maybe a bit leaky if we're just picking up this dependency for apply_headers?
There was a problem hiding this comment.
seems maybe a bit leaky if we're just picking up this dependency for apply_headers?
Yeah, I guess theoretically this should be entirely an implementation detail of providers surfaced by remote_provider... except currently the remote execution isn't wrapped up into a "provider" interface, just hard-coded to Bazel REAPI (and I could imagine it will remain this way), so it felt okay to leak here.
This isn't in your graph in the PR description
Oops good catch, fixed and updated the text to call it out too.
Yeah, sorry, it's a bit of a mess, especially how it's not just moving files around, but merging/splitting some too!
Yeah, I was in two minds, I definitely am sympathetic to the repetition being annoying... but I thought overall it's better if the crates names are spelled out for the |
This replaces uses of `RemoteCacheProviderOptions` with `RemoteStoreOptions` (previously `RemoteOptions`): they're very similar, and only separate because they were previously in very different parts of the codebase, but this has changed with #19958. This makes a few additional changes to make the merging smoother: - removes the "capability cell" sharing optimisation, which enabled sharing of the `GetCapabilitiesRequest` gRPC request result between the CAS and the remote execution providers, if both were being used with the same address. I thought that optimising one-time (on start-up) requests from 2 to 1 wasn't worth the complexity of plumbing it through these more generic options, but can restore it if it is. - renames various fields This does meant that there's a few options that are seemingly irrelevant to the action cache providers, e.g. "batch API size limit" is meaningless. I think this is fine: I think it's fundamental to supporting multiple providers that there'll be a grab-bag of options, which some providers support and others do not. The commits are individually reviewable. (This is one point of #19902.)
There's a been a few new crates added recently (#18854, #19958), but we didn't update `[workspace].members` and `[workspace].default-members` in `src/rust/engine/Cargo.toml` to match. In addition, the older `protos` and `grpc_util` weren't listed. This syncs up the lists. The lists of `members` and `default-members` now exactly matches, except for `fs/brfs` as commented. They also match the `Cargo.toml`s that exist on disk.
This does a no-functionality-change refactoring of the remote store providers (backed by REAPI and OpenDAL). This splits the concept of a remote provider out into their own internal "surface" crate
remote_provider, plus three crates that are (mostly) implementation-details of that one:remote_provider/remote_provider_traitsfor the traits (and structs!) that the various providers have to implementremote_provider/remote_provider_reapifor the gRPC/REAPI-backed providerremote_provider/remote_provider_opendalfor the OpenDAL-backed providerThey're arranged like this:
graph BT remote("process_execution/remote (existing)") store("fs/store (existing)") traits("remote_provider_traits (new)") grpc("remote_provider_reapi (new)") opendal("remote_provider_opendal (new)") selector("remote_provider (new)") grpc --> traits opendal --> traits selector --> grpc selector --> opendal remote -- for remote execution --> grpc remote --> selector store --> selectorTheoretically the new crates other than
remote_providerare an implementation detail... except there's a helper inremote_provider_reapithat's used for the remote execution inprocess_execution/remote, in addition to the byte store and action cache, hence the dependency there.This is one point of #19902, following up on #19827 (comment).
The commits are individually reviewable, although the overall PR view gives a slightly more useful view of the overall file renames for some files.