aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Hunt <lexer@google.com>2018-06-06 11:17:04 -0400
committerOla Rozenfeld <olaola@google.com>2018-06-20 14:31:20 -0400
commitf42e4bb8edf7a5c3ea0ce3077b1b5282564c8959 (patch)
tree5b5866be8512e8d9fe4655b5de9f210f4c554a4b
parent8e0fcbaad8b5d5dddd7e0395604f34ec76990f7d (diff)
downloadbazelbuild-remote-apis-f42e4bb8edf7a5c3ea0ce3077b1b5282564c8959.tar.gz
Move output and platform specs into Command.
This is expected to provide performance improvements, as output specs and platforms are highly associated with the same command line and currently must be repeated for every action.
-rw-r--r--build/bazel/remote/execution/v2/remote_execution.proto118
1 files changed, 62 insertions, 56 deletions
diff --git a/build/bazel/remote/execution/v2/remote_execution.proto b/build/bazel/remote/execution/v2/remote_execution.proto
index 245b447..5d75113 100644
--- a/build/bazel/remote/execution/v2/remote_execution.proto
+++ b/build/bazel/remote/execution/v2/remote_execution.proto
@@ -240,8 +240,9 @@ service ContentAddressableStorage {
// chunks or uploaded using the
// [ByteStream API][google.bytestream.ByteStream], as appropriate.
//
- // This request is equivalent to calling [UpdateBlob][] on each individual
- // blob, in parallel. The requests may succeed or fail independently.
+ // This request is equivalent to calling a hypothetical `UpdateBlob` request
+ // on each individual blob, in parallel. The requests may succeed or fail
+ // independently.
//
// Errors:
// * `INVALID_ARGUMENT`: The client attempted to upload more than 10 MiB of
@@ -312,10 +313,12 @@ service Capabilities {
// cache the [result][build.bazel.remote.execution.v2.ActionResult] in
// the [ActionCache][build.bazel.remote.execution.v2.ActionCache] unless
// `do_not_cache` is `true`. Clients SHOULD expect the server to do so. By
-// default, future calls to [Execute][] the same `Action` will also serve their
-// results from the cache. Clients must take care to understand the caching
-// behaviour. Ideally, all `Action`s will be reproducible so that serving a
-// result from cache is always desirable and correct.
+// default, future calls to
+// [Execute][build.bazel.remote.execution.v2.Execution.Execute] the same
+// `Action` will also serve their results from the cache. Clients must take care
+// to understand the caching behaviour. Ideally, all `Action`s will be
+// reproducible so that serving a result from cache is always desirable and
+// correct.
message Action {
// The digest of the [Command][build.bazel.remote.execution.v2.Command]
// to run, which MUST be present in the
@@ -331,54 +334,7 @@ message Action {
// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
Digest input_root_digest = 2;
- // A list of the output files that the client expects to retrieve from the
- // action. Only the listed files, as well as directories listed in
- // `output_directories`, will be returned to the client as output.
- // Other files that may be created during command execution are discarded.
- //
- // The paths are relative to the working directory of the action execution.
- // The paths are specified using a single forward slash (`/`) as a path
- // separator, even if the execution platform natively uses a different
- // separator. The path MUST NOT include a trailing slash, nor a leading slash,
- // being a relative path.
- //
- // In order to ensure consistent hashing of the same Action, the output paths
- // MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
- // bytes).
- //
- // An output file cannot be duplicated, be a parent of another output file, be
- // a child of a listed output directory, or have the same path as any of the
- // listed output directories.
- repeated string output_files = 3;
-
- // A list of the output directories that the client expects to retrieve from
- // the action. Only the contents of the indicated directories (recursively
- // including the contents of their subdirectories) will be
- // returned, as well as files listed in `output_files`. Other files that may
- // be created during command execution are discarded.
- //
- // The paths are relative to the working directory of the action execution.
- // The paths are specified using a single forward slash (`/`) as a path
- // separator, even if the execution platform natively uses a different
- // separator. The path MUST NOT include a trailing slash, nor a leading slash,
- // being a relative path. The special value of empty string is allowed,
- // although not recommended, and can be used to capture the entire working
- // directory tree, including inputs.
- //
- // In order to ensure consistent hashing of the same Action, the output paths
- // MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
- // bytes).
- //
- // An output directory cannot be duplicated, be a parent of another output
- // directory, be a parent of a listed output file, or have the same path as
- // any of the listed output files.
- repeated string output_directories = 4;
-
- // The platform requirements for the execution environment. The server MAY
- // choose to execute the action on any worker satisfying the requirements, so
- // the client SHOULD ensure that running the action on any such worker will
- // have the same result.
- Platform platform = 5;
+ reserved 3 to 5; // Used for files moved to [Command][build.bazel.remote.execution.v2.Command].
// A timeout after which the execution should be killed. If the timeout is
// absent, then the client is specifying that the execution should continue
@@ -403,7 +359,8 @@ message Action {
}
// A `Command` is the actual command executed by a worker running an
-// [Action][build.bazel.remote.execution.v2.Action].
+// [Action][build.bazel.remote.execution.v2.Action] and specifications of its
+// environment.
//
// Except as otherwise required, the environment (such as which system
// libraries or binaries are available, and what filesystems are mounted where)
@@ -433,6 +390,55 @@ message Command {
// Sorting of strings is done by code point, equivalently, by the UTF-8 bytes.
repeated EnvironmentVariable environment_variables = 2;
+ // A list of the output files that the client expects to retrieve from the
+ // action. Only the listed files, as well as directories listed in
+ // `output_directories`, will be returned to the client as output.
+ // Other files that may be created during command execution are discarded.
+ //
+ // The paths are relative to the working directory of the action execution.
+ // The paths are specified using a single forward slash (`/`) as a path
+ // separator, even if the execution platform natively uses a different
+ // separator. The path MUST NOT include a trailing slash, nor a leading slash,
+ // being a relative path.
+ //
+ // In order to ensure consistent hashing of the same Action, the output paths
+ // MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
+ // bytes).
+ //
+ // An output file cannot be duplicated, be a parent of another output file, be
+ // a child of a listed output directory, or have the same path as any of the
+ // listed output directories.
+ repeated string output_files = 3;
+
+ // A list of the output directories that the client expects to retrieve from
+ // the action. Only the contents of the indicated directories (recursively
+ // including the contents of their subdirectories) will be
+ // returned, as well as files listed in `output_files`. Other files that may
+ // be created during command execution are discarded.
+ //
+ // The paths are relative to the working directory of the action execution.
+ // The paths are specified using a single forward slash (`/`) as a path
+ // separator, even if the execution platform natively uses a different
+ // separator. The path MUST NOT include a trailing slash, nor a leading slash,
+ // being a relative path. The special value of empty string is allowed,
+ // although not recommended, and can be used to capture the entire working
+ // directory tree, including inputs.
+ //
+ // In order to ensure consistent hashing of the same Action, the output paths
+ // MUST be sorted lexicographically by code point (or, equivalently, by UTF-8
+ // bytes).
+ //
+ // An output directory cannot be duplicated, be a parent of another output
+ // directory, be a parent of a listed output file, or have the same path as
+ // any of the listed output files.
+ repeated string output_directories = 4;
+
+ // The platform requirements for the execution environment. The server MAY
+ // choose to execute the action on any worker satisfying the requirements, so
+ // the client SHOULD ensure that running the action on any such worker will
+ // have the same result.
+ Platform platform = 5;
+
// The working directory, relative to the input root, for the command to run
// in. It must be a directory which exists in the input tree. If it is left
// empty, then the action is run in the input root.
@@ -665,7 +671,7 @@ message ActionResult {
// in the `output_directories` field of the Action, if the corresponding
// directory existed after the action completed, a single entry will be
// present in the output list, which will contain the digest of a
- // [Tree][build.bazel.remote.execution.v2.Tree[] message containing the
+ // [Tree][build.bazel.remote.execution.v2.Tree] message containing the
// directory tree, and the path equal exactly to the corresponding Action
// output_directories member.
//