Skip to content

Commit

Permalink
switch to dedicated rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Jan 23, 2024
1 parent 7592702 commit 71fd6d1
Showing 1 changed file with 46 additions and 52 deletions.
98 changes: 46 additions & 52 deletions build/bazel/remote/execution/v2/remote_execution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,13 @@ service ContentAddressableStorage {
rpc GetTree(GetTreeRequest) returns (stream GetTreeResponse) {
option (google.api.http) = { get: "/v2/{instance_name=**}/blobs/{root_digest.hash}/{root_digest.size_bytes}:getTree" };
}

// Fetch the list of dictionaries use in Zstd compression.
//
// Server must implement this RPC method iff the `ZSTD_DICT` compressor is supported.
rpc GetZstdDictionaries(GetZstdDictionariesRequest) returns (GetZstdDictionariesResponse) {
option (google.api.http) = { get: "/v2/{instance_name=**}/blobs:zstdDictionaries" };
}
}

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

message GetZstdDictionariesRequest {
// The instance of the execution system to operate against. A server may
// support multiple instances of the execution system (with their own workers,
// storage, caches, etc.). The server MAY require use of this field to select
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;

// The digest functions supported by the client.
// Must be one of the server's supported digest functions listed in
// [CacheCapabilities.digest_functions][build.bazel.remote.execution.v2.CacheCapabilities.digest_functions].
DigestFunction.Value digest_function = 2;
}

message GetZstdDictionariesResponse {
message Dictionary {
uint32 id = 1;
Digest digest = 2;
}

// The dictionary ID that clients SHOULD use when uploading
// objects into the Content Addressable Storage. An entry for
// this dictionary ID MUST be present in `dictionaries`.
uint32 default_dictionary_id = 1;

// Dictionaries that may be used by the server when returning
// objects stored in the Content Addressable Storage. The key
// corresponds to a dictionary ID, as described in RFC 8878,
// section 5, while the value refers to a dictionary
// as described in RFC 8878, chapter 6.
repeated Dictionary dictionaries = 2;
}

// A request message for
// [Capabilities.GetCapabilities][build.bazel.remote.execution.v2.Capabilities.GetCapabilities].
message GetCapabilitiesRequest {
Expand All @@ -1823,15 +1863,6 @@ message GetCapabilitiesRequest {
// between them in an implementation-defined fashion, otherwise it can be
// omitted.
string instance_name = 1;

// All the digest functions supported by the client.
// Server should consider which digest functions the client supports to use
// the correct Digest in the
// [ServerCapabilities][build.bazel.remote.execution.v2.ServerCapabilities]
// response.
// If there is no overlapping between client's and server's supported digest
// functions, then server MAY omit the digest fields in the response.
repeated DigestFunction.Value digest_functions = 1;
}

// A response message for
Expand Down Expand Up @@ -2009,40 +2040,18 @@ message Compressor {

// Zstandard compression with dictionary.
//
// When this is used, the server MUST advertise the dictionaries by
// including
// [ZstdDictionaries][build.bazel.remote.execution.v2.ZstdDictionaries]
// digest in CacheCapabilities.
// Servers which support this compressor MUST implements
// [ContentAddressableStorage.GetZstdDictionaries][build.bazel.remote.execution.v2.ContentAddressableStorage.GetZstdDictionaries].
//
// Clients which support this compressor SHOULD call `GetZstdDictionaries`
// rpc to obtain the dictionaries from the server to be used for
// ZSTD compression/decompression.
ZSTD_DICT = 4;
}
}

message ZstdDictionaries {
message Dictionary {
uint32 id 1;
Digest digest 2;
}

// The dictionary ID that clients SHOULD use when uploading
// objects into the Content Addressable Storage. An entry for
// this dictionary ID MUST be present in `dictionaries`.
uint32 default_dictionary_id = 1;

// Dictionaries that may be used by the server when returning
// objects stored in the Content Addressable Storage. The key
// corresponds to a dictionary ID, as described in RFC 8878,
// section 5, while the value refers to a dictionary
// as described in RFC 8878, chapter 6.
repeated Dictionary dictionaries = 2;
}

// Capabilities of the remote cache system.
message CacheCapabilities {
message QualifiedDigest {
Digest digest = 1;
DigestFunction.value digest_function = 2;
}

// All the digest functions supported by the remote cache.
// Remote cache may support multiple digest functions simultaneously.
repeated DigestFunction.Value digest_functions = 1;
Expand Down Expand Up @@ -2074,21 +2083,6 @@ message CacheCapabilities {
// [BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs]
// requests.
repeated Compressor.Value supported_batch_update_compressors = 7;

// The digest of the
// [ZstdDictionaries][build.bazel.remote.execution.v2.ZstdDictionaries]
// that contains all the dictionaries supported by the remote cache.
//
// Digest function used should be one of the digest functions that both
// client and server support, as specified in digest_functions field in
// [CacheCapabilities.digest_functions][build.bazel.remote.execution.v2.CacheCapabilities.digest_functions]
// and
// [GetCapabilitiesRequest.digest_functions][build.bazel.remote.execution.v2.GetCapabilitiesRequest.digest_functions].
//
// If there is no overlapping between client's and server's supported
// dictionaries, then server MAY omit the dictionaries field in the
// response.
QualifiedDigest zstd_dictionaries = 8;
}

// Capabilities of the remote execution system.
Expand Down

0 comments on commit 71fd6d1

Please sign in to comment.