blob: 160e9302f49cb238d4604e11decb54eb86bb3984 [file] [log] [blame]
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package tools.protos;
import "google/protobuf/duration.proto";
option java_package = "com.google.devtools.build.lib.exec";
option java_outer_classname = "Protos";
// Digest of a file or action cache entry.
message Digest {
// The content hash.
string hash = 1;
// The original content size in bytes.
int64 size_bytes = 2;
// The digest function that was used to generate the hash.
// This is not an enum for compatibility reasons, and also because the
// purpose of these logs is to enable analysis by comparison of multiple
// builds. So, from the programmatic perspective, this is an opaque field.
string hash_function_name = 3;
}
message File {
// Path to the file relative to the execution root.
string path = 1;
// File digest.
Digest digest = 2;
// Whether the file is a tool.
// Only set for inputs, never for outputs.
bool is_tool = 3;
}
// Contents of command environment.
message EnvironmentVariable {
string name = 1;
string value = 2;
}
// Command execution platform. This message needs to be kept in sync
// with [Platform][google.devtools.remoteexecution.v1test.Platform].
message Platform {
message Property {
string name = 1;
string value = 2;
}
repeated Property properties = 1;
}
// Timing, size, and memory statistics for a SpawnExec.
message SpawnMetrics {
// Total wall time spent running a spawn, measured locally.
google.protobuf.Duration total_time = 1;
// Time taken to convert the spawn into a network request.
google.protobuf.Duration parse_time = 2;
// Time spent communicating over the network.
google.protobuf.Duration network_time = 3;
// Time spent fetching remote outputs.
google.protobuf.Duration fetch_time = 4;
// Time spent waiting in queues.
google.protobuf.Duration queue_time = 5;
// Time spent setting up the environment in which the spawn is run.
google.protobuf.Duration setup_time = 6;
// Time spent uploading outputs to a remote store.
google.protobuf.Duration upload_time = 7;
// Time spent running the subprocess.
google.protobuf.Duration execution_wall_time = 8;
// Time spent by the execution framework processing outputs.
google.protobuf.Duration process_outputs_time = 9;
// Time spent in previous failed attempts, not including queue time.
google.protobuf.Duration retry_time = 10;
// Total size in bytes of inputs or 0 if unavailable.
int64 input_bytes = 11;
// Total number of input files or 0 if unavailable.
int64 input_files = 12;
// Estimated memory usage or 0 if unavailable.
int64 memory_estimate_bytes = 13;
// Limit of total size of inputs or 0 if unavailable.
int64 input_bytes_limit = 14;
// Limit of total number of input files or 0 if unavailable.
int64 input_files_limit = 15;
// Limit of total size of outputs or 0 if unavailable.
int64 output_bytes_limit = 16;
// Limit of total number of output files or 0 if unavailable.
int64 output_files_limit = 17;
// Memory limit or 0 if unavailable.
int64 memory_bytes_limit = 18;
// Time limit or 0 if unavailable.
google.protobuf.Duration time_limit = 19;
}
// Details of an executed spawn.
// These will only be generated on demand, using the
// --execution_log_file=<path> flag.
// Each message contains an executed command, its full inputs and outputs.
// The purpose of these is to enable comparisons of multiple builds to diagnose
// output differences or more subtle problems such as remote caching misses.
// Only the executed Spawns will be output -- local cache hits are ignored.
message SpawnExec {
// The command that was run.
repeated string command_args = 1;
// The command environment.
repeated EnvironmentVariable environment_variables = 2;
// The command execution platform.
Platform platform = 3;
// The inputs at the time of the execution.
repeated File inputs = 4;
// All the listed outputs paths. The paths are relative to the execution root.
// Actual outputs are a subset of the listed outputs. These paths are sorted.
repeated string listed_outputs = 5;
// Was the Spawn allowed to be executed remotely.
bool remotable = 6;
// Was the Spawn result allowed to be cached.
bool cacheable = 7;
// The Spawn timeout.
int64 timeout_millis = 8;
// An opaque string that identifies the type of the Spawn's action.
string mnemonic = 10;
// The outputs generated by the execution.
repeated File actual_outputs = 11;
// If the spawn did not hit a disk or remote cache, this will be the name of
// the runner, e.g. "remote", "linux-sandbox" or "worker".
//
// If the spawn hit a disk or remote cache, this will be "disk cache hit" or
// "remote cache hit", respectively. This includes the case where a remote
// cache was hit while executing the spawn remotely.
//
// Note that spawns whose owning action hits the persistent action cache
// are never reported at all.
//
// This won't always match the spawn strategy. For the dynamic strategy, it
// will be the runner for the first branch to complete. For the remote
// strategy, it might be a local runner in case of a fallback.
string runner = 12;
// Whether the spawn hit a disk or remote cache.
bool cache_hit = 13;
// A text status returned by the execution, in case there were any errors.
// Empty in case of successful execution.
string status = 14;
// This field contains the contents of SpawnResult.exitCode.
// Its semantics varies greatly depending on the status field.
// Dependable: if status is empty, exit_code is guaranteed to be zero.
int32 exit_code = 15;
// Was the Spawn result allowed to be cached remotely.
bool remote_cacheable = 16;
// Canonical label of the target that emitted this spawn, may not always be
// set.
string target_label = 18;
// The action cache digest.
// Only available when remote execution, remote cache or disk cache was
// enabled for this spawn.
Digest digest = 19;
// Timing, size and memory statistics.
SpawnMetrics metrics = 20;
reserved 9, 17;
}