@@ -19,8 +19,10 @@ package build.bazel.remote.execution.v2;
19
19
import "build/bazel/semver/semver.proto" ;
20
20
import "google/api/annotations.proto" ;
21
21
import "google/longrunning/operations.proto" ;
22
+ import "google/protobuf/any.proto" ;
22
23
import "google/protobuf/duration.proto" ;
23
24
import "google/protobuf/timestamp.proto" ;
25
+ import "google/protobuf/wrappers.proto" ;
24
26
import "google/rpc/status.proto" ;
25
27
26
28
option csharp_namespace = "Build.Bazel.Remote.Execution.V2" ;
@@ -103,6 +105,11 @@ service Execution {
103
105
// where, for each requested blob not present in the CAS, there is a
104
106
// `Violation` with a `type` of `MISSING` and a `subject` of
105
107
// `"blobs/{hash}/{size}"` indicating the digest of the missing blob.
108
+ //
109
+ // The server does not need to guarantee that a call to this method leads to
110
+ // at most one execution of the action. The server MAY execute the action
111
+ // multiple times, potentially in parallel. These redundant executions MAY
112
+ // continue to run, even if the operation is completed.
106
113
rpc Execute (ExecuteRequest ) returns (stream google .longrunning .Operation ) {
107
114
option (google.api.http ) = { post : "/v2/{instance_name=**}/actions:execute" body: "*" };
108
115
}
@@ -141,7 +148,7 @@ service ActionCache {
141
148
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
142
149
// are available at the time of returning the
143
150
// [ActionResult][build.bazel.remote.execution.v2.ActionResult] and will be
144
- // for some period of time afterwards. The TTLs of the referenced blobs SHOULD be increased
151
+ // for some period of time afterwards. The lifetimes of the referenced blobs SHOULD be increased
145
152
// if necessary and applicable.
146
153
//
147
154
// Errors:
@@ -160,6 +167,9 @@ service ActionCache {
160
167
// [Command][build.bazel.remote.execution.v2.Command], into the
161
168
// `ContentAddressableStorage`.
162
169
//
170
+ // Server implementations MAY modify the
171
+ // `UpdateActionResultRequest.action_result` and return an equivalent value.
172
+ //
163
173
// Errors:
164
174
//
165
175
// * `INVALID_ARGUMENT`: One or more arguments are invalid.
@@ -236,6 +246,10 @@ service ActionCache {
236
246
// used in subsequent calls (e.g. to
237
247
// [Execute][build.bazel.remote.execution.v2.Execution.Execute]).
238
248
//
249
+ // Servers MUST behave as though empty blobs are always available, even if they
250
+ // have not been uploaded. Clients MAY optimize away the uploading or
251
+ // downloading of empty blobs.
252
+ //
239
253
// As with other services in the Remote Execution API, any call may return an
240
254
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
241
255
// information about when the client should retry the request; clients SHOULD
@@ -246,6 +260,9 @@ service ContentAddressableStorage {
246
260
// Clients can use this API before uploading blobs to determine which ones are
247
261
// already present in the CAS and do not need to be uploaded again.
248
262
//
263
+ // Servers SHOULD increase the lifetimes of the referenced blobs if necessary and
264
+ // applicable.
265
+ //
249
266
// There are no method-specific errors.
250
267
rpc FindMissingBlobs (FindMissingBlobsRequest ) returns (FindMissingBlobsResponse ) {
251
268
option (google.api.http ) = { post : "/v2/{instance_name=**}/blobs:findMissing" body: "*" };
@@ -413,15 +430,25 @@ message Action {
413
430
// requests for the same `Action` may not be merged.
414
431
bool do_not_cache = 7 ;
415
432
416
- // List of required supported [NodeProperty][build.bazel.remote.execution.v2.NodeProperty]
417
- // keys. In order to ensure that equivalent `Action`s always hash to the same
418
- // value, the supported node properties MUST be lexicographically sorted by name.
419
- // Sorting of strings is done by code point, equivalently, by the UTF-8 bytes.
420
- //
421
- // The interpretation of these properties is server-dependent. If a property is
422
- // not recognized by the server, the server will return an `INVALID_ARGUMENT`
423
- // error.
424
- repeated string output_node_properties = 8 ;
433
+ reserved 8 ; // Used for field moved to [Command][build.bazel.remote.execution.v2.Command].
434
+
435
+ // An optional additional salt value used to place this `Action` into a
436
+ // separate cache namespace from other instances having the same field
437
+ // contents. This salt typically comes from operational configuration
438
+ // specific to sources such as repo and service configuration,
439
+ // and allows disowning an entire set of ActionResults that might have been
440
+ // poisoned by buggy software or tool failures.
441
+ bytes salt = 9 ;
442
+
443
+ // The optional platform requirements for the execution environment. The
444
+ // server MAY choose to execute the action on any worker satisfying the
445
+ // requirements, so the client SHOULD ensure that running the action on any
446
+ // such worker will have the same result. A detailed lexicon for this can be
447
+ // found in the accompanying platform.md.
448
+ // New in version 2.2: clients SHOULD set these platform properties as well
449
+ // as those in the [Command][build.bazel.remote.execution.v2.Command]. Servers
450
+ // SHOULD prefer those set here.
451
+ Platform platform = 10 ;
425
452
}
426
453
427
454
// A `Command` is the actual command executed by a worker running an
@@ -546,14 +573,30 @@ message Command {
546
573
// The platform requirements for the execution environment. The server MAY
547
574
// choose to execute the action on any worker satisfying the requirements, so
548
575
// the client SHOULD ensure that running the action on any such worker will
549
- // have the same result.
550
- // A detailed lexicon for this can be found in the accompanying platform.md.
576
+ // have the same result. A detailed lexicon for this can be found in the
577
+ // accompanying platform.md.
578
+ // DEPRECATED as of v2.2: platform properties are now specified directly in
579
+ // the action. See documentation note in the
580
+ // [Action][build.bazel.remote.execution.v2.Action] for migration.
551
581
Platform platform = 5 ;
552
582
553
583
// The working directory, relative to the input root, for the command to run
554
584
// in. It must be a directory which exists in the input tree. If it is left
555
585
// empty, then the action is run in the input root.
556
586
string working_directory = 6 ;
587
+
588
+ // A list of keys for node properties the client expects to retrieve for
589
+ // output files and directories. Keys are either names of string-based
590
+ // [NodeProperty][build.bazel.remote.execution.v2.NodeProperty] or
591
+ // names of fields in [NodeProperties][build.bazel.remote.execution.v2.NodeProperties].
592
+ // In order to ensure that equivalent `Action`s always hash to the same
593
+ // value, the node properties MUST be lexicographically sorted by name.
594
+ // Sorting of strings is done by code point, equivalently, by the UTF-8 bytes.
595
+ //
596
+ // The interpretation of string-based properties is server-dependent. If a
597
+ // property is not recognized by the server, the server will return an
598
+ // `INVALID_ARGUMENT`.
599
+ repeated string output_node_properties = 8 ;
557
600
}
558
601
559
602
// A `Platform` is a set of requirements, such as hardware, operating system, or
@@ -579,6 +622,11 @@ message Platform {
579
622
// The server MAY use the `value` of one or more properties to determine how
580
623
// it sets up the execution environment, such as by making specific system
581
624
// files available to the worker.
625
+ //
626
+ // Both names and values are typically case-sensitive. Note that the platform
627
+ // is implicitly part of the action digest, so even tiny changes in the names
628
+ // or values (like changing case) may result in different action cache
629
+ // entries.
582
630
message Property {
583
631
// The property name.
584
632
string name = 1 ;
@@ -681,7 +729,8 @@ message Directory {
681
729
repeated SymlinkNode symlinks = 3 ;
682
730
683
731
// The node properties of the Directory.
684
- repeated NodeProperty node_properties = 4 ;
732
+ reserved 4 ;
733
+ NodeProperties node_properties = 5 ;
685
734
}
686
735
687
736
// A single property for [FileNodes][build.bazel.remote.execution.v2.FileNode],
@@ -697,6 +746,23 @@ message NodeProperty {
697
746
string value = 2 ;
698
747
}
699
748
749
+ // Node properties for [FileNodes][build.bazel.remote.execution.v2.FileNode],
750
+ // [DirectoryNodes][build.bazel.remote.execution.v2.DirectoryNode], and
751
+ // [SymlinkNodes][build.bazel.remote.execution.v2.SymlinkNode]. The server is
752
+ // responsible for specifying the properties that it accepts.
753
+ //
754
+ message NodeProperties {
755
+ // A list of string-based
756
+ // [NodeProperties][build.bazel.remote.execution.v2.NodeProperty].
757
+ repeated NodeProperty properties = 1 ;
758
+
759
+ // The file's last modification timestamp.
760
+ google.protobuf.Timestamp mtime = 2 ;
761
+
762
+ // The UNIX file mode, e.g., 0755.
763
+ google.protobuf.UInt32Value unix_mode = 3 ;
764
+ }
765
+
700
766
// A `FileNode` represents a single file and associated metadata.
701
767
message FileNode {
702
768
// The name of the file.
@@ -711,7 +777,8 @@ message FileNode {
711
777
bool is_executable = 4 ;
712
778
713
779
// The node properties of the FileNode.
714
- repeated NodeProperty node_properties = 5 ;
780
+ reserved 5 ;
781
+ NodeProperties node_properties = 6 ;
715
782
}
716
783
717
784
// A `DirectoryNode` represents a child of a
@@ -737,12 +804,16 @@ message SymlinkNode {
737
804
// The target path can be relative to the parent directory of the symlink or
738
805
// it can be an absolute path starting with `/`. Support for absolute paths
739
806
// can be checked using the [Capabilities][build.bazel.remote.execution.v2.Capabilities]
740
- // API. The canonical form forbids the substrings `/./` and `//` in the target
741
- // path. `..` components are allowed anywhere in the target path.
807
+ // API. `..` components are allowed anywhere in the target path as logical
808
+ // canonicalization may lead to different behavior in the presence of
809
+ // directory symlinks (e.g. `foo/../bar` may not be the same as `bar`).
810
+ // To reduce potential cache misses, canonicalization is still recommended
811
+ // where this is possible without impacting correctness.
742
812
string target = 2 ;
743
813
744
814
// The node properties of the SymlinkNode.
745
- repeated NodeProperty node_properties = 3 ;
815
+ reserved 3 ;
816
+ NodeProperties node_properties = 4 ;
746
817
}
747
818
748
819
// A content digest. A digest for a given blob consists of the size of the blob
@@ -816,10 +887,20 @@ message ExecutedActionMetadata {
816
887
817
888
// When the worker finished uploading action outputs.
818
889
google.protobuf.Timestamp output_upload_completed_timestamp = 10 ;
890
+
891
+ // Details that are specific to the kind of worker used. For example,
892
+ // on POSIX-like systems this could contain a message with
893
+ // getrusage(2) statistics.
894
+ repeated google.protobuf.Any auxiliary_metadata = 11 ;
819
895
}
820
896
821
897
// An ActionResult represents the result of an
822
898
// [Action][build.bazel.remote.execution.v2.Action] being run.
899
+ //
900
+ // It is advised that at least one field (for example
901
+ // `ActionResult.execution_metadata.Worker`) have a non-default value, to
902
+ // ensure that the serialized value is non-empty, which can then be used
903
+ // as a basic data sanity check.
823
904
message ActionResult {
824
905
reserved 1 ; // Reserved for use as the resource name.
825
906
@@ -1013,7 +1094,8 @@ message OutputFile {
1013
1094
bytes contents = 5 ;
1014
1095
1015
1096
// The supported node properties of the OutputFile, if requested by the Action.
1016
- repeated NodeProperty node_properties = 6 ;
1097
+ reserved 6 ;
1098
+ NodeProperties node_properties = 7 ;
1017
1099
}
1018
1100
1019
1101
// A `Tree` contains all the
@@ -1062,13 +1144,13 @@ message OutputSymlink {
1062
1144
// The target path can be relative to the parent directory of the symlink or
1063
1145
// it can be an absolute path starting with `/`. Support for absolute paths
1064
1146
// can be checked using the [Capabilities][build.bazel.remote.execution.v2.Capabilities]
1065
- // API. The canonical form forbids the substrings `/./` and `//` in the target
1066
- // path. `..` components are allowed anywhere in the target path.
1147
+ // API. `..` components are allowed anywhere in the target path.
1067
1148
string target = 2 ;
1068
1149
1069
1150
// The supported node properties of the OutputSymlink, if requested by the
1070
1151
// Action.
1071
- repeated NodeProperty node_properties = 3 ;
1152
+ reserved 3 ;
1153
+ NodeProperties node_properties = 4 ;
1072
1154
}
1073
1155
1074
1156
// An `ExecutionPolicy` can be used to control the scheduling of the action.
@@ -1224,14 +1306,14 @@ message ExecuteOperationMetadata {
1224
1306
// being executed.
1225
1307
Digest action_digest = 2 ;
1226
1308
1227
- // If set, the client can use this name with
1309
+ // If set, the client can use this resource name with
1228
1310
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
1229
- // standard output.
1311
+ // standard output from the endpoint hosting streamed responses .
1230
1312
string stdout_stream_name = 3 ;
1231
1313
1232
- // If set, the client can use this name with
1314
+ // If set, the client can use this resource name with
1233
1315
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
1234
- // standard error.
1316
+ // standard error from the endpoint hosting streamed responses .
1235
1317
string stderr_stream_name = 4 ;
1236
1318
}
1237
1319
@@ -1266,7 +1348,8 @@ message GetActionResultRequest {
1266
1348
bool inline_stderr = 4 ;
1267
1349
1268
1350
// A hint to the server to inline the contents of the listed output files.
1269
- // Each path needs to exactly match one path in `output_files` in the
1351
+ // Each path needs to exactly match one file path in either `output_paths` or
1352
+ // `output_files` (DEPRECATED since v2.1) in the
1270
1353
// [Command][build.bazel.remote.execution.v2.Command] message.
1271
1354
repeated string inline_output_files = 5 ;
1272
1355
}
@@ -1485,6 +1568,11 @@ message DigestFunction {
1485
1568
1486
1569
// The SHA-512 digest function.
1487
1570
SHA512 = 6 ;
1571
+
1572
+ // Murmur3 128-bit digest function, x64 variant. Note that this is not a
1573
+ // cryptographic hash function and its collision properties are not strongly guaranteed.
1574
+ // See https://github.com/aappleby/smhasher/wiki/MurmurHash3 .
1575
+ MURMUR3 = 7 ;
1488
1576
}
1489
1577
}
1490
1578
@@ -1494,12 +1582,17 @@ message ActionCacheUpdateCapabilities {
1494
1582
}
1495
1583
1496
1584
// Allowed values for priority in
1497
- // [ResultsCachePolicy][google.devtools.remoteexecution.v2.ResultsCachePolicy]
1585
+ // [ResultsCachePolicy][build.bazel.remoteexecution.v2.ResultsCachePolicy] and
1586
+ // [ExecutionPolicy][build.bazel.remoteexecution.v2.ResultsCachePolicy]
1498
1587
// Used for querying both cache and execution valid priority ranges.
1499
1588
message PriorityCapabilities {
1500
1589
// Supported range of priorities, including boundaries.
1501
1590
message PriorityRange {
1591
+ // The minimum numeric value for this priority range, which represents the
1592
+ // most urgent task or longest retained item.
1502
1593
int32 min_priority = 1 ;
1594
+ // The maximum numeric value for this priority range, which represents the
1595
+ // least urgent task or shortest retained item.
1503
1596
int32 max_priority = 2 ;
1504
1597
}
1505
1598
repeated PriorityRange priorities = 1 ;
@@ -1597,4 +1690,18 @@ message RequestMetadata {
1597
1690
// An identifier to tie multiple tool invocations together. For example,
1598
1691
// runs of foo_test, bar_test and baz_test on a post-submit of a given patch.
1599
1692
string correlated_invocations_id = 4 ;
1693
+
1694
+ // A brief description of the kind of action, for example, CppCompile or GoLink.
1695
+ // There is no standard agreed set of values for this, and they are expected to vary between different client tools.
1696
+ string action_mnemonic = 5 ;
1697
+
1698
+ // An identifier for the target which produced this action.
1699
+ // No guarantees are made around how many actions may relate to a single target.
1700
+ string target_id = 6 ;
1701
+
1702
+ // An identifier for the configuration in which the target was built,
1703
+ // e.g. for differentiating building host tools or different target platforms.
1704
+ // There is no expectation that this value will have any particular structure,
1705
+ // or equality across invocations, though some client tools may offer these guarantees.
1706
+ string configuration_id = 7 ;
1600
1707
}
0 commit comments