Skip to content

Commit 1fcb18a

Browse files
illicitonionphilwo
authored andcommitted
Update to latest remote-execution proto
Partial commit for third_party/*, see #13133. Signed-off-by: Philipp Wollermann <[email protected]>
1 parent 57672ac commit 1fcb18a

File tree

2 files changed

+136
-27
lines changed

2 files changed

+136
-27
lines changed

third_party/remoteapis/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ proto_library(
5454
srcs = ["build/bazel/remote/execution/v2/remote_execution.proto"],
5555
deps = [
5656
":build_bazel_semver_semver_proto",
57+
"@com_google_protobuf//:any_proto",
5758
"@com_google_protobuf//:duration_proto",
5859
"@com_google_protobuf//:timestamp_proto",
60+
"@com_google_protobuf//:wrappers_proto",
5961
"@googleapis//:google_api_annotations_proto",
6062
"@googleapis//:google_api_http_proto",
6163
"@googleapis//:google_longrunning_operations_proto",

third_party/remoteapis/build/bazel/remote/execution/v2/remote_execution.proto

Lines changed: 134 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ package build.bazel.remote.execution.v2;
1919
import "build/bazel/semver/semver.proto";
2020
import "google/api/annotations.proto";
2121
import "google/longrunning/operations.proto";
22+
import "google/protobuf/any.proto";
2223
import "google/protobuf/duration.proto";
2324
import "google/protobuf/timestamp.proto";
25+
import "google/protobuf/wrappers.proto";
2426
import "google/rpc/status.proto";
2527

2628
option csharp_namespace = "Build.Bazel.Remote.Execution.V2";
@@ -103,6 +105,11 @@ service Execution {
103105
// where, for each requested blob not present in the CAS, there is a
104106
// `Violation` with a `type` of `MISSING` and a `subject` of
105107
// `"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.
106113
rpc Execute(ExecuteRequest) returns (stream google.longrunning.Operation) {
107114
option (google.api.http) = { post: "/v2/{instance_name=**}/actions:execute" body: "*" };
108115
}
@@ -141,7 +148,7 @@ service ActionCache {
141148
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
142149
// are available at the time of returning the
143150
// [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
145152
// if necessary and applicable.
146153
//
147154
// Errors:
@@ -160,6 +167,9 @@ service ActionCache {
160167
// [Command][build.bazel.remote.execution.v2.Command], into the
161168
// `ContentAddressableStorage`.
162169
//
170+
// Server implementations MAY modify the
171+
// `UpdateActionResultRequest.action_result` and return an equivalent value.
172+
//
163173
// Errors:
164174
//
165175
// * `INVALID_ARGUMENT`: One or more arguments are invalid.
@@ -236,6 +246,10 @@ service ActionCache {
236246
// used in subsequent calls (e.g. to
237247
// [Execute][build.bazel.remote.execution.v2.Execution.Execute]).
238248
//
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+
//
239253
// As with other services in the Remote Execution API, any call may return an
240254
// error with a [RetryInfo][google.rpc.RetryInfo] error detail providing
241255
// information about when the client should retry the request; clients SHOULD
@@ -246,6 +260,9 @@ service ContentAddressableStorage {
246260
// Clients can use this API before uploading blobs to determine which ones are
247261
// already present in the CAS and do not need to be uploaded again.
248262
//
263+
// Servers SHOULD increase the lifetimes of the referenced blobs if necessary and
264+
// applicable.
265+
//
249266
// There are no method-specific errors.
250267
rpc FindMissingBlobs(FindMissingBlobsRequest) returns (FindMissingBlobsResponse) {
251268
option (google.api.http) = { post: "/v2/{instance_name=**}/blobs:findMissing" body: "*" };
@@ -413,15 +430,25 @@ message Action {
413430
// requests for the same `Action` may not be merged.
414431
bool do_not_cache = 7;
415432

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;
425452
}
426453

427454
// A `Command` is the actual command executed by a worker running an
@@ -546,14 +573,30 @@ message Command {
546573
// The platform requirements for the execution environment. The server MAY
547574
// choose to execute the action on any worker satisfying the requirements, so
548575
// 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.
551581
Platform platform = 5;
552582

553583
// The working directory, relative to the input root, for the command to run
554584
// in. It must be a directory which exists in the input tree. If it is left
555585
// empty, then the action is run in the input root.
556586
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;
557600
}
558601

559602
// A `Platform` is a set of requirements, such as hardware, operating system, or
@@ -579,6 +622,11 @@ message Platform {
579622
// The server MAY use the `value` of one or more properties to determine how
580623
// it sets up the execution environment, such as by making specific system
581624
// 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.
582630
message Property {
583631
// The property name.
584632
string name = 1;
@@ -681,7 +729,8 @@ message Directory {
681729
repeated SymlinkNode symlinks = 3;
682730

683731
// The node properties of the Directory.
684-
repeated NodeProperty node_properties = 4;
732+
reserved 4;
733+
NodeProperties node_properties = 5;
685734
}
686735

687736
// A single property for [FileNodes][build.bazel.remote.execution.v2.FileNode],
@@ -697,6 +746,23 @@ message NodeProperty {
697746
string value = 2;
698747
}
699748

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+
700766
// A `FileNode` represents a single file and associated metadata.
701767
message FileNode {
702768
// The name of the file.
@@ -711,7 +777,8 @@ message FileNode {
711777
bool is_executable = 4;
712778

713779
// The node properties of the FileNode.
714-
repeated NodeProperty node_properties = 5;
780+
reserved 5;
781+
NodeProperties node_properties = 6;
715782
}
716783

717784
// A `DirectoryNode` represents a child of a
@@ -737,12 +804,16 @@ message SymlinkNode {
737804
// The target path can be relative to the parent directory of the symlink or
738805
// it can be an absolute path starting with `/`. Support for absolute paths
739806
// 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.
742812
string target = 2;
743813

744814
// The node properties of the SymlinkNode.
745-
repeated NodeProperty node_properties = 3;
815+
reserved 3;
816+
NodeProperties node_properties = 4;
746817
}
747818

748819
// A content digest. A digest for a given blob consists of the size of the blob
@@ -816,10 +887,20 @@ message ExecutedActionMetadata {
816887

817888
// When the worker finished uploading action outputs.
818889
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;
819895
}
820896

821897
// An ActionResult represents the result of an
822898
// [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.
823904
message ActionResult {
824905
reserved 1; // Reserved for use as the resource name.
825906

@@ -1013,7 +1094,8 @@ message OutputFile {
10131094
bytes contents = 5;
10141095

10151096
// 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;
10171099
}
10181100

10191101
// A `Tree` contains all the
@@ -1062,13 +1144,13 @@ message OutputSymlink {
10621144
// The target path can be relative to the parent directory of the symlink or
10631145
// it can be an absolute path starting with `/`. Support for absolute paths
10641146
// 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.
10671148
string target = 2;
10681149

10691150
// The supported node properties of the OutputSymlink, if requested by the
10701151
// Action.
1071-
repeated NodeProperty node_properties = 3;
1152+
reserved 3;
1153+
NodeProperties node_properties = 4;
10721154
}
10731155

10741156
// An `ExecutionPolicy` can be used to control the scheduling of the action.
@@ -1224,14 +1306,14 @@ message ExecuteOperationMetadata {
12241306
// being executed.
12251307
Digest action_digest = 2;
12261308

1227-
// If set, the client can use this name with
1309+
// If set, the client can use this resource name with
12281310
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
1229-
// standard output.
1311+
// standard output from the endpoint hosting streamed responses.
12301312
string stdout_stream_name = 3;
12311313

1232-
// If set, the client can use this name with
1314+
// If set, the client can use this resource name with
12331315
// [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the
1234-
// standard error.
1316+
// standard error from the endpoint hosting streamed responses.
12351317
string stderr_stream_name = 4;
12361318
}
12371319

@@ -1266,7 +1348,8 @@ message GetActionResultRequest {
12661348
bool inline_stderr = 4;
12671349

12681350
// 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
12701353
// [Command][build.bazel.remote.execution.v2.Command] message.
12711354
repeated string inline_output_files = 5;
12721355
}
@@ -1485,6 +1568,11 @@ message DigestFunction {
14851568

14861569
// The SHA-512 digest function.
14871570
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;
14881576
}
14891577
}
14901578

@@ -1494,12 +1582,17 @@ message ActionCacheUpdateCapabilities {
14941582
}
14951583

14961584
// 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]
14981587
// Used for querying both cache and execution valid priority ranges.
14991588
message PriorityCapabilities {
15001589
// Supported range of priorities, including boundaries.
15011590
message PriorityRange {
1591+
// The minimum numeric value for this priority range, which represents the
1592+
// most urgent task or longest retained item.
15021593
int32 min_priority = 1;
1594+
// The maximum numeric value for this priority range, which represents the
1595+
// least urgent task or shortest retained item.
15031596
int32 max_priority = 2;
15041597
}
15051598
repeated PriorityRange priorities = 1;
@@ -1597,4 +1690,18 @@ message RequestMetadata {
15971690
// An identifier to tie multiple tool invocations together. For example,
15981691
// runs of foo_test, bar_test and baz_test on a post-submit of a given patch.
15991692
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;
16001707
}

0 commit comments

Comments
 (0)