--- remote_execution.proto.orig 1970-01-01 01:00:00.000000000 +0100 +++ remote_execution.proto 2023-11-03 13:32:37.502134562 +0100 @@ -406,6 +406,29 @@ rpc GetTree(GetTreeRequest) returns (stream GetTreeResponse) { option (google.api.http) = { get: "/v2/{instance_name=**}/blobs/{root_digest.hash}/{root_digest.size_bytes}:getTree" }; } + + // Split a blob into chunks. + // + // Clients can use this API before downloading a blob to determine which parts + // of the blob are already present locally and do not need to be downloaded + // again. + // + // The blob is split into chunks which are individually stored in the CAS. A + // list of the chunk digests is returned in the order in which the chunks have + // to be concatenated to assemble the requested blob. + // + // Using this API is optional but it allows clients to download only the + // missing parts of a blob instead of the entire blob data, which in turn can + // considerably reduce network traffic. + // + // Errors: + // + // * `NOT_FOUND`: The requested blob is not present in the CAS. + // * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob + // chunks. + rpc SplitBlob(SplitBlobRequest) returns (SplitBlobResponse) { + option (google.api.http) = { get: "/v2/{instance_name=**}/blobs/{blob_digest.hash}/{blob_digest.size_bytes}:splitBlob" }; + } } // The Capabilities service may be used by remote execution clients to query @@ -1601,6 +1624,27 @@ } // A request message for +// [ContentAddressableStorage.SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob]. +message SplitBlobRequest { + // 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 of the blob to be splitted. + Digest blob_digest = 2; +} + +// A response message for +// [ContentAddressableStorage.SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob]. +message SplitBlobResponse { + // The digests of the chunks into in which the blob was splitted. + repeated Digest chunk_digests = 1; +} + +// A request message for // [Capabilities.GetCapabilities][build.bazel.remote.execution.v2.Capabilities.GetCapabilities]. message GetCapabilitiesRequest { // The instance of the execution system to operate against. A server may