aboutsummaryrefslogtreecommitdiff
path: root/google/devtools/build
diff options
context:
space:
mode:
Diffstat (limited to 'google/devtools/build')
-rw-r--r--google/devtools/build/artman_buildeventservice.yaml34
-rw-r--r--google/devtools/build/buildeventservice.yaml17
-rw-r--r--google/devtools/build/v1/build_events.proto182
-rw-r--r--google/devtools/build/v1/build_status.proto66
-rw-r--r--google/devtools/build/v1/buildeventservice_gapic.yaml126
-rw-r--r--google/devtools/build/v1/publish_build_event.proto164
6 files changed, 589 insertions, 0 deletions
diff --git a/google/devtools/build/artman_buildeventservice.yaml b/google/devtools/build/artman_buildeventservice.yaml
new file mode 100644
index 000000000..4758a62ac
--- /dev/null
+++ b/google/devtools/build/artman_buildeventservice.yaml
@@ -0,0 +1,34 @@
+common:
+ api_name: buildeventservice
+ api_version: v1
+ organization_name: google-cloud
+ proto_deps:
+ - name: google-common-protos
+ src_proto_paths:
+ - v1
+ service_yaml: buildeventservice.yaml
+ gapic_yaml: v1/buildeventservice_gapic.yaml
+artifacts:
+- name: gapic_config
+ type: GAPIC_CONFIG
+- name: java_gapic
+ type: GAPIC
+ language: JAVA
+- name: python_gapic
+ type: GAPIC
+ language: PYTHON
+- name: nodejs_gapic
+ type: GAPIC
+ language: NODEJS
+- name: php_gapic
+ type: GAPIC
+ language: PHP
+- name: go_gapic
+ type: GAPIC
+ language: GO
+- name: ruby_gapic
+ type: GAPIC
+ language: RUBY
+- name: csharp_gapic
+ type: GAPIC
+ language: CSHARP
diff --git a/google/devtools/build/buildeventservice.yaml b/google/devtools/build/buildeventservice.yaml
new file mode 100644
index 000000000..4d5850029
--- /dev/null
+++ b/google/devtools/build/buildeventservice.yaml
@@ -0,0 +1,17 @@
+type: google.api.Service
+config_version: 3
+name: buildeventservice.googleapis.com
+title: Build Event Service Backend API
+
+apis:
+- name: google.devtools.build.v1.PublishBuildEvent
+
+documentation:
+ summary: Handles build events from tools such as bazel.
+
+authentication:
+ rules:
+ - selector: '*'
+ oauth:
+ canonical_scopes: |-
+ https://www.googleapis.com/auth/cloud-platform
diff --git a/google/devtools/build/v1/build_events.proto b/google/devtools/build/v1/build_events.proto
new file mode 100644
index 000000000..8b29a4521
--- /dev/null
+++ b/google/devtools/build/v1/build_events.proto
@@ -0,0 +1,182 @@
+// Copyright 2018 Google LLC.
+//
+// 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 google.devtools.build.v1;
+
+import "google/api/annotations.proto";
+import "google/devtools/build/v1/build_status.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/timestamp.proto";
+
+option cc_enable_arenas = true;
+option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
+option java_multiple_files = true;
+option java_outer_classname = "BuildEventProto";
+option java_package = "com.google.devtools.build.v1";
+
+// An event representing some state change that occurred in the build. This
+// message does not include field for uniquely identifying an event.
+message BuildEvent {
+ // Notification that the build system has attempted to run the build tool.
+ message InvocationAttemptStarted {
+ // The number of the invocation attempt, starting at 1 and increasing by 1
+ // for each new attempt. Can be used to determine if there is a later
+ // invocation attempt replacing the current one a client is processing.
+ int64 attempt_number = 1;
+
+ // Additional details about the invocation.
+ google.protobuf.Any details = 2;
+ }
+
+ // Notification that an invocation attempt has finished.
+ message InvocationAttemptFinished {
+ // Final status of the invocation.
+ BuildStatus invocation_status = 3;
+ }
+
+ // Notification that the build request is enqueued.
+ message BuildEnqueued {
+ // Additional details about the Build.
+ google.protobuf.Any details = 1;
+ }
+
+ // Notification that the build request has finished, and no further
+ // invocations will occur. Note that this applies to the entire Build.
+ // Individual invocations trigger InvocationFinished when they finish.
+ message BuildFinished {
+ // Final status of the build.
+ BuildStatus status = 1;
+ }
+
+ // Textual output written to standard output or standard error.
+ message ConsoleOutput {
+ // The output stream type.
+ ConsoleOutputStream type = 1;
+
+ // The output stream content.
+ oneof output {
+ // Regular UTF-8 output; normal text.
+ string text_output = 2;
+
+ // Used if the output is not UTF-8 text (for example, a binary proto).
+ bytes binary_output = 3;
+ }
+ }
+
+ // Notification of the end of a build event stream published by a build
+ // component other than CONTROLLER (See StreamId.BuildComponents).
+ message BuildComponentStreamFinished {
+ // How did the event stream finish.
+ enum FinishType {
+ // Unknown or unspecified; callers should never set this value.
+ FINISH_TYPE_UNSPECIFIED = 0;
+
+ // Set by the event publisher to indicate a build event stream is
+ // finished.
+ FINISHED = 1;
+
+ // Set by the WatchBuild RPC server when the publisher of a build event
+ // stream stops publishing events without publishing a
+ // BuildComponentStreamFinished event whose type equals FINISHED.
+ EXPIRED = 2;
+ }
+
+ // How the event stream finished.
+ FinishType type = 1;
+ }
+
+ // The timestamp of this event.
+ google.protobuf.Timestamp event_time = 1;
+
+ // //////////////////////////////////////////////////////////////////////////
+ // Events that indicate a state change of a build request in the build
+ // queue.
+ oneof event {
+ // An invocation attempt has started.
+ InvocationAttemptStarted invocation_attempt_started = 51;
+
+ // An invocation attempt has finished.
+ InvocationAttemptFinished invocation_attempt_finished = 52;
+
+ // The build is enqueued (just inserted to the build queue or put back
+ // into the build queue due to a previous build failure).
+ BuildEnqueued build_enqueued = 53;
+
+ // The build has finished. Set when the build is terminated.
+ BuildFinished build_finished = 55;
+
+ // An event containing printed text.
+ ConsoleOutput console_output = 56;
+
+ // Indicates the end of a build event stream (with the same StreamId) from
+ // a build component executing the requested build task.
+ // *** This field does not indicate the WatchBuild RPC is finished. ***
+ BuildComponentStreamFinished component_stream_finished = 59;
+
+ // Structured build event generated by Bazel about its execution progress.
+ google.protobuf.Any bazel_event = 60;
+
+ // An event that contains supplemental tool-specific information about
+ // build execution.
+ google.protobuf.Any build_execution_event = 61;
+
+ // An event that contains supplemental tool-specific information about
+ // source fetching.
+ google.protobuf.Any source_fetch_event = 62;
+ }
+}
+
+// Unique identifier for a build event stream.
+message StreamId {
+ // Which build component generates this event stream. Each build component
+ // may generate one event stream.
+ enum BuildComponent {
+ // Unknown or unspecified; callers should never set this value.
+ UNKNOWN_COMPONENT = 0;
+
+ // A component that coordinates builds.
+ CONTROLLER = 1;
+
+ // A component that runs executables needed to complete a build.
+ WORKER = 2;
+
+ // A component that builds something.
+ TOOL = 3;
+ }
+
+ // The id of a Build message.
+ string build_id = 1;
+
+ // The unique invocation ID within this build.
+ // It should be the same as {invocation} (below) during the migration.
+ string invocation_id = 6;
+
+ // The component that emitted this event.
+ BuildComponent component = 3;
+}
+
+// The type of console output stream.
+enum ConsoleOutputStream {
+ // Unspecified or unknown.
+ UNKNOWN = 0;
+
+ // Normal output stream.
+ STDOUT = 1;
+
+ // Error output stream.
+ STDERR = 2;
+}
diff --git a/google/devtools/build/v1/build_status.proto b/google/devtools/build/v1/build_status.proto
new file mode 100644
index 000000000..8d108e36c
--- /dev/null
+++ b/google/devtools/build/v1/build_status.proto
@@ -0,0 +1,66 @@
+// Copyright 2018 Google LLC.
+//
+// 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 google.devtools.build.v1;
+
+import "google/api/annotations.proto";
+import "google/protobuf/any.proto";
+
+option cc_enable_arenas = true;
+option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
+option java_multiple_files = true;
+option java_outer_classname = "BuildStatusProto";
+option java_package = "com.google.devtools.build.v1";
+
+// Status used for both invocation attempt and overall build completion.
+message BuildStatus {
+ // The end result of the Build.
+ enum Result {
+ // Unspecified or unknown.
+ UNKNOWN_STATUS = 0;
+
+ // Build was successful and tests (if requested) all pass.
+ COMMAND_SUCCEEDED = 1;
+
+ // Build error and/or test failure.
+ COMMAND_FAILED = 2;
+
+ // Unable to obtain a result due to input provided by the user.
+ USER_ERROR = 3;
+
+ // Unable to obtain a result due to a failure within the build system.
+ SYSTEM_ERROR = 4;
+
+ // Build required too many resources, such as build tool RAM.
+ RESOURCE_EXHAUSTED = 5;
+
+ // An invocation attempt time exceeded its deadline.
+ INVOCATION_DEADLINE_EXCEEDED = 6;
+
+ // Build request time exceeded the request_deadline
+ REQUEST_DEADLINE_EXCEEDED = 8;
+
+ // The build was cancelled by a call to CancelBuild.
+ CANCELLED = 7;
+ }
+
+ // The end result.
+ Result result = 1;
+
+ // Fine-grained diagnostic information to complement the status.
+ google.protobuf.Any details = 2;
+}
diff --git a/google/devtools/build/v1/buildeventservice_gapic.yaml b/google/devtools/build/v1/buildeventservice_gapic.yaml
new file mode 100644
index 000000000..cabd6db30
--- /dev/null
+++ b/google/devtools/build/v1/buildeventservice_gapic.yaml
@@ -0,0 +1,126 @@
+type: com.google.api.codegen.ConfigProto
+config_schema_version: 1.0.0
+# The settings of generated code in a specific language.
+language_settings:
+ java:
+ package_name: com.google.cloud.devtools.build.v1
+ python:
+ package_name: google.cloud.devtools.build_v1.gapic
+ go:
+ package_name: cloud.google.com/go/devtools/build/apiv1
+ csharp:
+ package_name: Google.Devtools.Build.V1
+ ruby:
+ package_name: Google::Cloud::Devtools::Build::V1
+ php:
+ package_name: Google\Cloud\Devtools\Build\V1
+ nodejs:
+ package_name: build.v1
+# A list of API interface configurations.
+interfaces:
+ # The fully qualified name of the API interface.
+- name: google.devtools.build.v1.PublishBuildEvent
+ # A list of resource collection configurations.
+ # Consists of a name_pattern and an entity_name.
+ # The name_pattern is a pattern to describe the names of the resources of this
+ # collection, using the platform's conventions for URI patterns. A generator
+ # may use this to generate methods to compose and decompose such names. The
+ # pattern should use named placeholders as in `shelves/{shelf}/books/{book}`;
+ # those will be taken as hints for the parameter names of the generated
+ # methods. If empty, no name methods are generated.
+ # The entity_name is the name to be used as a basis for generated methods and
+ # classes.
+ collections: []
+ # Definition for retryable codes.
+ retry_codes_def:
+ - name: idempotent
+ retry_codes:
+ - DEADLINE_EXCEEDED
+ - UNAVAILABLE
+ - name: non_idempotent
+ retry_codes: []
+ # Definition for retry/backoff parameters.
+ retry_params_def:
+ - name: default
+ initial_retry_delay_millis: 100
+ retry_delay_multiplier: 1.3
+ max_retry_delay_millis: 60000
+ initial_rpc_timeout_millis: 20000
+ rpc_timeout_multiplier: 1
+ max_rpc_timeout_millis: 20000
+ total_timeout_millis: 600000
+ # A list of method configurations.
+ # Common properties:
+ #
+ # name - The simple name of the method.
+ #
+ # flattening - Specifies the configuration for parameter flattening.
+ # Describes the parameter groups for which a generator should produce method
+ # overloads which allow a client to directly pass request message fields as
+ # method parameters. This information may or may not be used, depending on
+ # the target language.
+ # Consists of groups, which each represent a list of parameters to be
+ # flattened. Each parameter listed must be a field of the request message.
+ #
+ # required_fields - Fields that are always required for a request to be
+ # valid.
+ #
+ # resource_name_treatment - An enum that specifies how to treat the resource
+ # name formats defined in the field_name_patterns and
+ # response_field_name_patterns fields.
+ # UNSET: default value
+ # NONE: the collection configs will not be used by the generated code.
+ # VALIDATE: string fields will be validated by the client against the
+ # specified resource name formats.
+ # STATIC_TYPES: the client will use generated types for resource names.
+ #
+ # page_streaming - Specifies the configuration for paging.
+ # Describes information for generating a method which transforms a paging
+ # list RPC into a stream of resources.
+ # Consists of a request and a response.
+ # The request specifies request information of the list method. It defines
+ # which fields match the paging pattern in the request. The request consists
+ # of a page_size_field and a token_field. The page_size_field is the name of
+ # the optional field specifying the maximum number of elements to be
+ # returned in the response. The token_field is the name of the field in the
+ # request containing the page token.
+ # The response specifies response information of the list method. It defines
+ # which fields match the paging pattern in the response. The response
+ # consists of a token_field and a resources_field. The token_field is the
+ # name of the field in the response containing the next page token. The
+ # resources_field is the name of the field in the response containing the
+ # list of resources belonging to the page.
+ #
+ # retry_codes_name - Specifies the configuration for retryable codes. The
+ # name must be defined in interfaces.retry_codes_def.
+ #
+ # retry_params_name - Specifies the configuration for retry/backoff
+ # parameters. The name must be defined in interfaces.retry_params_def.
+ #
+ # field_name_patterns - Maps the field name of the request type to
+ # entity_name of interfaces.collections.
+ # Specifies the string pattern that the field must follow.
+ #
+ # timeout_millis - Specifies the default timeout for a non-retrying call. If
+ # the call is retrying, refer to retry_params_name instead.
+ methods:
+ - name: PublishLifecycleEvent
+ required_fields:
+ - build_event
+ - project_id
+ retry_codes_name: non_idempotent
+ retry_params_name: default
+ timeout_millis: 60000
+ - name: PublishBuildToolEventStream
+ flattening:
+ groups:
+ - parameters:
+ - ordered_build_event
+ - notification_keywords
+ - project_id
+ required_fields:
+ - ordered_build_event
+ - project_id
+ retry_codes_name: non_idempotent
+ retry_params_name: default
+ timeout_millis: 60000
diff --git a/google/devtools/build/v1/publish_build_event.proto b/google/devtools/build/v1/publish_build_event.proto
new file mode 100644
index 000000000..5e483d679
--- /dev/null
+++ b/google/devtools/build/v1/publish_build_event.proto
@@ -0,0 +1,164 @@
+// Copyright 2018 Google LLC.
+//
+// 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 google.devtools.build.v1;
+
+import "google/api/annotations.proto";
+import "google/devtools/build/v1/build_events.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/empty.proto";
+
+option cc_enable_arenas = true;
+option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
+option java_multiple_files = true;
+option java_outer_classname = "BackendProto";
+option java_package = "com.google.devtools.build.v1";
+
+// A service for publishing BuildEvents. BuildEvents are generated by Build
+// Systems to record actions taken during a Build. Events occur in streams,
+// are identified by a StreamId, and ordered by sequence number in a stream.
+//
+// A Build may contain several streams of BuildEvents, depending on the systems
+// that are involved in the Build. Some BuildEvents are used to declare the
+// beginning and end of major portions of a Build; these are called
+// LifecycleEvents, and are used (for example) to indicate the beginning or end
+// of a Build, and the beginning or end of an Invocation attempt (there can be
+// more than 1 Invocation in a Build if, for example, a failure occurs somewhere
+// and it needs to be retried).
+//
+// Other, build-tool events represent actions taken by the Build tool, such as
+// target objects produced via compilation, tests run, et cetera. There could be
+// more than one build tool stream for an invocation attempt of a build.
+service PublishBuildEvent {
+ // Publish a build event stating the new state of a build (typically from the
+ // build queue). The BuildEnqueued event must be publishd before all other
+ // events for the same build ID.
+ //
+ // The backend will persist the event and deliver it to registered frontend
+ // jobs immediately without batching.
+ //
+ // The commit status of the request is reported by the RPC's util_status()
+ // function. The error code is the canoncial error code defined in
+ // //util/task/codes.proto.
+ rpc PublishLifecycleEvent(PublishLifecycleEventRequest)
+ returns (google.protobuf.Empty) {
+ option (google.api.http) = {
+ post: "/v1/projects/{project_id=*}/lifecycleEvents:publish"
+ body: "*"
+ additional_bindings { post: "/v1/lifecycleEvents:publish" body: "*" }
+ };
+ }
+
+ // Publish build tool events belonging to the same stream to a backend job
+ // using bidirectional streaming.
+ rpc PublishBuildToolEventStream(stream PublishBuildToolEventStreamRequest)
+ returns (stream PublishBuildToolEventStreamResponse) {
+ option (google.api.http) = {
+ post: "/v1/projects/{project_id=*}/events:publish"
+ body: "*"
+ additional_bindings { post: "/v1/events:publish" body: "*" }
+ };
+ }
+}
+
+// Publishes 'lifecycle events' that update the high-level state of a build:
+// - BuildEnqueued: When a build is scheduled.
+// - InvocationAttemptStarted: When work for a build starts; there can be
+// multiple invocations for a build (e.g. retries).
+// - InvocationAttemptCompleted: When work for a build finishes.
+// - BuildFinished: When a build is finished.
+message PublishLifecycleEventRequest {
+ // The service level of the build request. Backends only uses this value when
+ // the BuildEnqueued event is published to determine what level of service
+ // this build should receive.
+ enum ServiceLevel {
+ // Non-interactive builds can tolerate longer event latencies. This is the
+ // default ServiceLevel if callers do not specify one.
+ NONINTERACTIVE = 0;
+
+ // The events of an interactive build should be delivered with low latency.
+ INTERACTIVE = 1;
+ }
+
+ // The interactivity of this build.
+ ServiceLevel service_level = 1;
+
+ // The lifecycle build event. If this is a build tool event, the RPC will fail
+ // with INVALID_REQUEST.
+ OrderedBuildEvent build_event = 2;
+
+ // If the next event for this build or invocation (depending on the event
+ // type) hasn't been published after this duration from when {build_event}
+ // is written to BES, consider this stream expired. If this field is not set,
+ // BES backend will use its own default value.
+ google.protobuf.Duration stream_timeout = 3;
+
+ // Additional information about a build request. These are define by the event
+ // publishers, and the Build Event Service does not validate or interpret
+ // them. They are used while notifying internal systems of new builds and
+ // invocations if the OrderedBuildEvent.event type is
+ // BuildEnqueued/InvocationAttemptStarted.
+ repeated string notification_keywords = 4;
+
+ // The project this build is associated with.
+ // This should match the project used for the initial call to
+ // PublishLifecycleEvent (containing a BuildEnqueued message).
+ string project_id = 6;
+}
+
+// States which event has been committed. Any failure to commit will cause
+// RPC errors, hence not recorded by this proto.
+message PublishBuildToolEventStreamResponse {
+ // The stream that contains this event.
+ StreamId stream_id = 1;
+
+ // The sequence number of this event that has been committed.
+ int64 sequence_number = 2;
+}
+
+// Build event with contextual information about the stream it belongs to and
+// its position in that stream.
+message OrderedBuildEvent {
+ // Which build event stream this event belongs to.
+ StreamId stream_id = 1;
+
+ // The position of this event in the stream. The sequence numbers for a build
+ // event stream should be a sequence of consecutive natural numbers starting
+ // from one. (1, 2, 3, ...)
+ int64 sequence_number = 2;
+
+ // The actual event.
+ BuildEvent event = 3;
+}
+
+// Streaming request message for PublishBuildToolEventStream.
+message PublishBuildToolEventStreamRequest {
+ // The build event with position info.
+ // New publishing clients should use this field rather than the 3 above.
+ OrderedBuildEvent ordered_build_event = 4;
+
+ // The keywords to be attached to the notification which notifies the start
+ // of a new build event stream. BES only reads this field when sequence_number
+ // or ordered_build_event.sequence_number is 1 in this message. If this field
+ // is empty, BES will not publish notification messages for this stream.
+ repeated string notification_keywords = 5;
+
+ // The project this build is associated with.
+ // This should match the project used for the initial call to
+ // PublishLifecycleEvent (containing a BuildEnqueued message).
+ string project_id = 6;
+}