@vzn/vx-reapi 0.0.0 → 0.0.485
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +502 -0
- package/index.ts +4 -0
- package/package.json +45 -6
- package/protos/build/bazel/remote/execution/v2/remote_execution.proto +2516 -0
- package/protos/build/bazel/semver/semver.proto +41 -0
- package/protos/google/api/annotations.proto +31 -0
- package/protos/google/api/client.proto +598 -0
- package/protos/google/api/field_behavior.proto +104 -0
- package/protos/google/api/http.proto +370 -0
- package/protos/google/api/launch_stage.proto +72 -0
- package/protos/google/bytestream/bytestream.proto +178 -0
- package/protos/google/longrunning/operations.proto +265 -0
- package/protos/google/rpc/code.proto +186 -0
- package/protos/google/rpc/status.proto +48 -0
- package/src/cache.ts +199 -0
- package/src/executor.ts +1805 -0
- package/src/index.ts +277 -0
- package/src/merkle.ts +867 -0
- package/src/wire.ts +1658 -0
|
@@ -0,0 +1,2516 @@
|
|
|
1
|
+
// Copyright 2018 The Bazel Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package build.bazel.remote.execution.v2;
|
|
18
|
+
|
|
19
|
+
import "build/bazel/semver/semver.proto";
|
|
20
|
+
import "google/api/annotations.proto";
|
|
21
|
+
import "google/longrunning/operations.proto";
|
|
22
|
+
import "google/protobuf/any.proto";
|
|
23
|
+
import "google/protobuf/duration.proto";
|
|
24
|
+
import "google/protobuf/timestamp.proto";
|
|
25
|
+
import "google/protobuf/wrappers.proto";
|
|
26
|
+
import "google/rpc/status.proto";
|
|
27
|
+
|
|
28
|
+
option csharp_namespace = "Build.Bazel.Remote.Execution.V2";
|
|
29
|
+
option go_package = "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2;remoteexecution";
|
|
30
|
+
option java_multiple_files = true;
|
|
31
|
+
option java_outer_classname = "RemoteExecutionProto";
|
|
32
|
+
option java_package = "build.bazel.remote.execution.v2";
|
|
33
|
+
option objc_class_prefix = "REX";
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// The Remote Execution API is used to execute an
|
|
37
|
+
// [Action][build.bazel.remote.execution.v2.Action] on the remote
|
|
38
|
+
// workers.
|
|
39
|
+
//
|
|
40
|
+
// As with other services in the Remote Execution API, any call may return an
|
|
41
|
+
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
|
|
42
|
+
// information about when the client should retry the request; clients SHOULD
|
|
43
|
+
// respect the information provided.
|
|
44
|
+
service Execution {
|
|
45
|
+
// Execute an action remotely.
|
|
46
|
+
//
|
|
47
|
+
// In order to execute an action, the client must first upload all of the
|
|
48
|
+
// inputs, the
|
|
49
|
+
// [Command][build.bazel.remote.execution.v2.Command] to run, and the
|
|
50
|
+
// [Action][build.bazel.remote.execution.v2.Action] into the
|
|
51
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
|
|
52
|
+
// It then calls `Execute` with an `action_digest` referring to them. The
|
|
53
|
+
// server will run the action and eventually return the result.
|
|
54
|
+
//
|
|
55
|
+
// The input `Action`'s fields MUST meet the various canonicalization
|
|
56
|
+
// requirements specified in the documentation for their types so that it has
|
|
57
|
+
// the same digest as other logically equivalent `Action`s. The server MAY
|
|
58
|
+
// enforce the requirements and return errors if a non-canonical input is
|
|
59
|
+
// received. It MAY also proceed without verifying some or all of the
|
|
60
|
+
// requirements, such as for performance reasons. If the server does not
|
|
61
|
+
// verify the requirement, then it will treat the `Action` as distinct from
|
|
62
|
+
// another logically equivalent action if they hash differently.
|
|
63
|
+
//
|
|
64
|
+
// Returns a stream of
|
|
65
|
+
// [google.longrunning.Operation][google.longrunning.Operation] messages
|
|
66
|
+
// describing the resulting execution, with eventual `response`
|
|
67
|
+
// [ExecuteResponse][build.bazel.remote.execution.v2.ExecuteResponse]. The
|
|
68
|
+
// `metadata` on the operation is of type
|
|
69
|
+
// [ExecuteOperationMetadata][build.bazel.remote.execution.v2.ExecuteOperationMetadata].
|
|
70
|
+
//
|
|
71
|
+
// If the client remains connected after the first response is returned after
|
|
72
|
+
// the server, then updates are streamed as if the client had called
|
|
73
|
+
// [WaitExecution][build.bazel.remote.execution.v2.Execution.WaitExecution]
|
|
74
|
+
// until the execution completes or the request reaches an error. The
|
|
75
|
+
// operation can also be queried using [Operations
|
|
76
|
+
// API][google.longrunning.Operations.GetOperation].
|
|
77
|
+
//
|
|
78
|
+
// The server NEED NOT implement other methods or functionality of the
|
|
79
|
+
// Operations API.
|
|
80
|
+
//
|
|
81
|
+
// Errors discovered during creation of the `Operation` will be reported
|
|
82
|
+
// as gRPC Status errors, while errors that occurred while running the
|
|
83
|
+
// action will be reported in the `status` field of the `ExecuteResponse`. The
|
|
84
|
+
// server MUST NOT set the `error` field of the `Operation` proto.
|
|
85
|
+
// The possible errors include:
|
|
86
|
+
//
|
|
87
|
+
// * `INVALID_ARGUMENT`: One or more arguments are invalid.
|
|
88
|
+
// * `FAILED_PRECONDITION`: One or more errors occurred in setting up the
|
|
89
|
+
// action requested, such as a missing input or command or no worker being
|
|
90
|
+
// available. The client may be able to fix the errors and retry.
|
|
91
|
+
// * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run
|
|
92
|
+
// the action.
|
|
93
|
+
// * `UNAVAILABLE`: Due to a transient condition, such as all workers being
|
|
94
|
+
// occupied (and the server does not support a queue), the action could not
|
|
95
|
+
// be started. The client should retry.
|
|
96
|
+
// * `INTERNAL`: An internal error occurred in the execution engine or the
|
|
97
|
+
// worker.
|
|
98
|
+
// * `DEADLINE_EXCEEDED`: The execution timed out.
|
|
99
|
+
// * `CANCELLED`: The operation was cancelled by the client. This status is
|
|
100
|
+
// only possible if the server implements the Operations API CancelOperation
|
|
101
|
+
// method, and it was called for the current execution.
|
|
102
|
+
//
|
|
103
|
+
// In the case of a missing input or command, the server SHOULD additionally
|
|
104
|
+
// send a [PreconditionFailure][google.rpc.PreconditionFailure] error detail
|
|
105
|
+
// where, for each requested blob not present in the CAS, there is a
|
|
106
|
+
// `Violation` with a `type` of `MISSING` and a `subject` of
|
|
107
|
+
// `"blobs/{digest_function/}{hash}/{size}"` indicating the digest of the
|
|
108
|
+
// missing blob. The `subject` is formatted the same way as the
|
|
109
|
+
// `resource_name` provided to
|
|
110
|
+
// [ByteStream.Read][google.bytestream.ByteStream.Read], with the leading
|
|
111
|
+
// instance name omitted. `digest_function` MUST thus be omitted if its value
|
|
112
|
+
// is one of MD5, MURMUR3, SHA1, SHA256, SHA384, SHA512, or VSO.
|
|
113
|
+
//
|
|
114
|
+
// The server does not need to guarantee that a call to this method leads to
|
|
115
|
+
// at most one execution of the action. The server MAY execute the action
|
|
116
|
+
// multiple times, potentially in parallel. These redundant executions MAY
|
|
117
|
+
// continue to run, even if the operation is completed.
|
|
118
|
+
rpc Execute(ExecuteRequest) returns (stream google.longrunning.Operation) {
|
|
119
|
+
option (google.api.http) = { post: "/v2/{instance_name=**}/actions:execute" body: "*" };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Wait for an execution operation to complete. When the client initially
|
|
123
|
+
// makes the request, the server immediately responds with the current status
|
|
124
|
+
// of the execution. The server will leave the request stream open until the
|
|
125
|
+
// operation completes, and then respond with the completed operation. The
|
|
126
|
+
// server MAY choose to stream additional updates as execution progresses,
|
|
127
|
+
// such as to provide an update as to the state of the execution.
|
|
128
|
+
//
|
|
129
|
+
// In addition to the cases described for Execute, the WaitExecution method
|
|
130
|
+
// may fail as follows:
|
|
131
|
+
//
|
|
132
|
+
// * `NOT_FOUND`: The operation no longer exists due to any of a transient
|
|
133
|
+
// condition, an unknown operation name, or if the server implements the
|
|
134
|
+
// Operations API DeleteOperation method and it was called for the current
|
|
135
|
+
// execution. The client should call `Execute` to retry.
|
|
136
|
+
rpc WaitExecution(WaitExecutionRequest) returns (stream google.longrunning.Operation) {
|
|
137
|
+
option (google.api.http) = { post: "/v2/{name=operations/**}:waitExecution" body: "*" };
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// The action cache API is used to query whether a given action has already been
|
|
142
|
+
// performed and, if so, retrieve its result. Unlike the
|
|
143
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage],
|
|
144
|
+
// which addresses blobs by their own content, the action cache addresses the
|
|
145
|
+
// [ActionResult][build.bazel.remote.execution.v2.ActionResult] by a
|
|
146
|
+
// digest of the encoded [Action][build.bazel.remote.execution.v2.Action]
|
|
147
|
+
// which produced them.
|
|
148
|
+
//
|
|
149
|
+
// The lifetime of entries in the action cache is implementation-specific, but
|
|
150
|
+
// the server SHOULD assume that more recently used entries are more likely to
|
|
151
|
+
// be used again.
|
|
152
|
+
//
|
|
153
|
+
// As with other services in the Remote Execution API, any call may return an
|
|
154
|
+
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
|
|
155
|
+
// information about when the client should retry the request; clients SHOULD
|
|
156
|
+
// respect the information provided.
|
|
157
|
+
service ActionCache {
|
|
158
|
+
// Retrieve a cached execution result.
|
|
159
|
+
//
|
|
160
|
+
// Implementations SHOULD ensure that any blobs referenced from the
|
|
161
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
|
|
162
|
+
// are available at the time of returning the
|
|
163
|
+
// [ActionResult][build.bazel.remote.execution.v2.ActionResult] and will be
|
|
164
|
+
// for some period of time afterwards. The lifetimes of the referenced blobs SHOULD be increased
|
|
165
|
+
// if necessary and applicable.
|
|
166
|
+
//
|
|
167
|
+
// Errors:
|
|
168
|
+
//
|
|
169
|
+
// * `NOT_FOUND`: The requested `ActionResult` is not in the cache.
|
|
170
|
+
rpc GetActionResult(GetActionResultRequest) returns (ActionResult) {
|
|
171
|
+
option (google.api.http) = { get: "/v2/{instance_name=**}/actionResults/{action_digest.hash}/{action_digest.size_bytes}" };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Upload a new execution result.
|
|
175
|
+
//
|
|
176
|
+
// In order to allow the server to perform access control based on the type of
|
|
177
|
+
// action, and to assist with client debugging, the client MUST first upload
|
|
178
|
+
// the [Action][build.bazel.remote.execution.v2.Action] that produced the
|
|
179
|
+
// result, along with its
|
|
180
|
+
// [Command][build.bazel.remote.execution.v2.Command], into the
|
|
181
|
+
// `ContentAddressableStorage`.
|
|
182
|
+
//
|
|
183
|
+
// Server implementations MAY modify the
|
|
184
|
+
// `UpdateActionResultRequest.action_result` and return an equivalent value.
|
|
185
|
+
//
|
|
186
|
+
// Errors:
|
|
187
|
+
//
|
|
188
|
+
// * `INVALID_ARGUMENT`: One or more arguments are invalid.
|
|
189
|
+
// * `FAILED_PRECONDITION`: One or more errors occurred in updating the
|
|
190
|
+
// action result, such as a missing command or action.
|
|
191
|
+
// * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the
|
|
192
|
+
// entry to the cache.
|
|
193
|
+
rpc UpdateActionResult(UpdateActionResultRequest) returns (ActionResult) {
|
|
194
|
+
option (google.api.http) = { put: "/v2/{instance_name=**}/actionResults/{action_digest.hash}/{action_digest.size_bytes}" body: "action_result" };
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// The CAS (content-addressable storage) is used to store the inputs to and
|
|
199
|
+
// outputs from the execution service. Each piece of content is addressed by the
|
|
200
|
+
// digest of its binary data.
|
|
201
|
+
//
|
|
202
|
+
// Most of the binary data stored in the CAS is opaque to the execution engine,
|
|
203
|
+
// and is only used as a communication medium. In order to build an
|
|
204
|
+
// [Action][build.bazel.remote.execution.v2.Action],
|
|
205
|
+
// however, the client will need to also upload the
|
|
206
|
+
// [Command][build.bazel.remote.execution.v2.Command] and input root
|
|
207
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] for the Action.
|
|
208
|
+
// The Command and Directory messages must be marshalled to wire format and then
|
|
209
|
+
// uploaded under the hash as with any other piece of content. In practice, the
|
|
210
|
+
// input root directory is likely to refer to other Directories in its
|
|
211
|
+
// hierarchy, which must also each be uploaded on their own.
|
|
212
|
+
//
|
|
213
|
+
// For small file uploads the client should group them together and call
|
|
214
|
+
// [BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs].
|
|
215
|
+
//
|
|
216
|
+
// For large uploads, the client must use the
|
|
217
|
+
// [Write method][google.bytestream.ByteStream.Write] of the ByteStream API.
|
|
218
|
+
//
|
|
219
|
+
// For uncompressed data, the `WriteRequest.resource_name` is of the following form:
|
|
220
|
+
// `{instance_name}/uploads/{uuid}/blobs/{digest_function/}{hash}/{size}{/optional_metadata}`
|
|
221
|
+
//
|
|
222
|
+
// Where:
|
|
223
|
+
// * `instance_name` is an identifier used to distinguish between the various
|
|
224
|
+
// instances on the server. Syntax and semantics of this field are defined
|
|
225
|
+
// by the server; Clients must not make any assumptions about it (e.g.,
|
|
226
|
+
// whether it spans multiple path segments or not). If it is the empty path,
|
|
227
|
+
// the leading slash is omitted, so that the `resource_name` becomes
|
|
228
|
+
// `uploads/{uuid}/blobs/{digest_function/}{hash}/{size}{/optional_metadata}`.
|
|
229
|
+
// To simplify parsing, a path segment cannot equal any of the following
|
|
230
|
+
// keywords: `blobs`, `uploads`, `actions`, `actionResults`, `operations`,
|
|
231
|
+
// `capabilities` or `compressed-blobs`.
|
|
232
|
+
// * `uuid` is a version 4 UUID generated by the client, used to avoid
|
|
233
|
+
// collisions between concurrent uploads of the same data. Clients MAY
|
|
234
|
+
// reuse the same `uuid` for uploading different blobs.
|
|
235
|
+
// * `digest_function` is a lowercase string form of a `DigestFunction.Value`
|
|
236
|
+
// enum, indicating which digest function was used to compute `hash`. If the
|
|
237
|
+
// digest function used is one of MD5, MURMUR3, SHA1, SHA256, SHA384, SHA512,
|
|
238
|
+
// or VSO, this component MUST be omitted. In that case the server SHOULD
|
|
239
|
+
// infer the digest function using the length of the `hash` and the digest
|
|
240
|
+
// functions announced in the server's capabilities.
|
|
241
|
+
// * `hash` and `size` refer to the [Digest][build.bazel.remote.execution.v2.Digest]
|
|
242
|
+
// of the data being uploaded.
|
|
243
|
+
// * `optional_metadata` is implementation specific data, which clients MAY omit.
|
|
244
|
+
// Servers MAY ignore this metadata.
|
|
245
|
+
//
|
|
246
|
+
// Data can alternatively be uploaded in compressed form, with the following
|
|
247
|
+
// `WriteRequest.resource_name` form:
|
|
248
|
+
// `{instance_name}/uploads/{uuid}/compressed-blobs/{compressor}/{digest_function/}{uncompressed_hash}/{uncompressed_size}{/optional_metadata}`
|
|
249
|
+
//
|
|
250
|
+
// Where:
|
|
251
|
+
// * `instance_name`, `uuid`, `digest_function` and `optional_metadata` are
|
|
252
|
+
// defined as above.
|
|
253
|
+
// * `compressor` is a lowercase string form of a `Compressor.Value` enum
|
|
254
|
+
// other than `identity`, which is supported by the server and advertised in
|
|
255
|
+
// [CacheCapabilities.supported_compressors][build.bazel.remote.execution.v2.CacheCapabilities.supported_compressors].
|
|
256
|
+
// * `uncompressed_hash` and `uncompressed_size` refer to the
|
|
257
|
+
// [Digest][build.bazel.remote.execution.v2.Digest] of the data being
|
|
258
|
+
// uploaded, once uncompressed. Servers MUST verify that these match
|
|
259
|
+
// the uploaded data once uncompressed, and MUST return an
|
|
260
|
+
// `INVALID_ARGUMENT` error in the case of mismatch.
|
|
261
|
+
//
|
|
262
|
+
// Note that when writing compressed blobs, the `WriteRequest.write_offset` in
|
|
263
|
+
// the initial request in a stream refers to the offset in the uncompressed form
|
|
264
|
+
// of the blob. In subsequent requests, `WriteRequest.write_offset` MUST be the
|
|
265
|
+
// sum of the first request's 'WriteRequest.write_offset' and the total size of
|
|
266
|
+
// all the compressed data bundles in the previous requests.
|
|
267
|
+
// Note that this mixes an uncompressed offset with a compressed byte length,
|
|
268
|
+
// which is nonsensical, but it is done to fit the semantics of the existing
|
|
269
|
+
// ByteStream protocol.
|
|
270
|
+
//
|
|
271
|
+
// Uploads of the same data MAY occur concurrently in any form, compressed or
|
|
272
|
+
// uncompressed.
|
|
273
|
+
//
|
|
274
|
+
// Clients SHOULD NOT use gRPC-level compression for ByteStream API `Write`
|
|
275
|
+
// calls of compressed blobs, since this would compress already-compressed data.
|
|
276
|
+
//
|
|
277
|
+
// When attempting an upload, if another client has already completed the upload
|
|
278
|
+
// (which may occur in the middle of a single upload if another client uploads
|
|
279
|
+
// the same blob concurrently), the request will terminate immediately without
|
|
280
|
+
// error, and with a response whose `committed_size` is the value `-1` if this
|
|
281
|
+
// is a compressed upload, or with the full size of the uploaded file if this is
|
|
282
|
+
// an uncompressed upload (regardless of how much data was transmitted by the
|
|
283
|
+
// client). If the client completes the upload but the
|
|
284
|
+
// [Digest][build.bazel.remote.execution.v2.Digest] does not match, an
|
|
285
|
+
// `INVALID_ARGUMENT` error will be returned. In either case, the client should
|
|
286
|
+
// not attempt to retry the upload.
|
|
287
|
+
//
|
|
288
|
+
// Small downloads can be grouped and requested in a batch via
|
|
289
|
+
// [BatchReadBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchReadBlobs].
|
|
290
|
+
//
|
|
291
|
+
// For large downloads, the client must use the
|
|
292
|
+
// [Read method][google.bytestream.ByteStream.Read] of the ByteStream API.
|
|
293
|
+
//
|
|
294
|
+
// For uncompressed data, the `ReadRequest.resource_name` is of the following form:
|
|
295
|
+
// `{instance_name}/blobs/{digest_function/}{hash}/{size}`
|
|
296
|
+
// Where `instance_name`, `digest_function`, `hash` and `size` are defined as
|
|
297
|
+
// for uploads.
|
|
298
|
+
//
|
|
299
|
+
// Data can alternatively be downloaded in compressed form, with the following
|
|
300
|
+
// `ReadRequest.resource_name` form:
|
|
301
|
+
// `{instance_name}/compressed-blobs/{compressor}/{digest_function/}{uncompressed_hash}/{uncompressed_size}`
|
|
302
|
+
//
|
|
303
|
+
// Where:
|
|
304
|
+
// * `instance_name`, `compressor` and `digest_function` are defined as for
|
|
305
|
+
// uploads.
|
|
306
|
+
// * `uncompressed_hash` and `uncompressed_size` refer to the
|
|
307
|
+
// [Digest][build.bazel.remote.execution.v2.Digest] of the data being
|
|
308
|
+
// downloaded, once uncompressed. Clients MUST verify that these match
|
|
309
|
+
// the downloaded data once uncompressed, and take appropriate steps in
|
|
310
|
+
// the case of failure such as retrying a limited number of times or
|
|
311
|
+
// surfacing an error to the user.
|
|
312
|
+
//
|
|
313
|
+
// When downloading compressed blobs:
|
|
314
|
+
// * `ReadRequest.read_offset` refers to the offset in the uncompressed form
|
|
315
|
+
// of the blob.
|
|
316
|
+
// * Servers MUST return `INVALID_ARGUMENT` if `ReadRequest.read_limit` is
|
|
317
|
+
// non-zero.
|
|
318
|
+
// * Servers MAY use any compression level they choose, including different
|
|
319
|
+
// levels for different blobs (e.g. choosing a level designed for maximum
|
|
320
|
+
// speed for data known to be incompressible).
|
|
321
|
+
// * Clients SHOULD NOT use gRPC-level compression, since this would compress
|
|
322
|
+
// already-compressed data.
|
|
323
|
+
//
|
|
324
|
+
// Servers MUST be able to provide data for all recently advertised blobs in
|
|
325
|
+
// each of the compression formats that the server supports, as well as in
|
|
326
|
+
// uncompressed form.
|
|
327
|
+
//
|
|
328
|
+
// Additionally, ByteStream requests MAY come with an additional plain text header
|
|
329
|
+
// that indicates the `resource_name` of the blob being sent. The header, if
|
|
330
|
+
// present, MUST follow the following convention:
|
|
331
|
+
// * name: `build.bazel.remote.execution.v2.resource-name`.
|
|
332
|
+
// * contents: the plain text resource_name of the request message.
|
|
333
|
+
// If set, the contents of the header MUST match the `resource_name` of the request
|
|
334
|
+
// message. Servers MAY use this header to assist in routing requests to the
|
|
335
|
+
// appropriate backend.
|
|
336
|
+
//
|
|
337
|
+
// The lifetime of entries in the CAS is implementation specific, but it SHOULD
|
|
338
|
+
// be long enough to allow for newly-added and recently looked-up entries to be
|
|
339
|
+
// used in subsequent calls (e.g. to
|
|
340
|
+
// [Execute][build.bazel.remote.execution.v2.Execution.Execute]).
|
|
341
|
+
//
|
|
342
|
+
// Servers MUST behave as though empty blobs are always available, even if they
|
|
343
|
+
// have not been uploaded. Clients MAY optimize away the uploading or
|
|
344
|
+
// downloading of empty blobs.
|
|
345
|
+
//
|
|
346
|
+
// As with other services in the Remote Execution API, any call may return an
|
|
347
|
+
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
|
|
348
|
+
// information about when the client should retry the request; clients SHOULD
|
|
349
|
+
// respect the information provided.
|
|
350
|
+
service ContentAddressableStorage {
|
|
351
|
+
// Determine if blobs are present in the CAS.
|
|
352
|
+
//
|
|
353
|
+
// Clients can use this API before uploading blobs to determine which ones are
|
|
354
|
+
// already present in the CAS and do not need to be uploaded again.
|
|
355
|
+
//
|
|
356
|
+
// Servers SHOULD increase the lifetimes of the referenced blobs if necessary and
|
|
357
|
+
// applicable.
|
|
358
|
+
//
|
|
359
|
+
// There are no method-specific errors.
|
|
360
|
+
rpc FindMissingBlobs(FindMissingBlobsRequest) returns (FindMissingBlobsResponse) {
|
|
361
|
+
option (google.api.http) = { post: "/v2/{instance_name=**}/blobs:findMissing" body: "*" };
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Upload many blobs at once.
|
|
365
|
+
//
|
|
366
|
+
// The server may enforce a limit of the combined total size of blobs
|
|
367
|
+
// to be uploaded using this API. This limit may be obtained using the
|
|
368
|
+
// [Capabilities][build.bazel.remote.execution.v2.Capabilities] API.
|
|
369
|
+
// Requests exceeding the limit should either be split into smaller
|
|
370
|
+
// chunks or uploaded using the
|
|
371
|
+
// [ByteStream API][google.bytestream.ByteStream], as appropriate.
|
|
372
|
+
//
|
|
373
|
+
// This request is equivalent to calling a Bytestream `Write` request
|
|
374
|
+
// on each individual blob, in parallel. The requests may succeed or fail
|
|
375
|
+
// independently.
|
|
376
|
+
//
|
|
377
|
+
// Errors:
|
|
378
|
+
//
|
|
379
|
+
// * `INVALID_ARGUMENT`: The client attempted to upload more than the
|
|
380
|
+
// server supported limit.
|
|
381
|
+
//
|
|
382
|
+
// Individual requests may return the following errors, additionally:
|
|
383
|
+
//
|
|
384
|
+
// * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob.
|
|
385
|
+
// * `INVALID_ARGUMENT`: The
|
|
386
|
+
// [Digest][build.bazel.remote.execution.v2.Digest] does not match the
|
|
387
|
+
// provided data.
|
|
388
|
+
rpc BatchUpdateBlobs(BatchUpdateBlobsRequest) returns (BatchUpdateBlobsResponse) {
|
|
389
|
+
option (google.api.http) = { post: "/v2/{instance_name=**}/blobs:batchUpdate" body: "*" };
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// Download many blobs at once.
|
|
393
|
+
//
|
|
394
|
+
// The server may enforce a limit of the combined total size of blobs
|
|
395
|
+
// to be downloaded using this API. This limit may be obtained using the
|
|
396
|
+
// [Capabilities][build.bazel.remote.execution.v2.Capabilities] API.
|
|
397
|
+
// Requests exceeding the limit should either be split into smaller
|
|
398
|
+
// chunks or downloaded using the
|
|
399
|
+
// [ByteStream API][google.bytestream.ByteStream], as appropriate.
|
|
400
|
+
//
|
|
401
|
+
// This request is equivalent to calling a Bytestream `Read` request
|
|
402
|
+
// on each individual blob, in parallel. The requests may succeed or fail
|
|
403
|
+
// independently.
|
|
404
|
+
//
|
|
405
|
+
// Errors:
|
|
406
|
+
//
|
|
407
|
+
// * `INVALID_ARGUMENT`: The client attempted to read more than the
|
|
408
|
+
// server supported limit.
|
|
409
|
+
//
|
|
410
|
+
// Every error on individual read will be returned in the corresponding digest
|
|
411
|
+
// status.
|
|
412
|
+
rpc BatchReadBlobs(BatchReadBlobsRequest) returns (BatchReadBlobsResponse) {
|
|
413
|
+
option (google.api.http) = { post: "/v2/{instance_name=**}/blobs:batchRead" body: "*" };
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// Fetch the entire directory tree rooted at a node.
|
|
417
|
+
//
|
|
418
|
+
// This request must be targeted at a
|
|
419
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] stored in the
|
|
420
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
|
|
421
|
+
// (CAS). The server will enumerate the `Directory` tree recursively and
|
|
422
|
+
// return every node descended from the root.
|
|
423
|
+
//
|
|
424
|
+
// The GetTreeRequest.page_token parameter can be used to skip ahead in
|
|
425
|
+
// the stream (e.g. when retrying a partially completed and aborted request),
|
|
426
|
+
// by setting it to a value taken from GetTreeResponse.next_page_token of the
|
|
427
|
+
// last successfully processed GetTreeResponse).
|
|
428
|
+
//
|
|
429
|
+
// The exact traversal order is unspecified and, unless retrieving subsequent
|
|
430
|
+
// pages from an earlier request, is not guaranteed to be stable across
|
|
431
|
+
// multiple invocations of `GetTree`.
|
|
432
|
+
//
|
|
433
|
+
// If part of the tree is missing from the CAS, the server will return the
|
|
434
|
+
// portion present and omit the rest.
|
|
435
|
+
//
|
|
436
|
+
// Errors:
|
|
437
|
+
//
|
|
438
|
+
// * `NOT_FOUND`: The requested tree root is not present in the CAS.
|
|
439
|
+
rpc GetTree(GetTreeRequest) returns (stream GetTreeResponse) {
|
|
440
|
+
option (google.api.http) = { get: "/v2/{instance_name=**}/blobs/{root_digest.hash}/{root_digest.size_bytes}:getTree" };
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// SplitBlob retrieves information about how a blob is split into chunks.
|
|
444
|
+
//
|
|
445
|
+
// This call returns information about how a blob is split into chunks, and
|
|
446
|
+
// returns a list of the chunk digests. Using the returned list of chunk digests,
|
|
447
|
+
// a client can check which chunks are locally available and only fetch the
|
|
448
|
+
// missing ones. The desired blob can be assembled by concatenating the fetched
|
|
449
|
+
// chunks in the order of the digests in the list. The chunks SHOULD all be
|
|
450
|
+
// available in the CAS.
|
|
451
|
+
//
|
|
452
|
+
// This API can be used to reduce the required data to download a large blob
|
|
453
|
+
// from CAS if some chunks from similar blobs are locally available. For this
|
|
454
|
+
// procedure to work properly, blobs SHOULD be split in a content-defined way,
|
|
455
|
+
// rather than with fixed-sized chunking.
|
|
456
|
+
//
|
|
457
|
+
// If a split request is answered successfully, a client can expect the
|
|
458
|
+
// following guarantees from the server:
|
|
459
|
+
// 1. The blob chunks are stored in CAS.
|
|
460
|
+
// 2. Concatenating the blob chunks in the order of the digest list returned
|
|
461
|
+
// by the server results in the original blob.
|
|
462
|
+
//
|
|
463
|
+
// Servers which implement this functionality MUST declare that they support
|
|
464
|
+
// it by setting the
|
|
465
|
+
// [CacheCapabilities.split_blob_support][build.bazel.remote.execution.v2.CacheCapabilities.split_blob_support]
|
|
466
|
+
// field accordingly.
|
|
467
|
+
//
|
|
468
|
+
// Clients MUST check that the server supports this capability, before using
|
|
469
|
+
// it.
|
|
470
|
+
//
|
|
471
|
+
// Clients SHOULD verify that the digest of the blob assembled by the fetched
|
|
472
|
+
// chunks is equal to the requested blob digest.
|
|
473
|
+
//
|
|
474
|
+
// The lifetimes of the generated chunk blobs MAY be independent of the
|
|
475
|
+
// lifetime of the original blob. In particular:
|
|
476
|
+
// * A blob and any chunk derived from it MAY be evicted from the CAS at
|
|
477
|
+
// different times.
|
|
478
|
+
// * A call to [SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob]
|
|
479
|
+
// extends the lifetime of the original blob, and sets the lifetimes of
|
|
480
|
+
// the resulting chunks (or extends the lifetimes of already-existing
|
|
481
|
+
// chunks).
|
|
482
|
+
// * Touching a chunk extends its lifetime, but the server MAY choose not
|
|
483
|
+
// to extend the lifetime of the original blob.
|
|
484
|
+
// * Touching the original blob extends its lifetime, but the server MAY
|
|
485
|
+
// choose not to extend the lifetimes of chunks derived from it.
|
|
486
|
+
//
|
|
487
|
+
// When blob splitting and splicing is used at the same time, the clients and
|
|
488
|
+
// the server SHOULD agree out-of-band upon a chunking algorithm used by both
|
|
489
|
+
// parties to benefit from each other's chunk data and avoid unnecessary data
|
|
490
|
+
// duplication.
|
|
491
|
+
//
|
|
492
|
+
// Errors:
|
|
493
|
+
//
|
|
494
|
+
// * `NOT_FOUND`: The requested blob is not present in the CAS, OR there is no
|
|
495
|
+
// split information available for the blob, OR at least one chunk needed to
|
|
496
|
+
// reconstruct the blob is missing from the CAS.
|
|
497
|
+
// * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob
|
|
498
|
+
// chunks.
|
|
499
|
+
rpc SplitBlob(SplitBlobRequest) returns (SplitBlobResponse) {
|
|
500
|
+
option (google.api.http) = { get: "/v2/{instance_name=**}/blobs/{blob_digest.hash}/{blob_digest.size_bytes}:splitBlob" };
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// SpliceBlob tells the CAS how chunks can compose a blob.
|
|
504
|
+
//
|
|
505
|
+
// This is the complementary operation to the
|
|
506
|
+
// [ContentAddressableStorage.SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob]
|
|
507
|
+
// function to handle the chunked upload of large blobs to save upload
|
|
508
|
+
// traffic.
|
|
509
|
+
//
|
|
510
|
+
// When uploading a large blob using chunked upload, clients MUST first upload
|
|
511
|
+
// all chunks to the CAS, then call this RPC to tell the server how those chunks
|
|
512
|
+
// compose the original blob. The chunks referenced in the SpliceBlob call SHOULD be
|
|
513
|
+
// available in the CAS before calling this RPC.
|
|
514
|
+
//
|
|
515
|
+
// If a client needs to upload a large blob and is able to split a blob into
|
|
516
|
+
// chunks in such a way that reusable chunks are obtained, e.g., by means of
|
|
517
|
+
// content-defined chunking, it can first determine which parts of the blob
|
|
518
|
+
// are already available in the remote CAS and upload the missing chunks, and
|
|
519
|
+
// then use this API to store information on how the chunks compose the
|
|
520
|
+
// original blob.
|
|
521
|
+
//
|
|
522
|
+
// Servers which implement this functionality MUST declare that they support
|
|
523
|
+
// it by setting the
|
|
524
|
+
// [CacheCapabilities.splice_blob_support][build.bazel.remote.execution.v2.CacheCapabilities.splice_blob_support]
|
|
525
|
+
// field accordingly.
|
|
526
|
+
//
|
|
527
|
+
// Clients MUST check that the server supports this capability, before using
|
|
528
|
+
// it.
|
|
529
|
+
//
|
|
530
|
+
// In order to ensure data consistency of the CAS, the server MUST only add
|
|
531
|
+
// blobs to the CAS after verifying their digests. In particular, servers MUST NOT
|
|
532
|
+
// trust digests provided by the client. The server MAY accept a request as no-op
|
|
533
|
+
// if the client-specified blob is already in CAS or if information on how to
|
|
534
|
+
// construct the blob from chunks is available. If the client-specified blob is
|
|
535
|
+
// not already in the CAS, the server MUST verify that the digest of the newly
|
|
536
|
+
// created blob assembled from chunks matches the digest specified by the
|
|
537
|
+
// client, and reject the request if they differ. Servers MAY choose to allow
|
|
538
|
+
// overwriting existing chunk mappings or to store multiple chunk mappings for
|
|
539
|
+
// the same blob.
|
|
540
|
+
//
|
|
541
|
+
// When blob splitting and splicing is used at the same time, the clients and
|
|
542
|
+
// the server SHOULD agree out-of-band upon a chunking algorithm used by both
|
|
543
|
+
// parties to benefit from each other's chunk data and avoid unnecessary data
|
|
544
|
+
// duplication.
|
|
545
|
+
//
|
|
546
|
+
// Errors:
|
|
547
|
+
//
|
|
548
|
+
// * `NOT_FOUND`: At least one of the blob chunks is not present in the CAS.
|
|
549
|
+
// * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the
|
|
550
|
+
// spliced blob.
|
|
551
|
+
// * `INVALID_ARGUMENT`: The digest of the spliced blob is different from the
|
|
552
|
+
// provided expected digest.
|
|
553
|
+
// * `ALREADY_EXISTS`: The blob already exists in CAS and the server did not
|
|
554
|
+
// extend the lifetime of the chunks specified in the request, e.g. because
|
|
555
|
+
// it prefers a different chunking and extended those instead. Clients can
|
|
556
|
+
// call [SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob]
|
|
557
|
+
// to check what chunk mapping the server is using.
|
|
558
|
+
rpc SpliceBlob(SpliceBlobRequest) returns (SpliceBlobResponse) {
|
|
559
|
+
option (google.api.http) = { post: "/v2/{instance_name=**}/blobs:spliceBlob" body: "*" };
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// The Capabilities service may be used by remote execution clients to query
|
|
564
|
+
// various server properties, in order to self-configure or return meaningful
|
|
565
|
+
// error messages.
|
|
566
|
+
//
|
|
567
|
+
// The query may include a particular `instance_name`, in which case the values
|
|
568
|
+
// returned will pertain to that instance.
|
|
569
|
+
service Capabilities {
|
|
570
|
+
// GetCapabilities returns the server capabilities configuration of the
|
|
571
|
+
// remote endpoint.
|
|
572
|
+
// Only the capabilities of the services supported by the endpoint will
|
|
573
|
+
// be returned:
|
|
574
|
+
// * Execution + CAS + Action Cache endpoints should return both
|
|
575
|
+
// CacheCapabilities and ExecutionCapabilities.
|
|
576
|
+
// * Execution only endpoints should return ExecutionCapabilities.
|
|
577
|
+
// * CAS + Action Cache only endpoints should return CacheCapabilities.
|
|
578
|
+
//
|
|
579
|
+
// There are no method-specific errors.
|
|
580
|
+
rpc GetCapabilities(GetCapabilitiesRequest) returns (ServerCapabilities) {
|
|
581
|
+
option (google.api.http) = {
|
|
582
|
+
get: "/v2/{instance_name=**}/capabilities"
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// An `Action` captures all the information about an execution which is required
|
|
588
|
+
// to reproduce it.
|
|
589
|
+
//
|
|
590
|
+
// `Action`s are the core component of the [Execution] service. A single
|
|
591
|
+
// `Action` represents a repeatable action that can be performed by the
|
|
592
|
+
// execution service. `Action`s can be succinctly identified by the digest of
|
|
593
|
+
// their wire format encoding and, once an `Action` has been executed, will be
|
|
594
|
+
// cached in the action cache. Future requests can then use the cached result
|
|
595
|
+
// rather than needing to run afresh.
|
|
596
|
+
//
|
|
597
|
+
// When a server completes execution of an
|
|
598
|
+
// [Action][build.bazel.remote.execution.v2.Action], it MAY choose to
|
|
599
|
+
// cache the [result][build.bazel.remote.execution.v2.ActionResult] in
|
|
600
|
+
// the [ActionCache][build.bazel.remote.execution.v2.ActionCache] unless
|
|
601
|
+
// `do_not_cache` is `true`. Clients SHOULD expect the server to do so. By
|
|
602
|
+
// default, future calls to
|
|
603
|
+
// [Execute][build.bazel.remote.execution.v2.Execution.Execute] the same
|
|
604
|
+
// `Action` will also serve their results from the cache. Clients must take care
|
|
605
|
+
// to understand the caching behaviour. Ideally, all `Action`s will be
|
|
606
|
+
// reproducible so that serving a result from cache is always desirable and
|
|
607
|
+
// correct.
|
|
608
|
+
message Action {
|
|
609
|
+
// The digest of the [Command][build.bazel.remote.execution.v2.Command]
|
|
610
|
+
// to run, which MUST be present in the
|
|
611
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
|
|
612
|
+
Digest command_digest = 1;
|
|
613
|
+
|
|
614
|
+
// The digest of the root
|
|
615
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] for the input
|
|
616
|
+
// files. The files in the directory tree are available in the correct
|
|
617
|
+
// location on the build machine before the command is executed. The root
|
|
618
|
+
// directory, as well as every subdirectory and content blob referred to, MUST
|
|
619
|
+
// be in the
|
|
620
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
|
|
621
|
+
Digest input_root_digest = 2;
|
|
622
|
+
|
|
623
|
+
reserved 3 to 5; // Used for fields moved to [Command][build.bazel.remote.execution.v2.Command].
|
|
624
|
+
|
|
625
|
+
// A timeout after which the execution should be killed. If the timeout is
|
|
626
|
+
// absent, then the client is specifying that the execution should continue
|
|
627
|
+
// as long as the server will let it. The server SHOULD impose a timeout if
|
|
628
|
+
// the client does not specify one, however, if the client does specify a
|
|
629
|
+
// timeout that is longer than the server's maximum timeout, the server MUST
|
|
630
|
+
// reject the request.
|
|
631
|
+
//
|
|
632
|
+
// The timeout is only intended to cover the "execution" of the specified
|
|
633
|
+
// action and not time in queue nor any overheads before or after execution
|
|
634
|
+
// such as marshalling inputs/outputs. The server SHOULD avoid including time
|
|
635
|
+
// spent the client doesn't have control over, and MAY extend or reduce the
|
|
636
|
+
// timeout to account for delays or speedups that occur during execution
|
|
637
|
+
// itself (e.g., lazily loading data from the Content Addressable Storage,
|
|
638
|
+
// live migration of virtual machines, emulation overhead).
|
|
639
|
+
//
|
|
640
|
+
// The timeout is a part of the
|
|
641
|
+
// [Action][build.bazel.remote.execution.v2.Action] message, and
|
|
642
|
+
// therefore two `Actions` with different timeouts are different, even if they
|
|
643
|
+
// are otherwise identical. This is because, if they were not, running an
|
|
644
|
+
// `Action` with a lower timeout than is required might result in a cache hit
|
|
645
|
+
// from an execution run with a longer timeout, hiding the fact that the
|
|
646
|
+
// timeout is too short. By encoding it directly in the `Action`, a lower
|
|
647
|
+
// timeout will result in a cache miss and the execution timeout will fail
|
|
648
|
+
// immediately, rather than whenever the cache entry gets evicted.
|
|
649
|
+
google.protobuf.Duration timeout = 6;
|
|
650
|
+
|
|
651
|
+
// If true, then the `Action`'s result cannot be cached, and in-flight
|
|
652
|
+
// requests for the same `Action` may not be merged.
|
|
653
|
+
bool do_not_cache = 7;
|
|
654
|
+
|
|
655
|
+
reserved 8; // Used for field moved to [Command][build.bazel.remote.execution.v2.Command].
|
|
656
|
+
|
|
657
|
+
// An optional additional salt value used to place this `Action` into a
|
|
658
|
+
// separate cache namespace from other instances having the same field
|
|
659
|
+
// contents. This salt typically comes from operational configuration
|
|
660
|
+
// specific to sources such as repo and service configuration,
|
|
661
|
+
// and allows disowning an entire set of ActionResults that might have been
|
|
662
|
+
// poisoned by buggy software or tool failures.
|
|
663
|
+
bytes salt = 9;
|
|
664
|
+
|
|
665
|
+
// The optional platform requirements for the execution environment. The
|
|
666
|
+
// server MAY choose to execute the action on any worker satisfying the
|
|
667
|
+
// requirements, so the client SHOULD ensure that running the action on any
|
|
668
|
+
// such worker will have the same result. A detailed lexicon for this can be
|
|
669
|
+
// found in the accompanying platform.md.
|
|
670
|
+
// New in version 2.2: clients SHOULD set these platform properties as well
|
|
671
|
+
// as those in the [Command][build.bazel.remote.execution.v2.Command]. Servers
|
|
672
|
+
// SHOULD prefer those set here.
|
|
673
|
+
Platform platform = 10;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// A `Command` is the actual command executed by a worker running an
|
|
677
|
+
// [Action][build.bazel.remote.execution.v2.Action] and specifications of its
|
|
678
|
+
// environment.
|
|
679
|
+
//
|
|
680
|
+
// Except as otherwise required, the environment (such as which system
|
|
681
|
+
// libraries or binaries are available, and what filesystems are mounted where)
|
|
682
|
+
// is defined by and specific to the implementation of the remote execution API.
|
|
683
|
+
message Command {
|
|
684
|
+
// An `EnvironmentVariable` is one variable to set in the running program's
|
|
685
|
+
// environment.
|
|
686
|
+
message EnvironmentVariable {
|
|
687
|
+
// The variable name.
|
|
688
|
+
string name = 1;
|
|
689
|
+
|
|
690
|
+
// The variable value.
|
|
691
|
+
string value = 2;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
// The arguments to the command.
|
|
695
|
+
//
|
|
696
|
+
// The first argument specifies the command to run, which may be either an
|
|
697
|
+
// absolute path, a path relative to the working directory, or an unqualified
|
|
698
|
+
// path (without path separators) which will be resolved using the operating
|
|
699
|
+
// system's equivalent of the PATH environment variable. Path separators
|
|
700
|
+
// native to the operating system running on the worker SHOULD be used. If the
|
|
701
|
+
// `environment_variables` list contains an entry for the PATH environment
|
|
702
|
+
// variable, it SHOULD be respected. If not, the resolution process is
|
|
703
|
+
// implementation-defined.
|
|
704
|
+
//
|
|
705
|
+
// Changed in v2.3. v2.2 and older require that no PATH lookups are performed,
|
|
706
|
+
// and that relative paths are resolved relative to the input root. This
|
|
707
|
+
// behavior can, however, not be relied upon, as most implementations already
|
|
708
|
+
// followed the rules described above.
|
|
709
|
+
repeated string arguments = 1;
|
|
710
|
+
|
|
711
|
+
// The environment variables to set when running the program. The worker may
|
|
712
|
+
// provide its own default environment variables; these defaults can be
|
|
713
|
+
// overridden using this field. Additional variables can also be specified.
|
|
714
|
+
//
|
|
715
|
+
// In order to ensure that equivalent
|
|
716
|
+
// [Command][build.bazel.remote.execution.v2.Command]s always hash to the same
|
|
717
|
+
// value, the environment variables MUST be lexicographically sorted by name.
|
|
718
|
+
// Sorting of strings is done by code point, equivalently, by the UTF-8 bytes.
|
|
719
|
+
repeated EnvironmentVariable environment_variables = 2;
|
|
720
|
+
|
|
721
|
+
// A list of the output files that the client expects to retrieve from the
|
|
722
|
+
// action. Only the listed files, as well as directories listed in
|
|
723
|
+
// `output_directories`, will be returned to the client as output.
|
|
724
|
+
// Other files or directories that may be created during command execution
|
|
725
|
+
// are discarded.
|
|
726
|
+
//
|
|
727
|
+
// The paths are relative to the working directory of the action execution.
|
|
728
|
+
// The paths are specified using a single forward slash (`/`) as a path
|
|
729
|
+
// separator, even if the execution platform natively uses a different
|
|
730
|
+
// separator. The path MUST NOT include a trailing slash, nor a leading slash,
|
|
731
|
+
// being a relative path.
|
|
732
|
+
//
|
|
733
|
+
// In order to ensure consistent hashing of the same Action, the output paths
|
|
734
|
+
// MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
|
|
735
|
+
// bytes).
|
|
736
|
+
//
|
|
737
|
+
// An output file cannot be duplicated, be a parent of another output file, or
|
|
738
|
+
// have the same path as any of the listed output directories.
|
|
739
|
+
//
|
|
740
|
+
// Directories leading up to the output files are created by the worker prior
|
|
741
|
+
// to execution, even if they are not explicitly part of the input root.
|
|
742
|
+
//
|
|
743
|
+
// DEPRECATED since v2.1: Use `output_paths` instead.
|
|
744
|
+
repeated string output_files = 3 [ deprecated = true ];
|
|
745
|
+
|
|
746
|
+
// A list of the output directories that the client expects to retrieve from
|
|
747
|
+
// the action. Only the listed directories will be returned (an entire
|
|
748
|
+
// directory structure will be returned as a
|
|
749
|
+
// [Tree][build.bazel.remote.execution.v2.Tree] message digest, see
|
|
750
|
+
// [OutputDirectory][build.bazel.remote.execution.v2.OutputDirectory]), as
|
|
751
|
+
// well as files listed in `output_files`. Other files or directories that
|
|
752
|
+
// may be created during command execution are discarded.
|
|
753
|
+
//
|
|
754
|
+
// The paths are relative to the working directory of the action execution.
|
|
755
|
+
// The paths are specified using a single forward slash (`/`) as a path
|
|
756
|
+
// separator, even if the execution platform natively uses a different
|
|
757
|
+
// separator. The path MUST NOT include a trailing slash, nor a leading slash,
|
|
758
|
+
// being a relative path. The special value of empty string is allowed,
|
|
759
|
+
// although not recommended, and can be used to capture the entire working
|
|
760
|
+
// directory tree, including inputs.
|
|
761
|
+
//
|
|
762
|
+
// In order to ensure consistent hashing of the same Action, the output paths
|
|
763
|
+
// MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
|
|
764
|
+
// bytes).
|
|
765
|
+
//
|
|
766
|
+
// An output directory cannot be duplicated or have the same path as any of
|
|
767
|
+
// the listed output files. An output directory is allowed to be a parent of
|
|
768
|
+
// another output directory.
|
|
769
|
+
//
|
|
770
|
+
// Directories leading up to the output directories (but not the output
|
|
771
|
+
// directories themselves) are created by the worker prior to execution, even
|
|
772
|
+
// if they are not explicitly part of the input root.
|
|
773
|
+
//
|
|
774
|
+
// DEPRECATED since 2.1: Use `output_paths` instead.
|
|
775
|
+
repeated string output_directories = 4 [ deprecated = true ];
|
|
776
|
+
|
|
777
|
+
// A list of the output paths that the client expects to retrieve from the
|
|
778
|
+
// action. Only the listed paths will be returned to the client as output.
|
|
779
|
+
// The type of the output (file or directory) is not specified, and will be
|
|
780
|
+
// determined by the server after action execution. If the resulting path is
|
|
781
|
+
// a file, it will be returned in an
|
|
782
|
+
// [OutputFile][build.bazel.remote.execution.v2.OutputFile] typed field.
|
|
783
|
+
// If the path is a directory, the entire directory structure will be returned
|
|
784
|
+
// as a [Tree][build.bazel.remote.execution.v2.Tree] message digest, see
|
|
785
|
+
// [OutputDirectory][build.bazel.remote.execution.v2.OutputDirectory]
|
|
786
|
+
// Other files or directories that may be created during command execution
|
|
787
|
+
// are discarded.
|
|
788
|
+
//
|
|
789
|
+
// The paths are relative to the working directory of the action execution.
|
|
790
|
+
// The paths are specified using a single forward slash (`/`) as a path
|
|
791
|
+
// separator, even if the execution platform natively uses a different
|
|
792
|
+
// separator. The path MUST NOT include a trailing slash, nor a leading slash,
|
|
793
|
+
// being a relative path.
|
|
794
|
+
//
|
|
795
|
+
// In order to ensure consistent hashing of the same Action, the output paths
|
|
796
|
+
// MUST be deduplicated and sorted lexicographically by code point (or,
|
|
797
|
+
// equivalently, by UTF-8 bytes).
|
|
798
|
+
//
|
|
799
|
+
// Directories leading up to the output paths are created by the worker prior
|
|
800
|
+
// to execution, even if they are not explicitly part of the input root.
|
|
801
|
+
//
|
|
802
|
+
// New in v2.1: this field supersedes the DEPRECATED `output_files` and
|
|
803
|
+
// `output_directories` fields. If `output_paths` is used, `output_files` and
|
|
804
|
+
// `output_directories` will be ignored!
|
|
805
|
+
repeated string output_paths = 7;
|
|
806
|
+
|
|
807
|
+
// The platform requirements for the execution environment. The server MAY
|
|
808
|
+
// choose to execute the action on any worker satisfying the requirements, so
|
|
809
|
+
// the client SHOULD ensure that running the action on any such worker will
|
|
810
|
+
// have the same result. A detailed lexicon for this can be found in the
|
|
811
|
+
// accompanying platform.md.
|
|
812
|
+
// DEPRECATED as of v2.2: platform properties are now specified directly in
|
|
813
|
+
// the action. See documentation note in the
|
|
814
|
+
// [Action][build.bazel.remote.execution.v2.Action] for migration.
|
|
815
|
+
Platform platform = 5 [ deprecated = true ];
|
|
816
|
+
|
|
817
|
+
// The working directory, relative to the input root, for the command to run
|
|
818
|
+
// in. It must be a directory which exists in the input tree. If it is left
|
|
819
|
+
// empty, then the action is run in the input root.
|
|
820
|
+
string working_directory = 6;
|
|
821
|
+
|
|
822
|
+
// A list of keys for node properties the client expects to retrieve for
|
|
823
|
+
// output files and directories. Keys are either names of string-based
|
|
824
|
+
// [NodeProperty][build.bazel.remote.execution.v2.NodeProperty] or
|
|
825
|
+
// names of fields in [NodeProperties][build.bazel.remote.execution.v2.NodeProperties].
|
|
826
|
+
// In order to ensure that equivalent `Action`s always hash to the same
|
|
827
|
+
// value, the node properties MUST be lexicographically sorted by name.
|
|
828
|
+
// Sorting of strings is done by code point, equivalently, by the UTF-8 bytes.
|
|
829
|
+
//
|
|
830
|
+
// The interpretation of string-based properties is server-dependent. If a
|
|
831
|
+
// property is not recognized by the server, the server will return an
|
|
832
|
+
// `INVALID_ARGUMENT`.
|
|
833
|
+
repeated string output_node_properties = 8;
|
|
834
|
+
|
|
835
|
+
enum OutputDirectoryFormat {
|
|
836
|
+
// The client is only interested in receiving output directories in
|
|
837
|
+
// the form of a single Tree object, using the `tree_digest` field.
|
|
838
|
+
TREE_ONLY = 0;
|
|
839
|
+
|
|
840
|
+
// The client is only interested in receiving output directories in
|
|
841
|
+
// the form of a hierarchy of separately stored Directory objects,
|
|
842
|
+
// using the `root_directory_digest` field.
|
|
843
|
+
DIRECTORY_ONLY = 1;
|
|
844
|
+
|
|
845
|
+
// The client is interested in receiving output directories both in
|
|
846
|
+
// the form of a single Tree object and a hierarchy of separately
|
|
847
|
+
// stored Directory objects, using both the `tree_digest` and
|
|
848
|
+
// `root_directory_digest` fields.
|
|
849
|
+
TREE_AND_DIRECTORY = 2;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
// The format that the worker should use to store the contents of
|
|
853
|
+
// output directories.
|
|
854
|
+
//
|
|
855
|
+
// In case this field is set to a value that is not supported by the
|
|
856
|
+
// worker, the worker SHOULD interpret this field as TREE_ONLY. The
|
|
857
|
+
// worker MAY store output directories in formats that are a superset
|
|
858
|
+
// of what was requested (e.g., interpreting DIRECTORY_ONLY as
|
|
859
|
+
// TREE_AND_DIRECTORY).
|
|
860
|
+
OutputDirectoryFormat output_directory_format = 9;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// A `Platform` is a set of requirements, such as hardware, operating system, or
|
|
864
|
+
// compiler toolchain, for an
|
|
865
|
+
// [Action][build.bazel.remote.execution.v2.Action]'s execution
|
|
866
|
+
// environment. A `Platform` is represented as a series of key-value pairs
|
|
867
|
+
// representing the properties that are required of the platform.
|
|
868
|
+
message Platform {
|
|
869
|
+
// A single property for the environment. The server is responsible for
|
|
870
|
+
// specifying the property `name`s that it accepts. If an unknown `name` is
|
|
871
|
+
// provided in the requirements for an
|
|
872
|
+
// [Action][build.bazel.remote.execution.v2.Action], the server SHOULD
|
|
873
|
+
// reject the execution request. If permitted by the server, the same `name`
|
|
874
|
+
// may occur multiple times.
|
|
875
|
+
//
|
|
876
|
+
// The server is also responsible for specifying the interpretation of
|
|
877
|
+
// property `value`s. For instance, a property describing how much RAM must be
|
|
878
|
+
// available may be interpreted as allowing a worker with 16GB to fulfill a
|
|
879
|
+
// request for 8GB, while a property describing the OS environment on which
|
|
880
|
+
// the action must be performed may require an exact match with the worker's
|
|
881
|
+
// OS.
|
|
882
|
+
//
|
|
883
|
+
// The server MAY use the `value` of one or more properties to determine how
|
|
884
|
+
// it sets up the execution environment, such as by making specific system
|
|
885
|
+
// files available to the worker.
|
|
886
|
+
//
|
|
887
|
+
// Both names and values are typically case-sensitive. Note that the platform
|
|
888
|
+
// is implicitly part of the action digest, so even tiny changes in the names
|
|
889
|
+
// or values (like changing case) may result in different action cache
|
|
890
|
+
// entries.
|
|
891
|
+
message Property {
|
|
892
|
+
// The property name.
|
|
893
|
+
string name = 1;
|
|
894
|
+
|
|
895
|
+
// The property value.
|
|
896
|
+
string value = 2;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// The properties that make up this platform. In order to ensure that
|
|
900
|
+
// equivalent `Platform`s always hash to the same value, the properties MUST
|
|
901
|
+
// be lexicographically sorted by name, and then by value. Sorting of strings
|
|
902
|
+
// is done by code point, equivalently, by the UTF-8 bytes.
|
|
903
|
+
repeated Property properties = 1;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// A `Directory` represents a directory node in a file tree, containing zero or
|
|
907
|
+
// more children [FileNodes][build.bazel.remote.execution.v2.FileNode],
|
|
908
|
+
// [DirectoryNodes][build.bazel.remote.execution.v2.DirectoryNode] and
|
|
909
|
+
// [SymlinkNodes][build.bazel.remote.execution.v2.SymlinkNode].
|
|
910
|
+
// Each `Node` contains its name in the directory, either the digest of its
|
|
911
|
+
// content (either a file blob or a `Directory` proto) or a symlink target, as
|
|
912
|
+
// well as possibly some metadata about the file or directory.
|
|
913
|
+
//
|
|
914
|
+
// In order to ensure that two equivalent directory trees hash to the same
|
|
915
|
+
// value, the following restrictions MUST be obeyed when constructing
|
|
916
|
+
// a `Directory`:
|
|
917
|
+
//
|
|
918
|
+
// * Every child in the directory must have a path of exactly one segment.
|
|
919
|
+
// Multiple levels of directory hierarchy may not be collapsed.
|
|
920
|
+
// * Each child in the directory must have a unique path segment (file name).
|
|
921
|
+
// Note that while the API itself is case-sensitive, the environment where
|
|
922
|
+
// the Action is executed may or may not be case-sensitive. That is, it is
|
|
923
|
+
// legal to call the API with a Directory that has both "Foo" and "foo" as
|
|
924
|
+
// children, but the Action may be rejected by the remote system upon
|
|
925
|
+
// execution.
|
|
926
|
+
// * The files, directories and symlinks in the directory must each be sorted
|
|
927
|
+
// in lexicographical order by path. The path strings must be sorted by code
|
|
928
|
+
// point, equivalently, by UTF-8 bytes.
|
|
929
|
+
// * The [NodeProperties][build.bazel.remote.execution.v2.NodeProperty] of files,
|
|
930
|
+
// directories, and symlinks must be sorted in lexicographical order by
|
|
931
|
+
// property name.
|
|
932
|
+
//
|
|
933
|
+
// A `Directory` that obeys the restrictions is said to be in canonical form.
|
|
934
|
+
//
|
|
935
|
+
// As an example, the following could be used for a file named `bar` and a
|
|
936
|
+
// directory named `foo` with an executable file named `baz` (hashes shortened
|
|
937
|
+
// for readability):
|
|
938
|
+
//
|
|
939
|
+
// ```json
|
|
940
|
+
// // (Directory proto)
|
|
941
|
+
// {
|
|
942
|
+
// files: [
|
|
943
|
+
// {
|
|
944
|
+
// name: "bar",
|
|
945
|
+
// digest: {
|
|
946
|
+
// hash: "4a73bc9d03...",
|
|
947
|
+
// size: 65534
|
|
948
|
+
// },
|
|
949
|
+
// node_properties: [
|
|
950
|
+
// {
|
|
951
|
+
// "name": "MTime",
|
|
952
|
+
// "value": "2017-01-15T01:30:15.01Z"
|
|
953
|
+
// }
|
|
954
|
+
// ]
|
|
955
|
+
// }
|
|
956
|
+
// ],
|
|
957
|
+
// directories: [
|
|
958
|
+
// {
|
|
959
|
+
// name: "foo",
|
|
960
|
+
// digest: {
|
|
961
|
+
// hash: "4cf2eda940...",
|
|
962
|
+
// size: 43
|
|
963
|
+
// }
|
|
964
|
+
// }
|
|
965
|
+
// ]
|
|
966
|
+
// }
|
|
967
|
+
//
|
|
968
|
+
// // (Directory proto with hash "4cf2eda940..." and size 43)
|
|
969
|
+
// {
|
|
970
|
+
// files: [
|
|
971
|
+
// {
|
|
972
|
+
// name: "baz",
|
|
973
|
+
// digest: {
|
|
974
|
+
// hash: "b2c941073e...",
|
|
975
|
+
// size: 1294,
|
|
976
|
+
// },
|
|
977
|
+
// is_executable: true
|
|
978
|
+
// }
|
|
979
|
+
// ]
|
|
980
|
+
// }
|
|
981
|
+
// ```
|
|
982
|
+
message Directory {
|
|
983
|
+
// The files in the directory.
|
|
984
|
+
repeated FileNode files = 1;
|
|
985
|
+
|
|
986
|
+
// The subdirectories in the directory.
|
|
987
|
+
repeated DirectoryNode directories = 2;
|
|
988
|
+
|
|
989
|
+
// The symlinks in the directory.
|
|
990
|
+
repeated SymlinkNode symlinks = 3;
|
|
991
|
+
|
|
992
|
+
// The node properties of the Directory.
|
|
993
|
+
reserved 4;
|
|
994
|
+
NodeProperties node_properties = 5;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
// A single property for [FileNodes][build.bazel.remote.execution.v2.FileNode],
|
|
998
|
+
// [DirectoryNodes][build.bazel.remote.execution.v2.DirectoryNode], and
|
|
999
|
+
// [SymlinkNodes][build.bazel.remote.execution.v2.SymlinkNode]. The server is
|
|
1000
|
+
// responsible for specifying the property `name`s that it accepts. If
|
|
1001
|
+
// permitted by the server, the same `name` may occur multiple times.
|
|
1002
|
+
message NodeProperty {
|
|
1003
|
+
// The property name.
|
|
1004
|
+
string name = 1;
|
|
1005
|
+
|
|
1006
|
+
// The property value.
|
|
1007
|
+
string value = 2;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
// Node properties for [FileNodes][build.bazel.remote.execution.v2.FileNode],
|
|
1011
|
+
// [DirectoryNodes][build.bazel.remote.execution.v2.DirectoryNode], and
|
|
1012
|
+
// [SymlinkNodes][build.bazel.remote.execution.v2.SymlinkNode]. The server is
|
|
1013
|
+
// responsible for specifying the properties that it accepts.
|
|
1014
|
+
//
|
|
1015
|
+
message NodeProperties {
|
|
1016
|
+
// A list of string-based
|
|
1017
|
+
// [NodeProperties][build.bazel.remote.execution.v2.NodeProperty].
|
|
1018
|
+
repeated NodeProperty properties = 1;
|
|
1019
|
+
|
|
1020
|
+
// The file's last modification timestamp.
|
|
1021
|
+
google.protobuf.Timestamp mtime = 2;
|
|
1022
|
+
|
|
1023
|
+
// The UNIX file mode, e.g., 0755.
|
|
1024
|
+
google.protobuf.UInt32Value unix_mode = 3;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// A `FileNode` represents a single file and associated metadata.
|
|
1028
|
+
message FileNode {
|
|
1029
|
+
// The name of the file.
|
|
1030
|
+
string name = 1;
|
|
1031
|
+
|
|
1032
|
+
// The digest of the file's content.
|
|
1033
|
+
Digest digest = 2;
|
|
1034
|
+
|
|
1035
|
+
reserved 3; // Reserved to ensure wire-compatibility with `OutputFile`.
|
|
1036
|
+
|
|
1037
|
+
// True if file is executable, false otherwise.
|
|
1038
|
+
bool is_executable = 4;
|
|
1039
|
+
|
|
1040
|
+
// The node properties of the FileNode.
|
|
1041
|
+
reserved 5;
|
|
1042
|
+
NodeProperties node_properties = 6;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
// A `DirectoryNode` represents a child of a
|
|
1046
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] which is itself
|
|
1047
|
+
// a `Directory` and its associated metadata.
|
|
1048
|
+
message DirectoryNode {
|
|
1049
|
+
// The name of the directory.
|
|
1050
|
+
string name = 1;
|
|
1051
|
+
|
|
1052
|
+
// The digest of the
|
|
1053
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] object
|
|
1054
|
+
// represented. See [Digest][build.bazel.remote.execution.v2.Digest]
|
|
1055
|
+
// for information about how to take the digest of a proto message.
|
|
1056
|
+
Digest digest = 2;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
// A `SymlinkNode` represents a symbolic link.
|
|
1060
|
+
message SymlinkNode {
|
|
1061
|
+
// The name of the symlink.
|
|
1062
|
+
string name = 1;
|
|
1063
|
+
|
|
1064
|
+
// The target path of the symlink. The path separator is a forward slash `/`.
|
|
1065
|
+
// The target path can be relative to the parent directory of the symlink or
|
|
1066
|
+
// it can be an absolute path starting with `/`. Support for absolute paths
|
|
1067
|
+
// can be checked using the [Capabilities][build.bazel.remote.execution.v2.Capabilities]
|
|
1068
|
+
// API. `..` components are allowed anywhere in the target path as logical
|
|
1069
|
+
// canonicalization may lead to different behavior in the presence of
|
|
1070
|
+
// directory symlinks (e.g. `foo/../bar` may not be the same as `bar`).
|
|
1071
|
+
// To reduce potential cache misses, canonicalization is still recommended
|
|
1072
|
+
// where this is possible without impacting correctness.
|
|
1073
|
+
string target = 2;
|
|
1074
|
+
|
|
1075
|
+
// The node properties of the SymlinkNode.
|
|
1076
|
+
reserved 3;
|
|
1077
|
+
NodeProperties node_properties = 4;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// A content digest. A digest for a given blob consists of the size of the blob
|
|
1081
|
+
// and its hash. The hash algorithm to use is defined by the server.
|
|
1082
|
+
//
|
|
1083
|
+
// The size is considered to be an integral part of the digest and cannot be
|
|
1084
|
+
// separated. That is, even if the `hash` field is correctly specified but
|
|
1085
|
+
// `size_bytes` is not, the server MUST reject the request.
|
|
1086
|
+
//
|
|
1087
|
+
// The reason for including the size in the digest is as follows: in a great
|
|
1088
|
+
// many cases, the server needs to know the size of the blob it is about to work
|
|
1089
|
+
// with prior to starting an operation with it, such as flattening Merkle tree
|
|
1090
|
+
// structures or streaming it to a worker. Technically, the server could
|
|
1091
|
+
// implement a separate metadata store, but this results in a significantly more
|
|
1092
|
+
// complicated implementation as opposed to having the client specify the size
|
|
1093
|
+
// up-front (or storing the size along with the digest in every message where
|
|
1094
|
+
// digests are embedded). This does mean that the API leaks some implementation
|
|
1095
|
+
// details of (what we consider to be) a reasonable server implementation, but
|
|
1096
|
+
// we consider this to be a worthwhile tradeoff.
|
|
1097
|
+
//
|
|
1098
|
+
// When a `Digest` is used to refer to a proto message, it always refers to the
|
|
1099
|
+
// message in binary encoded form. To ensure consistent hashing, clients and
|
|
1100
|
+
// servers MUST ensure that they serialize messages according to the following
|
|
1101
|
+
// rules, even if there are alternate valid encodings for the same message:
|
|
1102
|
+
//
|
|
1103
|
+
// * Fields are serialized in tag order.
|
|
1104
|
+
// * There are no unknown fields.
|
|
1105
|
+
// * There are no duplicate fields.
|
|
1106
|
+
// * Fields are serialized according to the default semantics for their type.
|
|
1107
|
+
//
|
|
1108
|
+
// Most protocol buffer implementations will always follow these rules when
|
|
1109
|
+
// serializing, but care should be taken to avoid shortcuts. For instance,
|
|
1110
|
+
// concatenating two messages to merge them may produce duplicate fields.
|
|
1111
|
+
message Digest {
|
|
1112
|
+
// The hash, represented as a lowercase hexadecimal string, padded with
|
|
1113
|
+
// leading zeroes up to the hash function length.
|
|
1114
|
+
string hash = 1;
|
|
1115
|
+
|
|
1116
|
+
// The size of the blob, in bytes.
|
|
1117
|
+
int64 size_bytes = 2;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
// ExecutedActionMetadata contains details about a completed execution.
|
|
1121
|
+
message ExecutedActionMetadata {
|
|
1122
|
+
// The name of the worker which ran the execution.
|
|
1123
|
+
string worker = 1;
|
|
1124
|
+
|
|
1125
|
+
// When was the action added to the queue.
|
|
1126
|
+
google.protobuf.Timestamp queued_timestamp = 2;
|
|
1127
|
+
|
|
1128
|
+
// When the worker received the action.
|
|
1129
|
+
google.protobuf.Timestamp worker_start_timestamp = 3;
|
|
1130
|
+
|
|
1131
|
+
// When the worker completed the action, including all stages.
|
|
1132
|
+
google.protobuf.Timestamp worker_completed_timestamp = 4;
|
|
1133
|
+
|
|
1134
|
+
// When the worker started fetching action inputs.
|
|
1135
|
+
google.protobuf.Timestamp input_fetch_start_timestamp = 5;
|
|
1136
|
+
|
|
1137
|
+
// When the worker finished fetching action inputs.
|
|
1138
|
+
google.protobuf.Timestamp input_fetch_completed_timestamp = 6;
|
|
1139
|
+
|
|
1140
|
+
// When the worker started executing the action command.
|
|
1141
|
+
google.protobuf.Timestamp execution_start_timestamp = 7;
|
|
1142
|
+
|
|
1143
|
+
// When the worker completed executing the action command.
|
|
1144
|
+
google.protobuf.Timestamp execution_completed_timestamp = 8;
|
|
1145
|
+
|
|
1146
|
+
// New in v2.3: the amount of time the worker spent executing the action
|
|
1147
|
+
// command, potentially computed using a worker-specific virtual clock.
|
|
1148
|
+
//
|
|
1149
|
+
// The virtual execution duration is only intended to cover the "execution" of
|
|
1150
|
+
// the specified action and not time in queue nor any overheads before or
|
|
1151
|
+
// after execution such as marshalling inputs/outputs. The server SHOULD avoid
|
|
1152
|
+
// including time spent the client doesn't have control over, and MAY extend
|
|
1153
|
+
// or reduce the execution duration to account for delays or speedups that
|
|
1154
|
+
// occur during execution itself (e.g., lazily loading data from the Content
|
|
1155
|
+
// Addressable Storage, live migration of virtual machines, emulation
|
|
1156
|
+
// overhead).
|
|
1157
|
+
//
|
|
1158
|
+
// The method of timekeeping used to compute the virtual execution duration
|
|
1159
|
+
// MUST be consistent with what is used to enforce the
|
|
1160
|
+
// [Action][build.bazel.remote.execution.v2.Action]'s `timeout`. There is no
|
|
1161
|
+
// relationship between the virtual execution duration and the values of
|
|
1162
|
+
// `execution_start_timestamp` and `execution_completed_timestamp`.
|
|
1163
|
+
google.protobuf.Duration virtual_execution_duration = 12;
|
|
1164
|
+
|
|
1165
|
+
// When the worker started uploading action outputs.
|
|
1166
|
+
google.protobuf.Timestamp output_upload_start_timestamp = 9;
|
|
1167
|
+
|
|
1168
|
+
// When the worker finished uploading action outputs.
|
|
1169
|
+
google.protobuf.Timestamp output_upload_completed_timestamp = 10;
|
|
1170
|
+
|
|
1171
|
+
// Details that are specific to the kind of worker used. For example,
|
|
1172
|
+
// on POSIX-like systems this could contain a message with
|
|
1173
|
+
// getrusage(2) statistics.
|
|
1174
|
+
repeated google.protobuf.Any auxiliary_metadata = 11;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
// An ActionResult represents the result of an
|
|
1178
|
+
// [Action][build.bazel.remote.execution.v2.Action] being run.
|
|
1179
|
+
//
|
|
1180
|
+
// It is advised that at least one field (for example
|
|
1181
|
+
// `ActionResult.execution_metadata.Worker`) have a non-default value, to
|
|
1182
|
+
// ensure that the serialized value is non-empty, which can then be used
|
|
1183
|
+
// as a basic data sanity check.
|
|
1184
|
+
message ActionResult {
|
|
1185
|
+
reserved 1; // Reserved for use as the resource name.
|
|
1186
|
+
|
|
1187
|
+
// The output files of the action. For each output file requested in the
|
|
1188
|
+
// `output_files` or `output_paths` field of the Action, if the corresponding
|
|
1189
|
+
// file existed after the action completed, a single entry will be present
|
|
1190
|
+
// either in this field, or the `output_file_symlinks` field if the file was
|
|
1191
|
+
// a symbolic link to another file (`output_symlinks` field after v2.1).
|
|
1192
|
+
//
|
|
1193
|
+
// If an output listed in `output_files` was found, but was a directory rather
|
|
1194
|
+
// than a regular file, the server will return a FAILED_PRECONDITION.
|
|
1195
|
+
// If the action does not produce the requested output, then that output
|
|
1196
|
+
// will be omitted from the list. The server is free to arrange the output
|
|
1197
|
+
// list as desired; clients MUST NOT assume that the output list is sorted.
|
|
1198
|
+
repeated OutputFile output_files = 2;
|
|
1199
|
+
|
|
1200
|
+
// The output files of the action that are symbolic links to other files. Those
|
|
1201
|
+
// may be links to other output files, or input files, or even absolute paths
|
|
1202
|
+
// outside of the working directory, if the server supports
|
|
1203
|
+
// [SymlinkAbsolutePathStrategy.ALLOWED][build.bazel.remote.execution.v2.CacheCapabilities.SymlinkAbsolutePathStrategy].
|
|
1204
|
+
// For each output file requested in the `output_files` or `output_paths`
|
|
1205
|
+
// field of the Action, if the corresponding file existed after
|
|
1206
|
+
// the action completed, a single entry will be present either in this field,
|
|
1207
|
+
// or in the `output_files` field, if the file was not a symbolic link.
|
|
1208
|
+
//
|
|
1209
|
+
// If an output symbolic link of the same name as listed in `output_files` of
|
|
1210
|
+
// the Command was found, but its target type was not a regular file, the
|
|
1211
|
+
// server will return a FAILED_PRECONDITION.
|
|
1212
|
+
// If the action does not produce the requested output, then that output
|
|
1213
|
+
// will be omitted from the list. The server is free to arrange the output
|
|
1214
|
+
// list as desired; clients MUST NOT assume that the output list is sorted.
|
|
1215
|
+
//
|
|
1216
|
+
// DEPRECATED as of v2.1. Servers that wish to be compatible with v2.0 API
|
|
1217
|
+
// should still populate this field in addition to `output_symlinks`.
|
|
1218
|
+
repeated OutputSymlink output_file_symlinks = 10 [ deprecated = true ];
|
|
1219
|
+
|
|
1220
|
+
// New in v2.1: this field will only be populated if the command
|
|
1221
|
+
// `output_paths` field was used, and not the pre v2.1 `output_files` or
|
|
1222
|
+
// `output_directories` fields.
|
|
1223
|
+
// The output paths of the action that are symbolic links to other paths. Those
|
|
1224
|
+
// may be links to other outputs, or inputs, or even absolute paths
|
|
1225
|
+
// outside of the working directory, if the server supports
|
|
1226
|
+
// [SymlinkAbsolutePathStrategy.ALLOWED][build.bazel.remote.execution.v2.CacheCapabilities.SymlinkAbsolutePathStrategy].
|
|
1227
|
+
// A single entry for each output requested in `output_paths`
|
|
1228
|
+
// field of the Action, if the corresponding path existed after
|
|
1229
|
+
// the action completed and was a symbolic link.
|
|
1230
|
+
//
|
|
1231
|
+
// If the action does not produce a requested output, then that output
|
|
1232
|
+
// will be omitted from the list. The server is free to arrange the output
|
|
1233
|
+
// list as desired; clients MUST NOT assume that the output list is sorted.
|
|
1234
|
+
repeated OutputSymlink output_symlinks = 12;
|
|
1235
|
+
|
|
1236
|
+
// The output directories of the action. For each output directory requested
|
|
1237
|
+
// in the `output_directories` or `output_paths` field of the Action, if the
|
|
1238
|
+
// corresponding directory existed after the action completed, a single entry
|
|
1239
|
+
// will be present in the output list, which will contain the digest of a
|
|
1240
|
+
// [Tree][build.bazel.remote.execution.v2.Tree] message containing the
|
|
1241
|
+
// directory tree, and the path equal exactly to the corresponding Action
|
|
1242
|
+
// output_directories member.
|
|
1243
|
+
//
|
|
1244
|
+
// As an example, suppose the Action had an output directory `a/b/dir` and the
|
|
1245
|
+
// execution produced the following contents in `a/b/dir`: a file named `bar`
|
|
1246
|
+
// and a directory named `foo` with an executable file named `baz`. Then,
|
|
1247
|
+
// output_directory will contain (hashes shortened for readability):
|
|
1248
|
+
//
|
|
1249
|
+
// ```json
|
|
1250
|
+
// // OutputDirectory proto:
|
|
1251
|
+
// {
|
|
1252
|
+
// path: "a/b/dir"
|
|
1253
|
+
// tree_digest: {
|
|
1254
|
+
// hash: "4a73bc9d03...",
|
|
1255
|
+
// size: 55
|
|
1256
|
+
// }
|
|
1257
|
+
// }
|
|
1258
|
+
// // Tree proto with hash "4a73bc9d03..." and size 55:
|
|
1259
|
+
// {
|
|
1260
|
+
// root: {
|
|
1261
|
+
// files: [
|
|
1262
|
+
// {
|
|
1263
|
+
// name: "bar",
|
|
1264
|
+
// digest: {
|
|
1265
|
+
// hash: "4a73bc9d03...",
|
|
1266
|
+
// size: 65534
|
|
1267
|
+
// }
|
|
1268
|
+
// }
|
|
1269
|
+
// ],
|
|
1270
|
+
// directories: [
|
|
1271
|
+
// {
|
|
1272
|
+
// name: "foo",
|
|
1273
|
+
// digest: {
|
|
1274
|
+
// hash: "4cf2eda940...",
|
|
1275
|
+
// size: 43
|
|
1276
|
+
// }
|
|
1277
|
+
// }
|
|
1278
|
+
// ]
|
|
1279
|
+
// }
|
|
1280
|
+
// children : {
|
|
1281
|
+
// // (Directory proto with hash "4cf2eda940..." and size 43)
|
|
1282
|
+
// files: [
|
|
1283
|
+
// {
|
|
1284
|
+
// name: "baz",
|
|
1285
|
+
// digest: {
|
|
1286
|
+
// hash: "b2c941073e...",
|
|
1287
|
+
// size: 1294,
|
|
1288
|
+
// },
|
|
1289
|
+
// is_executable: true
|
|
1290
|
+
// }
|
|
1291
|
+
// ]
|
|
1292
|
+
// }
|
|
1293
|
+
// }
|
|
1294
|
+
// ```
|
|
1295
|
+
// If an output of the same name as listed in `output_files` of
|
|
1296
|
+
// the Command was found in `output_directories`, but was not a directory, the
|
|
1297
|
+
// server will return a FAILED_PRECONDITION.
|
|
1298
|
+
repeated OutputDirectory output_directories = 3;
|
|
1299
|
+
|
|
1300
|
+
// The output directories of the action that are symbolic links to other
|
|
1301
|
+
// directories. Those may be links to other output directories, or input
|
|
1302
|
+
// directories, or even absolute paths outside of the working directory,
|
|
1303
|
+
// if the server supports
|
|
1304
|
+
// [SymlinkAbsolutePathStrategy.ALLOWED][build.bazel.remote.execution.v2.CacheCapabilities.SymlinkAbsolutePathStrategy].
|
|
1305
|
+
// For each output directory requested in the `output_directories` field of
|
|
1306
|
+
// the Action, if the directory existed after the action completed, a
|
|
1307
|
+
// single entry will be present either in this field, or in the
|
|
1308
|
+
// `output_directories` field, if the directory was not a symbolic link.
|
|
1309
|
+
//
|
|
1310
|
+
// If an output of the same name was found, but was a symbolic link to a file
|
|
1311
|
+
// instead of a directory, the server will return a FAILED_PRECONDITION.
|
|
1312
|
+
// If the action does not produce the requested output, then that output
|
|
1313
|
+
// will be omitted from the list. The server is free to arrange the output
|
|
1314
|
+
// list as desired; clients MUST NOT assume that the output list is sorted.
|
|
1315
|
+
//
|
|
1316
|
+
// DEPRECATED as of v2.1. Servers that wish to be compatible with v2.0 API
|
|
1317
|
+
// should still populate this field in addition to `output_symlinks`.
|
|
1318
|
+
repeated OutputSymlink output_directory_symlinks = 11 [ deprecated = true ];
|
|
1319
|
+
|
|
1320
|
+
// The exit code of the command.
|
|
1321
|
+
int32 exit_code = 4;
|
|
1322
|
+
|
|
1323
|
+
// The standard output buffer of the action. The server SHOULD NOT inline
|
|
1324
|
+
// stdout unless requested by the client in the
|
|
1325
|
+
// [GetActionResultRequest][build.bazel.remote.execution.v2.GetActionResultRequest]
|
|
1326
|
+
// message. The server MAY omit inlining, even if requested, and MUST do so if inlining
|
|
1327
|
+
// would cause the response to exceed message size limits.
|
|
1328
|
+
// Clients SHOULD NOT populate this field when uploading to the cache.
|
|
1329
|
+
bytes stdout_raw = 5;
|
|
1330
|
+
|
|
1331
|
+
// The digest for a blob containing the standard output of the action, which
|
|
1332
|
+
// can be retrieved from the
|
|
1333
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
|
|
1334
|
+
Digest stdout_digest = 6;
|
|
1335
|
+
|
|
1336
|
+
// The standard error buffer of the action. The server SHOULD NOT inline
|
|
1337
|
+
// stderr unless requested by the client in the
|
|
1338
|
+
// [GetActionResultRequest][build.bazel.remote.execution.v2.GetActionResultRequest]
|
|
1339
|
+
// message. The server MAY omit inlining, even if requested, and MUST do so if inlining
|
|
1340
|
+
// would cause the response to exceed message size limits.
|
|
1341
|
+
// Clients SHOULD NOT populate this field when uploading to the cache.
|
|
1342
|
+
bytes stderr_raw = 7;
|
|
1343
|
+
|
|
1344
|
+
// The digest for a blob containing the standard error of the action, which
|
|
1345
|
+
// can be retrieved from the
|
|
1346
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
|
|
1347
|
+
Digest stderr_digest = 8;
|
|
1348
|
+
|
|
1349
|
+
// The details of the execution that originally produced this result.
|
|
1350
|
+
ExecutedActionMetadata execution_metadata = 9;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
// An `OutputFile` is similar to a
|
|
1354
|
+
// [FileNode][build.bazel.remote.execution.v2.FileNode], but it is used as an
|
|
1355
|
+
// output in an `ActionResult`. It allows a full file path rather than
|
|
1356
|
+
// only a name.
|
|
1357
|
+
message OutputFile {
|
|
1358
|
+
// The full path of the file relative to the working directory, including the
|
|
1359
|
+
// filename. The path separator is a forward slash `/`. Since this is a
|
|
1360
|
+
// relative path, it MUST NOT begin with a leading forward slash.
|
|
1361
|
+
string path = 1;
|
|
1362
|
+
|
|
1363
|
+
// The digest of the file's content.
|
|
1364
|
+
Digest digest = 2;
|
|
1365
|
+
|
|
1366
|
+
reserved 3; // Used for a removed field in an earlier version of the API.
|
|
1367
|
+
|
|
1368
|
+
// True if file is executable, false otherwise.
|
|
1369
|
+
bool is_executable = 4;
|
|
1370
|
+
|
|
1371
|
+
// The contents of the file if inlining was requested. The server SHOULD NOT inline
|
|
1372
|
+
// file contents unless requested by the client in the
|
|
1373
|
+
// [GetActionResultRequest][build.bazel.remote.execution.v2.GetActionResultRequest]
|
|
1374
|
+
// message. The server MAY omit inlining, even if requested, and MUST do so if inlining
|
|
1375
|
+
// would cause the response to exceed message size limits.
|
|
1376
|
+
// Clients SHOULD NOT populate this field when uploading to the cache.
|
|
1377
|
+
bytes contents = 5;
|
|
1378
|
+
|
|
1379
|
+
// The supported node properties of the OutputFile, if requested by the Action.
|
|
1380
|
+
reserved 6;
|
|
1381
|
+
NodeProperties node_properties = 7;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
// A `Tree` contains all the
|
|
1385
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] protos in a
|
|
1386
|
+
// single directory Merkle tree, compressed into one message.
|
|
1387
|
+
message Tree {
|
|
1388
|
+
// The root directory in the tree.
|
|
1389
|
+
Directory root = 1;
|
|
1390
|
+
|
|
1391
|
+
// All the child directories: the directories referred to by the root and,
|
|
1392
|
+
// recursively, all its children. In order to reconstruct the directory tree,
|
|
1393
|
+
// the client must take the digests of each of the child directories and then
|
|
1394
|
+
// build up a tree starting from the `root`.
|
|
1395
|
+
// Servers SHOULD ensure that these are ordered consistently such that two
|
|
1396
|
+
// actions producing equivalent output directories on the same server
|
|
1397
|
+
// implementation also produce Tree messages with matching digests.
|
|
1398
|
+
repeated Directory children = 2;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
// An `OutputDirectory` is the output in an `ActionResult` corresponding to a
|
|
1402
|
+
// directory's full contents rather than a single file.
|
|
1403
|
+
message OutputDirectory {
|
|
1404
|
+
// The full path of the directory relative to the working directory. The path
|
|
1405
|
+
// separator is a forward slash `/`. Since this is a relative path, it MUST
|
|
1406
|
+
// NOT begin with a leading forward slash. The empty string value is allowed,
|
|
1407
|
+
// and it denotes the entire working directory.
|
|
1408
|
+
string path = 1;
|
|
1409
|
+
|
|
1410
|
+
reserved 2; // Used for a removed field in an earlier version of the API.
|
|
1411
|
+
|
|
1412
|
+
// The digest of the encoded
|
|
1413
|
+
// [Tree][build.bazel.remote.execution.v2.Tree] proto containing the
|
|
1414
|
+
// directory's contents.
|
|
1415
|
+
Digest tree_digest = 3;
|
|
1416
|
+
|
|
1417
|
+
// If set, consumers MAY make the following assumptions about the
|
|
1418
|
+
// directories contained in the Tree, so that it may be
|
|
1419
|
+
// instantiated on a local file system by scanning through it
|
|
1420
|
+
// sequentially:
|
|
1421
|
+
//
|
|
1422
|
+
// - All directories with the same binary representation are stored
|
|
1423
|
+
// exactly once.
|
|
1424
|
+
// - All directories, apart from the root directory, are referenced by
|
|
1425
|
+
// at least one parent directory.
|
|
1426
|
+
// - Directories are stored in topological order, with parents being
|
|
1427
|
+
// stored before the child. The root directory is thus the first to
|
|
1428
|
+
// be stored.
|
|
1429
|
+
//
|
|
1430
|
+
// Additionally, the Tree MUST be encoded as a stream of records,
|
|
1431
|
+
// where each record has the following format:
|
|
1432
|
+
//
|
|
1433
|
+
// - A tag byte, having one of the following two values:
|
|
1434
|
+
// - (1 << 3) | 2 == 0x0a: First record (the root directory).
|
|
1435
|
+
// - (2 << 3) | 2 == 0x12: Any subsequent records (child directories).
|
|
1436
|
+
// - The size of the directory, encoded as a base 128 varint.
|
|
1437
|
+
// - The contents of the directory, encoded as a binary serialized
|
|
1438
|
+
// Protobuf message.
|
|
1439
|
+
//
|
|
1440
|
+
// This encoding is a subset of the Protobuf wire format of the Tree
|
|
1441
|
+
// message. As it is only permitted to store data associated with
|
|
1442
|
+
// field numbers 1 and 2, the tag MUST be encoded as a single byte.
|
|
1443
|
+
// More details on the Protobuf wire format can be found here:
|
|
1444
|
+
// https://developers.google.com/protocol-buffers/docs/encoding
|
|
1445
|
+
//
|
|
1446
|
+
// It is recommended that implementations using this feature construct
|
|
1447
|
+
// Tree objects manually using the specification given above, as
|
|
1448
|
+
// opposed to using a Protobuf library to marshal a full Tree message.
|
|
1449
|
+
// As individual Directory messages already need to be marshaled to
|
|
1450
|
+
// compute their digests, constructing the Tree object manually avoids
|
|
1451
|
+
// redundant marshaling.
|
|
1452
|
+
bool is_topologically_sorted = 4;
|
|
1453
|
+
|
|
1454
|
+
// The digest of the encoded
|
|
1455
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] proto
|
|
1456
|
+
// containing the contents of the directory's root.
|
|
1457
|
+
//
|
|
1458
|
+
// If both `tree_digest` and `root_directory_digest` are set, this
|
|
1459
|
+
// field MUST match the digest of the root directory contained in the
|
|
1460
|
+
// Tree message.
|
|
1461
|
+
Digest root_directory_digest = 5;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
// An `OutputSymlink` is similar to a
|
|
1465
|
+
// [Symlink][build.bazel.remote.execution.v2.SymlinkNode], but it is used as an
|
|
1466
|
+
// output in an `ActionResult`.
|
|
1467
|
+
//
|
|
1468
|
+
// `OutputSymlink` is binary-compatible with `SymlinkNode`.
|
|
1469
|
+
message OutputSymlink {
|
|
1470
|
+
// The full path of the symlink relative to the working directory, including the
|
|
1471
|
+
// filename. The path separator is a forward slash `/`. Since this is a
|
|
1472
|
+
// relative path, it MUST NOT begin with a leading forward slash.
|
|
1473
|
+
string path = 1;
|
|
1474
|
+
|
|
1475
|
+
// The target path of the symlink. The path separator is a forward slash `/`.
|
|
1476
|
+
// The target path can be relative to the parent directory of the symlink or
|
|
1477
|
+
// it can be an absolute path starting with `/`. Support for absolute paths
|
|
1478
|
+
// can be checked using the [Capabilities][build.bazel.remote.execution.v2.Capabilities]
|
|
1479
|
+
// API. `..` components are allowed anywhere in the target path.
|
|
1480
|
+
string target = 2;
|
|
1481
|
+
|
|
1482
|
+
// The supported node properties of the OutputSymlink, if requested by the
|
|
1483
|
+
// Action.
|
|
1484
|
+
reserved 3;
|
|
1485
|
+
NodeProperties node_properties = 4;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
// An `ExecutionPolicy` can be used to control the scheduling of the action.
|
|
1489
|
+
message ExecutionPolicy {
|
|
1490
|
+
// The priority (relative importance) of this action. Generally, a lower value
|
|
1491
|
+
// means that the action should be run sooner than actions having a greater
|
|
1492
|
+
// priority value, but the interpretation of a given value is server-
|
|
1493
|
+
// dependent. A priority of 0 means the *default* priority. Priorities may be
|
|
1494
|
+
// positive or negative, and such actions should run later or sooner than
|
|
1495
|
+
// actions having the default priority, respectively. The particular semantics
|
|
1496
|
+
// of this field is up to the server. In particular, every server will have
|
|
1497
|
+
// their own supported range of priorities, and will decide how these map into
|
|
1498
|
+
// scheduling policy.
|
|
1499
|
+
int32 priority = 1;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
// A `ResultsCachePolicy` is used for fine-grained control over how action
|
|
1503
|
+
// outputs are stored in the CAS and Action Cache.
|
|
1504
|
+
message ResultsCachePolicy {
|
|
1505
|
+
// The priority (relative importance) of this content in the overall cache.
|
|
1506
|
+
// Generally, a lower value means a longer retention time or other advantage,
|
|
1507
|
+
// but the interpretation of a given value is server-dependent. A priority of
|
|
1508
|
+
// 0 means a *default* value, decided by the server.
|
|
1509
|
+
//
|
|
1510
|
+
// The particular semantics of this field is up to the server. In particular,
|
|
1511
|
+
// every server will have their own supported range of priorities, and will
|
|
1512
|
+
// decide how these map into retention/eviction policy.
|
|
1513
|
+
int32 priority = 1;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
// A request message for
|
|
1517
|
+
// [Execution.Execute][build.bazel.remote.execution.v2.Execution.Execute].
|
|
1518
|
+
message ExecuteRequest {
|
|
1519
|
+
// The instance of the execution system to operate against. A server may
|
|
1520
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1521
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1522
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1523
|
+
// omitted.
|
|
1524
|
+
string instance_name = 1;
|
|
1525
|
+
|
|
1526
|
+
// If true, the action will be executed even if its result is already
|
|
1527
|
+
// present in the [ActionCache][build.bazel.remote.execution.v2.ActionCache].
|
|
1528
|
+
// The execution is still allowed to be merged with other in-flight executions
|
|
1529
|
+
// of the same action, however - semantically, the service MUST only guarantee
|
|
1530
|
+
// that the results of an execution with this field set were not visible
|
|
1531
|
+
// before the corresponding execution request was sent.
|
|
1532
|
+
// Note that actions from execution requests setting this field set are still
|
|
1533
|
+
// eligible to be entered into the action cache upon completion, and services
|
|
1534
|
+
// SHOULD overwrite any existing entries that may exist. This allows
|
|
1535
|
+
// skip_cache_lookup requests to be used as a mechanism for replacing action
|
|
1536
|
+
// cache entries that reference outputs no longer available or that are
|
|
1537
|
+
// poisoned in any way.
|
|
1538
|
+
// If false, the result may be served from the action cache.
|
|
1539
|
+
bool skip_cache_lookup = 3;
|
|
1540
|
+
|
|
1541
|
+
reserved 2, 4, 5; // Used for removed fields in an earlier version of the API.
|
|
1542
|
+
|
|
1543
|
+
// The digest of the [Action][build.bazel.remote.execution.v2.Action] to
|
|
1544
|
+
// execute.
|
|
1545
|
+
Digest action_digest = 6;
|
|
1546
|
+
|
|
1547
|
+
// An optional policy for execution of the action.
|
|
1548
|
+
// The server will have a default policy if this is not provided.
|
|
1549
|
+
ExecutionPolicy execution_policy = 7;
|
|
1550
|
+
|
|
1551
|
+
// An optional policy for the results of this execution in the remote cache.
|
|
1552
|
+
// The server will have a default policy if this is not provided.
|
|
1553
|
+
// This may be applied to both the ActionResult and the associated blobs.
|
|
1554
|
+
ResultsCachePolicy results_cache_policy = 8;
|
|
1555
|
+
|
|
1556
|
+
// The digest function that was used to compute the action digest.
|
|
1557
|
+
//
|
|
1558
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1559
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1560
|
+
// that case the server SHOULD infer the digest function using the
|
|
1561
|
+
// length of the action digest hash and the digest functions announced
|
|
1562
|
+
// in the server's capabilities.
|
|
1563
|
+
DigestFunction.Value digest_function = 9;
|
|
1564
|
+
|
|
1565
|
+
// A hint to the server to request inlining stdout in the
|
|
1566
|
+
// [ActionResult][build.bazel.remote.execution.v2.ActionResult] message.
|
|
1567
|
+
bool inline_stdout = 10;
|
|
1568
|
+
|
|
1569
|
+
// A hint to the server to request inlining stderr in the
|
|
1570
|
+
// [ActionResult][build.bazel.remote.execution.v2.ActionResult] message.
|
|
1571
|
+
bool inline_stderr = 11;
|
|
1572
|
+
|
|
1573
|
+
// A hint to the server to inline the contents of the listed output files.
|
|
1574
|
+
// Each path needs to exactly match one file path in either `output_paths` or
|
|
1575
|
+
// `output_files` (DEPRECATED since v2.1) in the
|
|
1576
|
+
// [Command][build.bazel.remote.execution.v2.Command] message.
|
|
1577
|
+
repeated string inline_output_files = 12;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
// A `LogFile` is a log stored in the CAS.
|
|
1581
|
+
message LogFile {
|
|
1582
|
+
// The digest of the log contents.
|
|
1583
|
+
Digest digest = 1;
|
|
1584
|
+
|
|
1585
|
+
// This is a hint as to the purpose of the log, and is set to true if the log
|
|
1586
|
+
// is human-readable text that can be usefully displayed to a user, and false
|
|
1587
|
+
// otherwise. For instance, if a command-line client wishes to print the
|
|
1588
|
+
// server logs to the terminal for a failed action, this allows it to avoid
|
|
1589
|
+
// displaying a binary file.
|
|
1590
|
+
bool human_readable = 2;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
// The response message for
|
|
1594
|
+
// [Execution.Execute][build.bazel.remote.execution.v2.Execution.Execute],
|
|
1595
|
+
// which will be contained in the [response
|
|
1596
|
+
// field][google.longrunning.Operation.response] of the
|
|
1597
|
+
// [Operation][google.longrunning.Operation].
|
|
1598
|
+
message ExecuteResponse {
|
|
1599
|
+
// The result of the action.
|
|
1600
|
+
ActionResult result = 1;
|
|
1601
|
+
|
|
1602
|
+
// True if the result was served from cache, false if it was executed.
|
|
1603
|
+
bool cached_result = 2;
|
|
1604
|
+
|
|
1605
|
+
// If the status has a code other than `OK`, it indicates that the action did
|
|
1606
|
+
// not finish execution. For example, if the operation times out during
|
|
1607
|
+
// execution, the status will have a `DEADLINE_EXCEEDED` code. Servers MUST
|
|
1608
|
+
// use this field for errors in execution, rather than the error field on the
|
|
1609
|
+
// `Operation` object.
|
|
1610
|
+
//
|
|
1611
|
+
// If the status code is other than `OK`, then the result MUST NOT be cached.
|
|
1612
|
+
// For an error status, the `result` field is optional; the server may
|
|
1613
|
+
// populate the output-, stdout-, and stderr-related fields if it has any
|
|
1614
|
+
// information available, such as the stdout and stderr of a timed-out action.
|
|
1615
|
+
google.rpc.Status status = 3;
|
|
1616
|
+
|
|
1617
|
+
// An optional list of additional log outputs the server wishes to provide. A
|
|
1618
|
+
// server can use this to return execution-specific logs however it wishes.
|
|
1619
|
+
// This is intended primarily to make it easier for users to debug issues that
|
|
1620
|
+
// may be outside of the actual job execution, such as by identifying the
|
|
1621
|
+
// worker executing the action or by providing logs from the worker's setup
|
|
1622
|
+
// phase. The keys SHOULD be human readable so that a client can display them
|
|
1623
|
+
// to a user.
|
|
1624
|
+
map<string, LogFile> server_logs = 4;
|
|
1625
|
+
|
|
1626
|
+
// Freeform informational message with details on the execution of the action
|
|
1627
|
+
// that may be displayed to the user upon failure or when requested explicitly.
|
|
1628
|
+
string message = 5;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
// The current stage of action execution.
|
|
1632
|
+
//
|
|
1633
|
+
// Even though these stages are numbered according to the order in which
|
|
1634
|
+
// they generally occur, there is no requirement that the remote
|
|
1635
|
+
// execution system reports events along this order. For example, an
|
|
1636
|
+
// operation MAY transition from the EXECUTING stage back to QUEUED
|
|
1637
|
+
// in case the hardware on which the operation executes fails.
|
|
1638
|
+
//
|
|
1639
|
+
// If and only if the remote execution system reports that an operation
|
|
1640
|
+
// has reached the COMPLETED stage, it MUST set the [done
|
|
1641
|
+
// field][google.longrunning.Operation.done] of the
|
|
1642
|
+
// [Operation][google.longrunning.Operation] and terminate the stream.
|
|
1643
|
+
message ExecutionStage {
|
|
1644
|
+
enum Value {
|
|
1645
|
+
// Invalid value.
|
|
1646
|
+
UNKNOWN = 0;
|
|
1647
|
+
|
|
1648
|
+
// Checking the result against the cache.
|
|
1649
|
+
CACHE_CHECK = 1;
|
|
1650
|
+
|
|
1651
|
+
// Currently idle, awaiting a free machine to execute.
|
|
1652
|
+
QUEUED = 2;
|
|
1653
|
+
|
|
1654
|
+
// Currently being executed by a worker.
|
|
1655
|
+
EXECUTING = 3;
|
|
1656
|
+
|
|
1657
|
+
// Finished execution.
|
|
1658
|
+
COMPLETED = 4;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
// Metadata about an ongoing
|
|
1663
|
+
// [execution][build.bazel.remote.execution.v2.Execution.Execute], which
|
|
1664
|
+
// will be contained in the [metadata
|
|
1665
|
+
// field][google.longrunning.Operation.metadata] of the
|
|
1666
|
+
// [Operation][google.longrunning.Operation].
|
|
1667
|
+
message ExecuteOperationMetadata {
|
|
1668
|
+
// The current stage of execution.
|
|
1669
|
+
ExecutionStage.Value stage = 1;
|
|
1670
|
+
|
|
1671
|
+
// The digest of the [Action][build.bazel.remote.execution.v2.Action]
|
|
1672
|
+
// being executed.
|
|
1673
|
+
Digest action_digest = 2;
|
|
1674
|
+
|
|
1675
|
+
// If set, the client can use this resource name with
|
|
1676
|
+
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
|
|
1677
|
+
// standard output from the endpoint hosting streamed responses.
|
|
1678
|
+
string stdout_stream_name = 3;
|
|
1679
|
+
|
|
1680
|
+
// If set, the client can use this resource name with
|
|
1681
|
+
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
|
|
1682
|
+
// standard error from the endpoint hosting streamed responses.
|
|
1683
|
+
string stderr_stream_name = 4;
|
|
1684
|
+
|
|
1685
|
+
// The client can read this field to view details about the ongoing
|
|
1686
|
+
// execution.
|
|
1687
|
+
ExecutedActionMetadata partial_execution_metadata = 5;
|
|
1688
|
+
|
|
1689
|
+
// The digest function that was used to compute the action digest.
|
|
1690
|
+
//
|
|
1691
|
+
// If the digest function used is one of BLAKE3, MD5, MURMUR3, SHA1,
|
|
1692
|
+
// SHA256, SHA256TREE, SHA384, SHA512, or VSO, the server MAY leave
|
|
1693
|
+
// this field unset. In that case the client SHOULD infer the digest
|
|
1694
|
+
// function using the length of the action digest hash and the digest
|
|
1695
|
+
// functions announced in the server's capabilities.
|
|
1696
|
+
DigestFunction.Value digest_function = 6;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
// A request message for
|
|
1700
|
+
// [WaitExecution][build.bazel.remote.execution.v2.Execution.WaitExecution].
|
|
1701
|
+
message WaitExecutionRequest {
|
|
1702
|
+
// The name of the [Operation][google.longrunning.Operation]
|
|
1703
|
+
// returned by [Execute][build.bazel.remote.execution.v2.Execution.Execute].
|
|
1704
|
+
string name = 1;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
// A request message for
|
|
1708
|
+
// [ActionCache.GetActionResult][build.bazel.remote.execution.v2.ActionCache.GetActionResult].
|
|
1709
|
+
message GetActionResultRequest {
|
|
1710
|
+
// The instance of the execution system to operate against. A server may
|
|
1711
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1712
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1713
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1714
|
+
// omitted.
|
|
1715
|
+
string instance_name = 1;
|
|
1716
|
+
|
|
1717
|
+
// The digest of the [Action][build.bazel.remote.execution.v2.Action]
|
|
1718
|
+
// whose result is requested.
|
|
1719
|
+
Digest action_digest = 2;
|
|
1720
|
+
|
|
1721
|
+
// A hint to the server to request inlining stdout in the
|
|
1722
|
+
// [ActionResult][build.bazel.remote.execution.v2.ActionResult] message.
|
|
1723
|
+
bool inline_stdout = 3;
|
|
1724
|
+
|
|
1725
|
+
// A hint to the server to request inlining stderr in the
|
|
1726
|
+
// [ActionResult][build.bazel.remote.execution.v2.ActionResult] message.
|
|
1727
|
+
bool inline_stderr = 4;
|
|
1728
|
+
|
|
1729
|
+
// A hint to the server to inline the contents of the listed output files.
|
|
1730
|
+
// Each path needs to exactly match one file path in either `output_paths` or
|
|
1731
|
+
// `output_files` (DEPRECATED since v2.1) in the
|
|
1732
|
+
// [Command][build.bazel.remote.execution.v2.Command] message.
|
|
1733
|
+
repeated string inline_output_files = 5;
|
|
1734
|
+
|
|
1735
|
+
// The digest function that was used to compute the action digest.
|
|
1736
|
+
//
|
|
1737
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1738
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1739
|
+
// that case the server SHOULD infer the digest function using the
|
|
1740
|
+
// length of the action digest hash and the digest functions announced
|
|
1741
|
+
// in the server's capabilities.
|
|
1742
|
+
DigestFunction.Value digest_function = 6;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
// A request message for
|
|
1746
|
+
// [ActionCache.UpdateActionResult][build.bazel.remote.execution.v2.ActionCache.UpdateActionResult].
|
|
1747
|
+
message UpdateActionResultRequest {
|
|
1748
|
+
// The instance of the execution system to operate against. A server may
|
|
1749
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1750
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1751
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1752
|
+
// omitted.
|
|
1753
|
+
string instance_name = 1;
|
|
1754
|
+
|
|
1755
|
+
// The digest of the [Action][build.bazel.remote.execution.v2.Action]
|
|
1756
|
+
// whose result is being uploaded.
|
|
1757
|
+
Digest action_digest = 2;
|
|
1758
|
+
|
|
1759
|
+
// The [ActionResult][build.bazel.remote.execution.v2.ActionResult]
|
|
1760
|
+
// to store in the cache.
|
|
1761
|
+
ActionResult action_result = 3;
|
|
1762
|
+
|
|
1763
|
+
// An optional policy for the results of this execution in the remote cache.
|
|
1764
|
+
// The server will have a default policy if this is not provided.
|
|
1765
|
+
// This may be applied to both the ActionResult and the associated blobs.
|
|
1766
|
+
ResultsCachePolicy results_cache_policy = 4;
|
|
1767
|
+
|
|
1768
|
+
// The digest function that was used to compute the action digest.
|
|
1769
|
+
//
|
|
1770
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1771
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1772
|
+
// that case the server SHOULD infer the digest function using the
|
|
1773
|
+
// length of the action digest hash and the digest functions announced
|
|
1774
|
+
// in the server's capabilities.
|
|
1775
|
+
DigestFunction.Value digest_function = 5;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
// A request message for
|
|
1779
|
+
// [ContentAddressableStorage.FindMissingBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.FindMissingBlobs].
|
|
1780
|
+
message FindMissingBlobsRequest {
|
|
1781
|
+
// The instance of the execution system to operate against. A server may
|
|
1782
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1783
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1784
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1785
|
+
// omitted.
|
|
1786
|
+
string instance_name = 1;
|
|
1787
|
+
|
|
1788
|
+
// A list of the blobs to check. All digests MUST use the same digest
|
|
1789
|
+
// function.
|
|
1790
|
+
repeated Digest blob_digests = 2;
|
|
1791
|
+
|
|
1792
|
+
// The digest function of the blobs whose existence is checked.
|
|
1793
|
+
//
|
|
1794
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1795
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1796
|
+
// that case the server SHOULD infer the digest function using the
|
|
1797
|
+
// length of the blob digest hashes and the digest functions announced
|
|
1798
|
+
// in the server's capabilities.
|
|
1799
|
+
DigestFunction.Value digest_function = 3;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
// A response message for
|
|
1803
|
+
// [ContentAddressableStorage.FindMissingBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.FindMissingBlobs].
|
|
1804
|
+
message FindMissingBlobsResponse {
|
|
1805
|
+
// A list of the blobs requested *not* present in the storage.
|
|
1806
|
+
repeated Digest missing_blob_digests = 2;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
// A request message for
|
|
1810
|
+
// [ContentAddressableStorage.BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs].
|
|
1811
|
+
message BatchUpdateBlobsRequest {
|
|
1812
|
+
// A request corresponding to a single blob that the client wants to upload.
|
|
1813
|
+
message Request {
|
|
1814
|
+
// The digest of the blob. This MUST be the digest of `data`. All
|
|
1815
|
+
// digests MUST use the same digest function.
|
|
1816
|
+
Digest digest = 1;
|
|
1817
|
+
|
|
1818
|
+
// The raw binary data.
|
|
1819
|
+
bytes data = 2;
|
|
1820
|
+
|
|
1821
|
+
// The format of `data`. Must be `IDENTITY`/unspecified, or one of the
|
|
1822
|
+
// compressors advertised by the
|
|
1823
|
+
// [CacheCapabilities.supported_batch_update_compressors][build.bazel.remote.execution.v2.CacheCapabilities.supported_batch_update_compressors]
|
|
1824
|
+
// field.
|
|
1825
|
+
Compressor.Value compressor = 3;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
// The instance of the execution system to operate against. A server may
|
|
1829
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1830
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1831
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1832
|
+
// omitted.
|
|
1833
|
+
string instance_name = 1;
|
|
1834
|
+
|
|
1835
|
+
// The individual upload requests.
|
|
1836
|
+
repeated Request requests = 2;
|
|
1837
|
+
|
|
1838
|
+
// The digest function that was used to compute the digests of the
|
|
1839
|
+
// blobs being uploaded.
|
|
1840
|
+
//
|
|
1841
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1842
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1843
|
+
// that case the server SHOULD infer the digest function using the
|
|
1844
|
+
// length of the blob digest hashes and the digest functions announced
|
|
1845
|
+
// in the server's capabilities.
|
|
1846
|
+
DigestFunction.Value digest_function = 5;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
// A response message for
|
|
1850
|
+
// [ContentAddressableStorage.BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs].
|
|
1851
|
+
message BatchUpdateBlobsResponse {
|
|
1852
|
+
// A response corresponding to a single blob that the client tried to upload.
|
|
1853
|
+
message Response {
|
|
1854
|
+
// The blob digest to which this response corresponds.
|
|
1855
|
+
Digest digest = 1;
|
|
1856
|
+
|
|
1857
|
+
// The result of attempting to upload that blob.
|
|
1858
|
+
google.rpc.Status status = 2;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
// The responses to the requests.
|
|
1862
|
+
repeated Response responses = 1;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
// A request message for
|
|
1866
|
+
// [ContentAddressableStorage.BatchReadBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchReadBlobs].
|
|
1867
|
+
message BatchReadBlobsRequest {
|
|
1868
|
+
// The instance of the execution system to operate against. A server may
|
|
1869
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1870
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1871
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1872
|
+
// omitted.
|
|
1873
|
+
string instance_name = 1;
|
|
1874
|
+
|
|
1875
|
+
// The individual blob digests. All digests MUST use the same digest
|
|
1876
|
+
// function.
|
|
1877
|
+
repeated Digest digests = 2;
|
|
1878
|
+
|
|
1879
|
+
// A list of acceptable encodings for the returned inlined data, in no
|
|
1880
|
+
// particular order. `IDENTITY` is always allowed even if not specified here.
|
|
1881
|
+
repeated Compressor.Value acceptable_compressors = 3;
|
|
1882
|
+
|
|
1883
|
+
// The digest function of the blobs being requested.
|
|
1884
|
+
//
|
|
1885
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1886
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1887
|
+
// that case the server SHOULD infer the digest function using the
|
|
1888
|
+
// length of the blob digest hashes and the digest functions announced
|
|
1889
|
+
// in the server's capabilities.
|
|
1890
|
+
DigestFunction.Value digest_function = 4;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
// A response message for
|
|
1894
|
+
// [ContentAddressableStorage.BatchReadBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchReadBlobs].
|
|
1895
|
+
message BatchReadBlobsResponse {
|
|
1896
|
+
// A response corresponding to a single blob that the client tried to download.
|
|
1897
|
+
message Response {
|
|
1898
|
+
// The digest to which this response corresponds.
|
|
1899
|
+
Digest digest = 1;
|
|
1900
|
+
|
|
1901
|
+
// The raw binary data.
|
|
1902
|
+
bytes data = 2;
|
|
1903
|
+
|
|
1904
|
+
// The format the data is encoded in. MUST be `IDENTITY`/unspecified,
|
|
1905
|
+
// or one of the acceptable compressors specified in the `BatchReadBlobsRequest`.
|
|
1906
|
+
Compressor.Value compressor = 4;
|
|
1907
|
+
|
|
1908
|
+
// The result of attempting to download that blob.
|
|
1909
|
+
google.rpc.Status status = 3;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
// The responses to the requests.
|
|
1913
|
+
repeated Response responses = 1;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
// A request message for
|
|
1917
|
+
// [ContentAddressableStorage.GetTree][build.bazel.remote.execution.v2.ContentAddressableStorage.GetTree].
|
|
1918
|
+
message GetTreeRequest {
|
|
1919
|
+
// The instance of the execution system to operate against. A server may
|
|
1920
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1921
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1922
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1923
|
+
// omitted.
|
|
1924
|
+
string instance_name = 1;
|
|
1925
|
+
|
|
1926
|
+
// The digest of the root, which must be an encoded
|
|
1927
|
+
// [Directory][build.bazel.remote.execution.v2.Directory] message
|
|
1928
|
+
// stored in the
|
|
1929
|
+
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
|
|
1930
|
+
Digest root_digest = 2;
|
|
1931
|
+
|
|
1932
|
+
// A maximum page size to request. If present, the server will request no more
|
|
1933
|
+
// than this many items. Regardless of whether a page size is specified, the
|
|
1934
|
+
// server may place its own limit on the number of items to be returned and
|
|
1935
|
+
// require the client to retrieve more items using a subsequent request.
|
|
1936
|
+
int32 page_size = 3;
|
|
1937
|
+
|
|
1938
|
+
// A page token, which must be a value received in a previous
|
|
1939
|
+
// [GetTreeResponse][build.bazel.remote.execution.v2.GetTreeResponse].
|
|
1940
|
+
// If present, the server will use that token as an offset, returning only
|
|
1941
|
+
// that page and the ones that succeed it.
|
|
1942
|
+
string page_token = 4;
|
|
1943
|
+
|
|
1944
|
+
// The digest function that was used to compute the digest of the root
|
|
1945
|
+
// directory.
|
|
1946
|
+
//
|
|
1947
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1948
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1949
|
+
// that case the server SHOULD infer the digest function using the
|
|
1950
|
+
// length of the root digest hash and the digest functions announced
|
|
1951
|
+
// in the server's capabilities.
|
|
1952
|
+
DigestFunction.Value digest_function = 5;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
// A response message for
|
|
1956
|
+
// [ContentAddressableStorage.GetTree][build.bazel.remote.execution.v2.ContentAddressableStorage.GetTree].
|
|
1957
|
+
message GetTreeResponse {
|
|
1958
|
+
// The directories descended from the requested root.
|
|
1959
|
+
repeated Directory directories = 1;
|
|
1960
|
+
|
|
1961
|
+
// If present, signifies that there are more results which the client can
|
|
1962
|
+
// retrieve by passing this as the page_token in a subsequent
|
|
1963
|
+
// [request][build.bazel.remote.execution.v2.GetTreeRequest].
|
|
1964
|
+
// If empty, signifies that this is the last page of results.
|
|
1965
|
+
string next_page_token = 2;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
// A request message for
|
|
1969
|
+
// [ContentAddressableStorage.SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob].
|
|
1970
|
+
message SplitBlobRequest {
|
|
1971
|
+
// The instance of the execution system to operate against. A server may
|
|
1972
|
+
// support multiple instances of the execution system (with their own workers,
|
|
1973
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
1974
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
1975
|
+
// omitted.
|
|
1976
|
+
string instance_name = 1;
|
|
1977
|
+
|
|
1978
|
+
// The digest of the blob to be split.
|
|
1979
|
+
Digest blob_digest = 2;
|
|
1980
|
+
|
|
1981
|
+
// The digest function of the blob to be split.
|
|
1982
|
+
//
|
|
1983
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256,
|
|
1984
|
+
// SHA384, SHA512, or VSO, the client MAY leave this field unset. In
|
|
1985
|
+
// that case the server SHOULD infer the digest function using the
|
|
1986
|
+
// length of the blob digest hashes and the digest functions announced
|
|
1987
|
+
// in the server's capabilities.
|
|
1988
|
+
DigestFunction.Value digest_function = 3;
|
|
1989
|
+
|
|
1990
|
+
// The chunking function that the client prefers to use.
|
|
1991
|
+
//
|
|
1992
|
+
// The server MAY use a different chunking function.
|
|
1993
|
+
ChunkingFunction.Value chunking_function = 4;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
// A response message for
|
|
1997
|
+
// [ContentAddressableStorage.SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob].
|
|
1998
|
+
message SplitBlobResponse {
|
|
1999
|
+
// The ordered list of digests of the chunks into which the blob was split.
|
|
2000
|
+
// The original blob is assembled by concatenating the chunk data according to
|
|
2001
|
+
// the order of the digests given by this list.
|
|
2002
|
+
//
|
|
2003
|
+
// The server MUST use the same digest function as the one explicitly or
|
|
2004
|
+
// implicitly (through hash length) specified in the split request.
|
|
2005
|
+
repeated Digest chunk_digests = 1;
|
|
2006
|
+
|
|
2007
|
+
// The chunking function used to split the blob.
|
|
2008
|
+
ChunkingFunction.Value chunking_function = 2;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
// A request message for
|
|
2012
|
+
// [ContentAddressableStorage.SpliceBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SpliceBlob].
|
|
2013
|
+
message SpliceBlobRequest {
|
|
2014
|
+
// The instance of the execution system to operate against. A server may
|
|
2015
|
+
// support multiple instances of the execution system (with their own workers,
|
|
2016
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
2017
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
2018
|
+
// omitted.
|
|
2019
|
+
string instance_name = 1;
|
|
2020
|
+
|
|
2021
|
+
// Expected digest of the spliced blob. The client MUST set this field due
|
|
2022
|
+
// to the following reasons:
|
|
2023
|
+
// 1. It allows the server to perform an early existence check of the blob
|
|
2024
|
+
// or existing chunks that assemble the blob before spending the splicing
|
|
2025
|
+
// effort, as described in the [ContentAddressableStorage.SpliceBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SpliceBlob]
|
|
2026
|
+
// documentation.
|
|
2027
|
+
// 2. It allows servers with different storage backends to dispatch the
|
|
2028
|
+
// request to the correct storage backend based on the size and/or the
|
|
2029
|
+
// hash of the blob.
|
|
2030
|
+
// 3. If chunking information already exists for the blob, it allows
|
|
2031
|
+
// the server to keep the existing chunking information or replace it with
|
|
2032
|
+
// new chunking information.
|
|
2033
|
+
Digest blob_digest = 2;
|
|
2034
|
+
|
|
2035
|
+
// The ordered list of digests of the chunks which need to be concatenated to
|
|
2036
|
+
// assemble the original blob.
|
|
2037
|
+
repeated Digest chunk_digests = 3;
|
|
2038
|
+
|
|
2039
|
+
// The digest function of all chunks to be concatenated and of the blob to be
|
|
2040
|
+
// spliced. The server MUST use the same digest function for both cases.
|
|
2041
|
+
//
|
|
2042
|
+
// If the digest function used is one of MD5, MURMUR3, SHA1, SHA256, SHA384,
|
|
2043
|
+
// SHA512, or VSO, the client MAY leave this field unset. In that case the
|
|
2044
|
+
// server SHOULD infer the digest function using the length of the blob digest
|
|
2045
|
+
// hashes and the digest functions announced in the server's capabilities.
|
|
2046
|
+
DigestFunction.Value digest_function = 4;
|
|
2047
|
+
|
|
2048
|
+
// The chunking function that the client used to split the blob.
|
|
2049
|
+
ChunkingFunction.Value chunking_function = 5;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
// A response message for
|
|
2053
|
+
// [ContentAddressableStorage.SpliceBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SpliceBlob].
|
|
2054
|
+
message SpliceBlobResponse {
|
|
2055
|
+
// Computed digest of the spliced blob.
|
|
2056
|
+
//
|
|
2057
|
+
// The server MUST use the same digest function as the one explicitly or
|
|
2058
|
+
// implicitly (through hash length) specified in the splice request.
|
|
2059
|
+
Digest blob_digest = 1;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
// A request message for
|
|
2063
|
+
// [Capabilities.GetCapabilities][build.bazel.remote.execution.v2.Capabilities.GetCapabilities].
|
|
2064
|
+
message GetCapabilitiesRequest {
|
|
2065
|
+
// The instance of the execution system to operate against. A server may
|
|
2066
|
+
// support multiple instances of the execution system (with their own workers,
|
|
2067
|
+
// storage, caches, etc.). The server MAY require use of this field to select
|
|
2068
|
+
// between them in an implementation-defined fashion, otherwise it can be
|
|
2069
|
+
// omitted.
|
|
2070
|
+
string instance_name = 1;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
// A response message for
|
|
2074
|
+
// [Capabilities.GetCapabilities][build.bazel.remote.execution.v2.Capabilities.GetCapabilities].
|
|
2075
|
+
message ServerCapabilities {
|
|
2076
|
+
// Capabilities of the remote cache system.
|
|
2077
|
+
CacheCapabilities cache_capabilities = 1;
|
|
2078
|
+
|
|
2079
|
+
// Capabilities of the remote execution system.
|
|
2080
|
+
ExecutionCapabilities execution_capabilities = 2;
|
|
2081
|
+
|
|
2082
|
+
// Earliest RE API version supported, including deprecated versions.
|
|
2083
|
+
build.bazel.semver.SemVer deprecated_api_version = 3;
|
|
2084
|
+
|
|
2085
|
+
// Earliest non-deprecated RE API version supported.
|
|
2086
|
+
build.bazel.semver.SemVer low_api_version = 4;
|
|
2087
|
+
|
|
2088
|
+
// Latest RE API version supported.
|
|
2089
|
+
build.bazel.semver.SemVer high_api_version = 5;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
// The digest function used for converting values into keys for CAS and Action
|
|
2093
|
+
// Cache.
|
|
2094
|
+
message DigestFunction {
|
|
2095
|
+
enum Value {
|
|
2096
|
+
// It is an error for the server to return this value.
|
|
2097
|
+
UNKNOWN = 0;
|
|
2098
|
+
|
|
2099
|
+
// The SHA-256 digest function.
|
|
2100
|
+
SHA256 = 1;
|
|
2101
|
+
|
|
2102
|
+
// The SHA-1 digest function.
|
|
2103
|
+
SHA1 = 2;
|
|
2104
|
+
|
|
2105
|
+
// The MD5 digest function.
|
|
2106
|
+
MD5 = 3;
|
|
2107
|
+
|
|
2108
|
+
// The Microsoft "VSO-Hash" paged SHA256 digest function.
|
|
2109
|
+
// See https://github.com/microsoft/BuildXL/blob/master/Documentation/Specs/PagedHash.md .
|
|
2110
|
+
VSO = 4;
|
|
2111
|
+
|
|
2112
|
+
// The SHA-384 digest function.
|
|
2113
|
+
SHA384 = 5;
|
|
2114
|
+
|
|
2115
|
+
// The SHA-512 digest function.
|
|
2116
|
+
SHA512 = 6;
|
|
2117
|
+
|
|
2118
|
+
// Murmur3 128-bit digest function, x64 variant. Note that this is not a
|
|
2119
|
+
// cryptographic hash function and its collision properties are not strongly guaranteed.
|
|
2120
|
+
// See https://github.com/aappleby/smhasher/wiki/MurmurHash3 .
|
|
2121
|
+
MURMUR3 = 7;
|
|
2122
|
+
|
|
2123
|
+
// The SHA-256 digest function, modified to use a Merkle tree for
|
|
2124
|
+
// large objects. This permits implementations to store large blobs
|
|
2125
|
+
// as a decomposed sequence of 2^j sized chunks, where j >= 10,
|
|
2126
|
+
// while being able to validate integrity at the chunk level.
|
|
2127
|
+
//
|
|
2128
|
+
// Furthermore, on systems that do not offer dedicated instructions
|
|
2129
|
+
// for computing SHA-256 hashes (e.g., the Intel SHA and ARMv8
|
|
2130
|
+
// cryptographic extensions), SHA256TREE hashes can be computed more
|
|
2131
|
+
// efficiently than plain SHA-256 hashes by using generic SIMD
|
|
2132
|
+
// extensions, such as Intel AVX2 or ARM NEON.
|
|
2133
|
+
//
|
|
2134
|
+
// SHA256TREE hashes are computed as follows:
|
|
2135
|
+
//
|
|
2136
|
+
// - For blobs that are 1024 bytes or smaller, the hash is computed
|
|
2137
|
+
// using the regular SHA-256 digest function.
|
|
2138
|
+
//
|
|
2139
|
+
// - For blobs that are more than 1024 bytes in size, the hash is
|
|
2140
|
+
// computed as follows:
|
|
2141
|
+
//
|
|
2142
|
+
// 1. The blob is partitioned into a left (leading) and right
|
|
2143
|
+
// (trailing) blob. These blobs have lengths m and n
|
|
2144
|
+
// respectively, where m = 2^k and 0 < n <= m.
|
|
2145
|
+
//
|
|
2146
|
+
// 2. Hashes of the left and right blob, Hash(left) and
|
|
2147
|
+
// Hash(right) respectively, are computed by recursively
|
|
2148
|
+
// applying the SHA256TREE algorithm.
|
|
2149
|
+
//
|
|
2150
|
+
// 3. A single invocation is made to the SHA-256 block cipher with
|
|
2151
|
+
// the following parameters:
|
|
2152
|
+
//
|
|
2153
|
+
// M = Hash(left) || Hash(right)
|
|
2154
|
+
// H = {
|
|
2155
|
+
// 0xcbbb9d5d, 0x629a292a, 0x9159015a, 0x152fecd8,
|
|
2156
|
+
// 0x67332667, 0x8eb44a87, 0xdb0c2e0d, 0x47b5481d,
|
|
2157
|
+
// }
|
|
2158
|
+
//
|
|
2159
|
+
// The values of H are the leading fractional parts of the
|
|
2160
|
+
// square roots of the 9th to the 16th prime number (23 to 53).
|
|
2161
|
+
// This differs from plain SHA-256, where the first eight prime
|
|
2162
|
+
// numbers (2 to 19) are used, thereby preventing trivial hash
|
|
2163
|
+
// collisions between small and large objects.
|
|
2164
|
+
//
|
|
2165
|
+
// 4. The hash of the full blob can then be obtained by
|
|
2166
|
+
// concatenating the outputs of the block cipher:
|
|
2167
|
+
//
|
|
2168
|
+
// Hash(blob) = a || b || c || d || e || f || g || h
|
|
2169
|
+
//
|
|
2170
|
+
// Addition of the original values of H, as normally done
|
|
2171
|
+
// through the use of the Davies-Meyer structure, is not
|
|
2172
|
+
// performed. This isn't necessary, as the block cipher is only
|
|
2173
|
+
// invoked once.
|
|
2174
|
+
//
|
|
2175
|
+
// Test vectors of this digest function can be found in the
|
|
2176
|
+
// accompanying sha256tree_test_vectors.txt file.
|
|
2177
|
+
SHA256TREE = 8;
|
|
2178
|
+
|
|
2179
|
+
// The BLAKE3 hash function.
|
|
2180
|
+
// See https://github.com/BLAKE3-team/BLAKE3.
|
|
2181
|
+
BLAKE3 = 9;
|
|
2182
|
+
|
|
2183
|
+
// Identical to SHA1, except that "blob ${sizeBytes}\0" is prepended to
|
|
2184
|
+
// the blob's contents before hashing, where ${sizeBytes} corresponds to
|
|
2185
|
+
// the decimal size of the original blob. This allows hashes of files to
|
|
2186
|
+
// be converted from and to the ones used by the Git version control
|
|
2187
|
+
// system.
|
|
2188
|
+
GITSHA1 = 10;
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
// The chunking function is used to split a blob into chunks.
|
|
2193
|
+
//
|
|
2194
|
+
// The server advertises support for a chunking function by setting the
|
|
2195
|
+
// corresponding params field in
|
|
2196
|
+
// [CacheCapabilities][build.bazel.remote.execution.v2.CacheCapabilities].
|
|
2197
|
+
// For example, if fast_cdc_2020_params is set, the server supports FAST_CDC_2020.
|
|
2198
|
+
//
|
|
2199
|
+
// For optimal deduplication, clients SHOULD use an advertised chunking function.
|
|
2200
|
+
// When clients use UNKNOWN, the server chooses an algorithm for SplitBlob and
|
|
2201
|
+
// simply verifies chunk concatenation for SpliceBlob.
|
|
2202
|
+
message ChunkingFunction {
|
|
2203
|
+
enum Value {
|
|
2204
|
+
// No specific algorithm. Servers MUST always accept this value.
|
|
2205
|
+
// For SplitBlob, the server chooses the algorithm. For SpliceBlob, the
|
|
2206
|
+
// server only verifies that chunks concatenate to form the expected blob.
|
|
2207
|
+
UNKNOWN = 0;
|
|
2208
|
+
|
|
2209
|
+
// The FastCDC chunking algorithm as described in the 2020 paper by
|
|
2210
|
+
// Wen Xia, et al. See https://ieeexplore.ieee.org/document/9055082
|
|
2211
|
+
// for details.
|
|
2212
|
+
FAST_CDC_2020 = 1;
|
|
2213
|
+
|
|
2214
|
+
// The RepMaxCDC chunking algorithm as implemented by buildbarn/go-cdc.
|
|
2215
|
+
// See https://github.com/buildbarn/go-cdc for details.
|
|
2216
|
+
REP_MAX_CDC = 2;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
// Describes the server/instance capabilities for updating the action cache.
|
|
2221
|
+
message ActionCacheUpdateCapabilities {
|
|
2222
|
+
bool update_enabled = 1;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
// Allowed values for priority in
|
|
2226
|
+
// [ResultsCachePolicy][build.bazel.remote.execution.v2.ResultsCachePolicy] and
|
|
2227
|
+
// [ExecutionPolicy][build.bazel.remote.execution.v2.ExecutionPolicy]
|
|
2228
|
+
// Used for querying both cache and execution valid priority ranges.
|
|
2229
|
+
message PriorityCapabilities {
|
|
2230
|
+
// Supported range of priorities, including boundaries.
|
|
2231
|
+
message PriorityRange {
|
|
2232
|
+
// The minimum numeric value for this priority range, which represents the
|
|
2233
|
+
// most urgent task or longest retained item.
|
|
2234
|
+
int32 min_priority = 1;
|
|
2235
|
+
// The maximum numeric value for this priority range, which represents the
|
|
2236
|
+
// least urgent task or shortest retained item.
|
|
2237
|
+
int32 max_priority = 2;
|
|
2238
|
+
}
|
|
2239
|
+
repeated PriorityRange priorities = 1;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
// Describes how the server treats absolute symlink targets.
|
|
2243
|
+
message SymlinkAbsolutePathStrategy {
|
|
2244
|
+
enum Value {
|
|
2245
|
+
// Invalid value.
|
|
2246
|
+
UNKNOWN = 0;
|
|
2247
|
+
|
|
2248
|
+
// Server will return an `INVALID_ARGUMENT` on input symlinks with absolute
|
|
2249
|
+
// targets.
|
|
2250
|
+
// If an action tries to create an output symlink with an absolute target, a
|
|
2251
|
+
// `FAILED_PRECONDITION` will be returned.
|
|
2252
|
+
DISALLOWED = 1;
|
|
2253
|
+
|
|
2254
|
+
// Server will allow symlink targets to escape the input root tree, possibly
|
|
2255
|
+
// resulting in non-hermetic builds.
|
|
2256
|
+
ALLOWED = 2;
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
// Compression formats which may be supported.
|
|
2261
|
+
message Compressor {
|
|
2262
|
+
enum Value {
|
|
2263
|
+
// No compression. Servers and clients MUST always support this, and do
|
|
2264
|
+
// not need to advertise it.
|
|
2265
|
+
IDENTITY = 0;
|
|
2266
|
+
|
|
2267
|
+
// Zstandard compression.
|
|
2268
|
+
ZSTD = 1;
|
|
2269
|
+
|
|
2270
|
+
// RFC 1951 Deflate. This format is identical to what is used by ZIP
|
|
2271
|
+
// files. Headers such as the one generated by gzip are not
|
|
2272
|
+
// included.
|
|
2273
|
+
//
|
|
2274
|
+
// It is advised to use algorithms such as Zstandard instead, as
|
|
2275
|
+
// those are faster and/or provide a better compression ratio.
|
|
2276
|
+
DEFLATE = 2;
|
|
2277
|
+
|
|
2278
|
+
// Brotli compression.
|
|
2279
|
+
BROTLI = 3;
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
// Capabilities of the remote cache system.
|
|
2284
|
+
message CacheCapabilities {
|
|
2285
|
+
// All the digest functions supported by the remote cache.
|
|
2286
|
+
// Remote cache may support multiple digest functions simultaneously.
|
|
2287
|
+
repeated DigestFunction.Value digest_functions = 1;
|
|
2288
|
+
|
|
2289
|
+
// Capabilities for updating the action cache.
|
|
2290
|
+
ActionCacheUpdateCapabilities action_cache_update_capabilities = 2;
|
|
2291
|
+
|
|
2292
|
+
// Supported cache priority range for both CAS and ActionCache.
|
|
2293
|
+
PriorityCapabilities cache_priority_capabilities = 3;
|
|
2294
|
+
|
|
2295
|
+
// Maximum total size of blobs to be uploaded/downloaded using
|
|
2296
|
+
// batch methods. A value of 0 means no limit is set, although
|
|
2297
|
+
// in practice there will always be a message size limitation
|
|
2298
|
+
// of the protocol in use, e.g. GRPC.
|
|
2299
|
+
int64 max_batch_total_size_bytes = 4;
|
|
2300
|
+
|
|
2301
|
+
// Whether absolute symlink targets are supported.
|
|
2302
|
+
SymlinkAbsolutePathStrategy.Value symlink_absolute_path_strategy = 5;
|
|
2303
|
+
|
|
2304
|
+
// Compressors supported by the "compressed-blobs" bytestream resources.
|
|
2305
|
+
// Servers MUST support identity/no-compression, even if it is not listed
|
|
2306
|
+
// here.
|
|
2307
|
+
//
|
|
2308
|
+
// Note that this does not imply which if any compressors are supported by
|
|
2309
|
+
// the server at the gRPC level.
|
|
2310
|
+
repeated Compressor.Value supported_compressors = 6;
|
|
2311
|
+
|
|
2312
|
+
// Compressors supported for inlined data in
|
|
2313
|
+
// [BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs]
|
|
2314
|
+
// requests.
|
|
2315
|
+
repeated Compressor.Value supported_batch_update_compressors = 7;
|
|
2316
|
+
|
|
2317
|
+
// The maximum blob size that the server will accept for CAS blob uploads.
|
|
2318
|
+
// - If it is 0, it means there is no limit set. A client may assume
|
|
2319
|
+
// arbitrarily large blobs may be uploaded to and downloaded from the cache.
|
|
2320
|
+
// - If it is larger than 0, implementations SHOULD NOT attempt to upload
|
|
2321
|
+
// blobs with size larger than the limit. Servers SHOULD reject blob
|
|
2322
|
+
// uploads over the `max_cas_blob_size_bytes` limit with response code
|
|
2323
|
+
// `INVALID_ARGUMENT`
|
|
2324
|
+
// - If the cache implementation returns a given limit, it MAY still serve
|
|
2325
|
+
// blobs larger than this limit.
|
|
2326
|
+
int64 max_cas_blob_size_bytes = 8;
|
|
2327
|
+
|
|
2328
|
+
// Whether blob splitting is supported for the particular server/instance. If
|
|
2329
|
+
// yes, the server/instance implements the specified behavior for blob
|
|
2330
|
+
// splitting and a meaningful result can be expected from the
|
|
2331
|
+
// [ContentAddressableStorage.SplitBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SplitBlob]
|
|
2332
|
+
// operation.
|
|
2333
|
+
bool split_blob_support = 9;
|
|
2334
|
+
|
|
2335
|
+
// Whether blob splicing is supported for the particular server/instance. If
|
|
2336
|
+
// yes, the server/instance implements the specified behavior for blob
|
|
2337
|
+
// splicing and a meaningful result can be expected from the
|
|
2338
|
+
// [ContentAddressableStorage.SpliceBlob][build.bazel.remote.execution.v2.ContentAddressableStorage.SpliceBlob]
|
|
2339
|
+
// operation.
|
|
2340
|
+
bool splice_blob_support = 10;
|
|
2341
|
+
|
|
2342
|
+
// The parameters for the FastCDC 2020 chunking algorithm.
|
|
2343
|
+
// If set, the server supports the FastCDC chunking algorithm.
|
|
2344
|
+
FastCdc2020Params fast_cdc_2020_params = 11;
|
|
2345
|
+
|
|
2346
|
+
// The parameters for the RepMaxCDC chunking algorithm.
|
|
2347
|
+
// If set, the server supports the RepMaxCDC chunking algorithm.
|
|
2348
|
+
RepMaxCdcParams rep_max_cdc_params = 12;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
// Parameters for the FastCDC content-defined chunking algorithm.
|
|
2352
|
+
//
|
|
2353
|
+
// Implementations MUST follow the FastCDC 2020 paper by Wen Xia, et al.:
|
|
2354
|
+
// https://ieeexplore.ieee.org/document/9055082
|
|
2355
|
+
//
|
|
2356
|
+
// Supported implementations:
|
|
2357
|
+
// - Rust: https://docs.rs/fastcdc/3.2.1/fastcdc/v2020/index.html
|
|
2358
|
+
// - Go: https://github.com/buildbuddy-io/fastcdc2020
|
|
2359
|
+
//
|
|
2360
|
+
// Test vectors can be found in the accompanying fastcdc2020_test_vectors.txt file.
|
|
2361
|
+
//
|
|
2362
|
+
// Implementations MUST use normalization level 2, which has been found
|
|
2363
|
+
// successful for build artifacts with an average chunk size of 512 KiB.
|
|
2364
|
+
//
|
|
2365
|
+
// Key algorithm components from the paper:
|
|
2366
|
+
//
|
|
2367
|
+
// GEAR table: 256 64-bit integers for the rolling hash, computed as:
|
|
2368
|
+
// GEAR[i] = high_64_bits(MD5(byte(i))) for i in 0..255
|
|
2369
|
+
//
|
|
2370
|
+
// MASKS table: Bit patterns for chunk boundary detection, derived from
|
|
2371
|
+
// the C reference implementation. The mask selection based on average
|
|
2372
|
+
// chunk size SHOULD match the paper.
|
|
2373
|
+
//
|
|
2374
|
+
// The minimum and maximum chunk sizes MUST be derived from the average:
|
|
2375
|
+
// - min_chunk_size = avg_chunk_size_bytes / 4
|
|
2376
|
+
// - max_chunk_size = avg_chunk_size_bytes * 4
|
|
2377
|
+
//
|
|
2378
|
+
// Blobs smaller than max_chunk_size (avg_chunk_size_bytes * 4) SHOULD be
|
|
2379
|
+
// uploaded without chunking.
|
|
2380
|
+
//
|
|
2381
|
+
// If any of the advertised parameters are not within the expected range,
|
|
2382
|
+
// the client SHOULD ignore FastCDC chunking function support.
|
|
2383
|
+
message FastCdc2020Params {
|
|
2384
|
+
// The average (expected) chunk size for the FastCDC chunking algorithm.
|
|
2385
|
+
// The value MUST be between 1 KiB and 1 MiB. The recommended value is
|
|
2386
|
+
// 524288 (512 KiB).
|
|
2387
|
+
uint64 avg_chunk_size_bytes = 1;
|
|
2388
|
+
|
|
2389
|
+
// The seed for the FastCDC mask generation.
|
|
2390
|
+
// The recommended value is 0.
|
|
2391
|
+
//
|
|
2392
|
+
// All clients sharing a cache SHOULD use the same seed to maximize
|
|
2393
|
+
// chunk reuse.
|
|
2394
|
+
uint32 seed = 2;
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
// Parameters for the RepMaxCDC content-defined chunking algorithm.
|
|
2398
|
+
//
|
|
2399
|
+
// Supported implementations:
|
|
2400
|
+
// - Go: https://github.com/buildbarn/go-cdc
|
|
2401
|
+
//
|
|
2402
|
+
// Key algorithm components:
|
|
2403
|
+
//
|
|
2404
|
+
// GEAR table: 256 64-bit integers for the rolling hash, computed as:
|
|
2405
|
+
// GEAR[i] = high_64_bits(MD5(byte(i))) for i in 0..255
|
|
2406
|
+
//
|
|
2407
|
+
// The algorithm repeatedly applies chunking until all chunks are in the
|
|
2408
|
+
// range [min_chunk_size_bytes, 2*min_chunk_size_bytes). Cutting points are
|
|
2409
|
+
// selected where the Gear rolling hash is maximized within a lookahead
|
|
2410
|
+
// window of horizon_size_bytes.
|
|
2411
|
+
//
|
|
2412
|
+
// For sufficiently large files, the average chunk size prior to
|
|
2413
|
+
// deduplication will approximately be min_chunk_size_bytes divided by
|
|
2414
|
+
// Rényi's parking constant (0.7475979203...). More details:
|
|
2415
|
+
// https://mathworld.wolfram.com/RenyisParkingConstants.html
|
|
2416
|
+
//
|
|
2417
|
+
// If any of the advertised parameters are not within the expected range,
|
|
2418
|
+
// the client SHOULD ignore RepMaxCDC chunking function support.
|
|
2419
|
+
message RepMaxCdcParams {
|
|
2420
|
+
// The minimum chunk size for the RepMaxCDC chunking algorithm.
|
|
2421
|
+
// The value MUST be at least 64 bytes (the Gear hash window size).
|
|
2422
|
+
// All chunks will be in the range [min_chunk_size_bytes, 2*min_chunk_size_bytes).
|
|
2423
|
+
// The recommended value is 262144 (256 KiB).
|
|
2424
|
+
uint64 min_chunk_size_bytes = 1;
|
|
2425
|
+
|
|
2426
|
+
// The lookahead window for finding optimal cutting points.
|
|
2427
|
+
// Larger values improve deduplication quality with diminishing returns.
|
|
2428
|
+
// Setting to 0 produces uniform chunks of min_chunk_size_bytes.
|
|
2429
|
+
// The recommended value is 8 * min_chunk_size_bytes.
|
|
2430
|
+
uint64 horizon_size_bytes = 2;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
// Capabilities of the remote execution system.
|
|
2434
|
+
message ExecutionCapabilities {
|
|
2435
|
+
// Legacy field for indicating which digest function is supported by the
|
|
2436
|
+
// remote execution system. It MUST be set to a value other than UNKNOWN.
|
|
2437
|
+
// Implementations should consider the repeated digest_functions field
|
|
2438
|
+
// first, falling back to this singular field if digest_functions is unset.
|
|
2439
|
+
DigestFunction.Value digest_function = 1;
|
|
2440
|
+
|
|
2441
|
+
// Whether remote execution is enabled for the particular server/instance.
|
|
2442
|
+
bool exec_enabled = 2;
|
|
2443
|
+
|
|
2444
|
+
// Supported execution priority range.
|
|
2445
|
+
PriorityCapabilities execution_priority_capabilities = 3;
|
|
2446
|
+
|
|
2447
|
+
// Supported node properties.
|
|
2448
|
+
repeated string supported_node_properties = 4;
|
|
2449
|
+
|
|
2450
|
+
// All the digest functions supported by the remote execution system.
|
|
2451
|
+
// If this field is set, it MUST also contain digest_function.
|
|
2452
|
+
//
|
|
2453
|
+
// Even if the remote execution system announces support for multiple
|
|
2454
|
+
// digest functions, individual execution requests may only reference
|
|
2455
|
+
// CAS objects using a single digest function. For example, it is not
|
|
2456
|
+
// permitted to execute actions having both MD5 and SHA-256 hashed
|
|
2457
|
+
// files in their input root.
|
|
2458
|
+
//
|
|
2459
|
+
// The CAS objects referenced by action results generated by the
|
|
2460
|
+
// remote execution system MUST use the same digest function as the
|
|
2461
|
+
// one used to construct the action.
|
|
2462
|
+
repeated DigestFunction.Value digest_functions = 5;
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
// Details for the tool used to call the API.
|
|
2466
|
+
message ToolDetails {
|
|
2467
|
+
// Name of the tool, e.g. bazel.
|
|
2468
|
+
string tool_name = 1;
|
|
2469
|
+
|
|
2470
|
+
// Version of the tool used for the request, e.g. 5.0.3.
|
|
2471
|
+
string tool_version = 2;
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
// An optional Metadata to attach to any RPC request to tell the server about an
|
|
2475
|
+
// external context of the request. The server may use this for logging or other
|
|
2476
|
+
// purposes. To use it, the client attaches the header to the call using the
|
|
2477
|
+
// canonical proto serialization:
|
|
2478
|
+
//
|
|
2479
|
+
// * name: `build.bazel.remote.execution.v2.requestmetadata-bin`
|
|
2480
|
+
// * contents: the base64 encoded binary `RequestMetadata` message.
|
|
2481
|
+
// Note: the gRPC library serializes binary headers encoded in base64 by
|
|
2482
|
+
// default (https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests).
|
|
2483
|
+
// Therefore, if the gRPC library is used to pass/retrieve this
|
|
2484
|
+
// metadata, the user may ignore the base64 encoding and assume it is simply
|
|
2485
|
+
// serialized as a binary message.
|
|
2486
|
+
message RequestMetadata {
|
|
2487
|
+
// The details for the tool invoking the requests.
|
|
2488
|
+
ToolDetails tool_details = 1;
|
|
2489
|
+
|
|
2490
|
+
// An identifier that ties multiple requests to the same action.
|
|
2491
|
+
// For example, multiple requests to the CAS, Action Cache, and Execution
|
|
2492
|
+
// API are used in order to compile foo.cc.
|
|
2493
|
+
string action_id = 2;
|
|
2494
|
+
|
|
2495
|
+
// An identifier that ties multiple actions together to a final result.
|
|
2496
|
+
// For example, multiple actions are required to build and run foo_test.
|
|
2497
|
+
string tool_invocation_id = 3;
|
|
2498
|
+
|
|
2499
|
+
// An identifier to tie multiple tool invocations together. For example,
|
|
2500
|
+
// runs of foo_test, bar_test and baz_test on a post-submit of a given patch.
|
|
2501
|
+
string correlated_invocations_id = 4;
|
|
2502
|
+
|
|
2503
|
+
// A brief description of the kind of action, for example, CppCompile or GoLink.
|
|
2504
|
+
// There is no standard agreed set of values for this, and they are expected to vary between different client tools.
|
|
2505
|
+
string action_mnemonic = 5;
|
|
2506
|
+
|
|
2507
|
+
// An identifier for the target which produced this action.
|
|
2508
|
+
// No guarantees are made around how many actions may relate to a single target.
|
|
2509
|
+
string target_id = 6;
|
|
2510
|
+
|
|
2511
|
+
// An identifier for the configuration in which the target was built,
|
|
2512
|
+
// e.g. for differentiating building host tools or different target platforms.
|
|
2513
|
+
// There is no expectation that this value will have any particular structure,
|
|
2514
|
+
// or equality across invocations, though some client tools may offer these guarantees.
|
|
2515
|
+
string configuration_id = 7;
|
|
2516
|
+
}
|