Skip to content

Commit 8bf9907

Browse files
committed
switch to dedicated rpc
1 parent 7592702 commit 8bf9907

File tree

1 file changed

+46
-52
lines changed

1 file changed

+46
-52
lines changed

build/bazel/remote/execution/v2/remote_execution.proto

Lines changed: 46 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,13 @@ service ContentAddressableStorage {
430430
rpc GetTree(GetTreeRequest) returns (stream GetTreeResponse) {
431431
option (google.api.http) = { get: "/v2/{instance_name=**}/blobs/{root_digest.hash}/{root_digest.size_bytes}:getTree" };
432432
}
433+
434+
// Fetch the list of dictionaries use in Zstd compression.
435+
//
436+
// Servers MUST implement this RPC method iff the `ZSTD_DICT` compressor is supported.
437+
rpc GetZstdDictionaries(GetZstdDictionariesRequest) returns (GetZstdDictionariesResponse) {
438+
option (google.api.http) = { get: "/v2/{instance_name=**}/blobs:zstdDictionaries" };
439+
}
433440
}
434441

435442
// The Capabilities service may be used by remote execution clients to query
@@ -1814,6 +1821,39 @@ message GetTreeResponse {
18141821
string next_page_token = 2;
18151822
}
18161823

1824+
message GetZstdDictionariesRequest {
1825+
// The instance of the execution system to operate against. A server may
1826+
// support multiple instances of the execution system (with their own workers,
1827+
// storage, caches, etc.). The server MAY require use of this field to select
1828+
// between them in an implementation-defined fashion, otherwise it can be
1829+
// omitted.
1830+
string instance_name = 1;
1831+
1832+
// The digest functions supported by the client.
1833+
// Must be one of the server's supported digest functions listed in
1834+
// [CacheCapabilities.digest_functions][build.bazel.remote.execution.v2.CacheCapabilities.digest_functions].
1835+
DigestFunction.Value digest_function = 2;
1836+
}
1837+
1838+
message GetZstdDictionariesResponse {
1839+
message Dictionary {
1840+
uint32 id = 1;
1841+
Digest digest = 2;
1842+
}
1843+
1844+
// The dictionary ID that clients SHOULD use when uploading
1845+
// objects into the Content Addressable Storage. An entry for
1846+
// this dictionary ID MUST be present in `dictionaries`.
1847+
uint32 default_dictionary_id = 1;
1848+
1849+
// Dictionaries that may be used by the server when returning
1850+
// objects stored in the Content Addressable Storage. The key
1851+
// corresponds to a dictionary ID, as described in RFC 8878,
1852+
// section 5, while the value refers to a dictionary
1853+
// as described in RFC 8878, chapter 6.
1854+
repeated Dictionary dictionaries = 2;
1855+
}
1856+
18171857
// A request message for
18181858
// [Capabilities.GetCapabilities][build.bazel.remote.execution.v2.Capabilities.GetCapabilities].
18191859
message GetCapabilitiesRequest {
@@ -1823,15 +1863,6 @@ message GetCapabilitiesRequest {
18231863
// between them in an implementation-defined fashion, otherwise it can be
18241864
// omitted.
18251865
string instance_name = 1;
1826-
1827-
// All the digest functions supported by the client.
1828-
// Server should consider which digest functions the client supports to use
1829-
// the correct Digest in the
1830-
// [ServerCapabilities][build.bazel.remote.execution.v2.ServerCapabilities]
1831-
// response.
1832-
// If there is no overlapping between client's and server's supported digest
1833-
// functions, then server MAY omit the digest fields in the response.
1834-
repeated DigestFunction.Value digest_functions = 1;
18351866
}
18361867

18371868
// A response message for
@@ -2009,40 +2040,18 @@ message Compressor {
20092040

20102041
// Zstandard compression with dictionary.
20112042
//
2012-
// When this is used, the server MUST advertise the dictionaries by
2013-
// including
2014-
// [ZstdDictionaries][build.bazel.remote.execution.v2.ZstdDictionaries]
2015-
// digest in CacheCapabilities.
2043+
// Servers which support this compressor MUST implement
2044+
// [ContentAddressableStorage.GetZstdDictionaries][build.bazel.remote.execution.v2.ContentAddressableStorage.GetZstdDictionaries].
2045+
//
2046+
// Clients which support this compressor SHOULD call `GetZstdDictionaries`
2047+
// rpc to obtain the dictionaries from the server to be used for
2048+
// ZSTD compression/decompression.
20162049
ZSTD_DICT = 4;
20172050
}
20182051
}
20192052

2020-
message ZstdDictionaries {
2021-
message Dictionary {
2022-
uint32 id 1;
2023-
Digest digest 2;
2024-
}
2025-
2026-
// The dictionary ID that clients SHOULD use when uploading
2027-
// objects into the Content Addressable Storage. An entry for
2028-
// this dictionary ID MUST be present in `dictionaries`.
2029-
uint32 default_dictionary_id = 1;
2030-
2031-
// Dictionaries that may be used by the server when returning
2032-
// objects stored in the Content Addressable Storage. The key
2033-
// corresponds to a dictionary ID, as described in RFC 8878,
2034-
// section 5, while the value refers to a dictionary
2035-
// as described in RFC 8878, chapter 6.
2036-
repeated Dictionary dictionaries = 2;
2037-
}
2038-
20392053
// Capabilities of the remote cache system.
20402054
message CacheCapabilities {
2041-
message QualifiedDigest {
2042-
Digest digest = 1;
2043-
DigestFunction.value digest_function = 2;
2044-
}
2045-
20462055
// All the digest functions supported by the remote cache.
20472056
// Remote cache may support multiple digest functions simultaneously.
20482057
repeated DigestFunction.Value digest_functions = 1;
@@ -2074,21 +2083,6 @@ message CacheCapabilities {
20742083
// [BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs]
20752084
// requests.
20762085
repeated Compressor.Value supported_batch_update_compressors = 7;
2077-
2078-
// The digest of the
2079-
// [ZstdDictionaries][build.bazel.remote.execution.v2.ZstdDictionaries]
2080-
// that contains all the dictionaries supported by the remote cache.
2081-
//
2082-
// Digest function used should be one of the digest functions that both
2083-
// client and server support, as specified in digest_functions field in
2084-
// [CacheCapabilities.digest_functions][build.bazel.remote.execution.v2.CacheCapabilities.digest_functions]
2085-
// and
2086-
// [GetCapabilitiesRequest.digest_functions][build.bazel.remote.execution.v2.GetCapabilitiesRequest.digest_functions].
2087-
//
2088-
// If there is no overlapping between client's and server's supported
2089-
// dictionaries, then server MAY omit the dictionaries field in the
2090-
// response.
2091-
QualifiedDigest zstd_dictionaries = 8;
20922086
}
20932087

20942088
// Capabilities of the remote execution system.

0 commit comments

Comments
 (0)