@@ -430,6 +430,13 @@ service ContentAddressableStorage {
430
430
rpc GetTree (GetTreeRequest ) returns (stream GetTreeResponse ) {
431
431
option (google.api.http ) = { get : "/v2/{instance_name=**}/blobs/{root_digest.hash}/{root_digest.size_bytes}:getTree" };
432
432
}
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
+ }
433
440
}
434
441
435
442
// The Capabilities service may be used by remote execution clients to query
@@ -1814,6 +1821,39 @@ message GetTreeResponse {
1814
1821
string next_page_token = 2 ;
1815
1822
}
1816
1823
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
+
1817
1857
// A request message for
1818
1858
// [Capabilities.GetCapabilities][build.bazel.remote.execution.v2.Capabilities.GetCapabilities].
1819
1859
message GetCapabilitiesRequest {
@@ -1823,15 +1863,6 @@ message GetCapabilitiesRequest {
1823
1863
// between them in an implementation-defined fashion, otherwise it can be
1824
1864
// omitted.
1825
1865
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 ;
1835
1866
}
1836
1867
1837
1868
// A response message for
@@ -2009,40 +2040,18 @@ message Compressor {
2009
2040
2010
2041
// Zstandard compression with dictionary.
2011
2042
//
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.
2016
2049
ZSTD_DICT = 4 ;
2017
2050
}
2018
2051
}
2019
2052
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
-
2039
2053
// Capabilities of the remote cache system.
2040
2054
message CacheCapabilities {
2041
- message QualifiedDigest {
2042
- Digest digest = 1 ;
2043
- DigestFunction.value digest_function = 2 ;
2044
- }
2045
-
2046
2055
// All the digest functions supported by the remote cache.
2047
2056
// Remote cache may support multiple digest functions simultaneously.
2048
2057
repeated DigestFunction.Value digest_functions = 1 ;
@@ -2074,21 +2083,6 @@ message CacheCapabilities {
2074
2083
// [BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs]
2075
2084
// requests.
2076
2085
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 ;
2092
2086
}
2093
2087
2094
2088
// Capabilities of the remote execution system.
0 commit comments