executionv2connect

package
v1.19.1-20230602030542... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: unknown License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExecutionName is the fully-qualified name of the Execution service.
	ExecutionName = "build.bazel.remote.execution.v2.Execution"
	// ActionCacheName is the fully-qualified name of the ActionCache service.
	ActionCacheName = "build.bazel.remote.execution.v2.ActionCache"
	// ContentAddressableStorageName is the fully-qualified name of the ContentAddressableStorage
	// service.
	ContentAddressableStorageName = "build.bazel.remote.execution.v2.ContentAddressableStorage"
	// CapabilitiesName is the fully-qualified name of the Capabilities service.
	CapabilitiesName = "build.bazel.remote.execution.v2.Capabilities"
)
View Source
const (
	// ExecutionExecuteProcedure is the fully-qualified name of the Execution's Execute RPC.
	ExecutionExecuteProcedure = "/build.bazel.remote.execution.v2.Execution/Execute"
	// ExecutionWaitExecutionProcedure is the fully-qualified name of the Execution's WaitExecution RPC.
	ExecutionWaitExecutionProcedure = "/build.bazel.remote.execution.v2.Execution/WaitExecution"
	// ActionCacheGetActionResultProcedure is the fully-qualified name of the ActionCache's
	// GetActionResult RPC.
	ActionCacheGetActionResultProcedure = "/build.bazel.remote.execution.v2.ActionCache/GetActionResult"
	// ActionCacheUpdateActionResultProcedure is the fully-qualified name of the ActionCache's
	// UpdateActionResult RPC.
	ActionCacheUpdateActionResultProcedure = "/build.bazel.remote.execution.v2.ActionCache/UpdateActionResult"
	// ContentAddressableStorageFindMissingBlobsProcedure is the fully-qualified name of the
	// ContentAddressableStorage's FindMissingBlobs RPC.
	ContentAddressableStorageFindMissingBlobsProcedure = "/build.bazel.remote.execution.v2.ContentAddressableStorage/FindMissingBlobs"
	// ContentAddressableStorageBatchUpdateBlobsProcedure is the fully-qualified name of the
	// ContentAddressableStorage's BatchUpdateBlobs RPC.
	ContentAddressableStorageBatchUpdateBlobsProcedure = "/build.bazel.remote.execution.v2.ContentAddressableStorage/BatchUpdateBlobs"
	// ContentAddressableStorageBatchReadBlobsProcedure is the fully-qualified name of the
	// ContentAddressableStorage's BatchReadBlobs RPC.
	ContentAddressableStorageBatchReadBlobsProcedure = "/build.bazel.remote.execution.v2.ContentAddressableStorage/BatchReadBlobs"
	// ContentAddressableStorageGetTreeProcedure is the fully-qualified name of the
	// ContentAddressableStorage's GetTree RPC.
	ContentAddressableStorageGetTreeProcedure = "/build.bazel.remote.execution.v2.ContentAddressableStorage/GetTree"
	// CapabilitiesGetCapabilitiesProcedure is the fully-qualified name of the Capabilities's
	// GetCapabilities RPC.
	CapabilitiesGetCapabilitiesProcedure = "/build.bazel.remote.execution.v2.Capabilities/GetCapabilities"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

Variables

This section is empty.

Functions

func NewActionCacheHandler

func NewActionCacheHandler(svc ActionCacheHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewActionCacheHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewCapabilitiesHandler

func NewCapabilitiesHandler(svc CapabilitiesHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewCapabilitiesHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewContentAddressableStorageHandler

func NewContentAddressableStorageHandler(svc ContentAddressableStorageHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewContentAddressableStorageHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewExecutionHandler

func NewExecutionHandler(svc ExecutionHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewExecutionHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type ActionCacheClient

type ActionCacheClient interface {
	// Retrieve a cached execution result.
	//
	// Implementations SHOULD ensure that any blobs referenced from the
	// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
	// are available at the time of returning the
	// [ActionResult][build.bazel.remote.execution.v2.ActionResult] and will be
	// for some period of time afterwards. The lifetimes of the referenced blobs SHOULD be increased
	// if necessary and applicable.
	//
	// Errors:
	//
	// * `NOT_FOUND`: The requested `ActionResult` is not in the cache.
	GetActionResult(context.Context, *connect.Request[v2.GetActionResultRequest]) (*connect.Response[v2.ActionResult], error)
	// Upload a new execution result.
	//
	// In order to allow the server to perform access control based on the type of
	// action, and to assist with client debugging, the client MUST first upload
	// the [Action][build.bazel.remote.execution.v2.Execution] that produced the
	// result, along with its
	// [Command][build.bazel.remote.execution.v2.Command], into the
	// `ContentAddressableStorage`.
	//
	// Server implementations MAY modify the
	// `UpdateActionResultRequest.action_result` and return an equivalent value.
	//
	// Errors:
	//
	//   - `INVALID_ARGUMENT`: One or more arguments are invalid.
	//   - `FAILED_PRECONDITION`: One or more errors occurred in updating the
	//     action result, such as a missing command or action.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the
	//     entry to the cache.
	UpdateActionResult(context.Context, *connect.Request[v2.UpdateActionResultRequest]) (*connect.Response[v2.ActionResult], error)
}

ActionCacheClient is a client for the build.bazel.remote.execution.v2.ActionCache service.

func NewActionCacheClient

func NewActionCacheClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ActionCacheClient

NewActionCacheClient constructs a client for the build.bazel.remote.execution.v2.ActionCache service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type ActionCacheHandler

type ActionCacheHandler interface {
	// Retrieve a cached execution result.
	//
	// Implementations SHOULD ensure that any blobs referenced from the
	// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
	// are available at the time of returning the
	// [ActionResult][build.bazel.remote.execution.v2.ActionResult] and will be
	// for some period of time afterwards. The lifetimes of the referenced blobs SHOULD be increased
	// if necessary and applicable.
	//
	// Errors:
	//
	// * `NOT_FOUND`: The requested `ActionResult` is not in the cache.
	GetActionResult(context.Context, *connect.Request[v2.GetActionResultRequest]) (*connect.Response[v2.ActionResult], error)
	// Upload a new execution result.
	//
	// In order to allow the server to perform access control based on the type of
	// action, and to assist with client debugging, the client MUST first upload
	// the [Action][build.bazel.remote.execution.v2.Execution] that produced the
	// result, along with its
	// [Command][build.bazel.remote.execution.v2.Command], into the
	// `ContentAddressableStorage`.
	//
	// Server implementations MAY modify the
	// `UpdateActionResultRequest.action_result` and return an equivalent value.
	//
	// Errors:
	//
	//   - `INVALID_ARGUMENT`: One or more arguments are invalid.
	//   - `FAILED_PRECONDITION`: One or more errors occurred in updating the
	//     action result, such as a missing command or action.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the
	//     entry to the cache.
	UpdateActionResult(context.Context, *connect.Request[v2.UpdateActionResultRequest]) (*connect.Response[v2.ActionResult], error)
}

ActionCacheHandler is an implementation of the build.bazel.remote.execution.v2.ActionCache service.

type CapabilitiesClient

type CapabilitiesClient interface {
	// GetCapabilities returns the server capabilities configuration of the
	// remote endpoint.
	// Only the capabilities of the services supported by the endpoint will
	// be returned:
	//   - Execution + CAS + Action Cache endpoints should return both
	//     CacheCapabilities and ExecutionCapabilities.
	//   - Execution only endpoints should return ExecutionCapabilities.
	//   - CAS + Action Cache only endpoints should return CacheCapabilities.
	//
	// There are no method-specific errors.
	GetCapabilities(context.Context, *connect.Request[v2.GetCapabilitiesRequest]) (*connect.Response[v2.ServerCapabilities], error)
}

CapabilitiesClient is a client for the build.bazel.remote.execution.v2.Capabilities service.

func NewCapabilitiesClient

func NewCapabilitiesClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CapabilitiesClient

NewCapabilitiesClient constructs a client for the build.bazel.remote.execution.v2.Capabilities service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type CapabilitiesHandler

type CapabilitiesHandler interface {
	// GetCapabilities returns the server capabilities configuration of the
	// remote endpoint.
	// Only the capabilities of the services supported by the endpoint will
	// be returned:
	//   - Execution + CAS + Action Cache endpoints should return both
	//     CacheCapabilities and ExecutionCapabilities.
	//   - Execution only endpoints should return ExecutionCapabilities.
	//   - CAS + Action Cache only endpoints should return CacheCapabilities.
	//
	// There are no method-specific errors.
	GetCapabilities(context.Context, *connect.Request[v2.GetCapabilitiesRequest]) (*connect.Response[v2.ServerCapabilities], error)
}

CapabilitiesHandler is an implementation of the build.bazel.remote.execution.v2.Capabilities service.

type ContentAddressableStorageClient

type ContentAddressableStorageClient interface {
	// Determine if blobs are present in the CAS.
	//
	// Clients can use this API before uploading blobs to determine which ones are
	// already present in the CAS and do not need to be uploaded again.
	//
	// Servers SHOULD increase the lifetimes of the referenced blobs if necessary and
	// applicable.
	//
	// There are no method-specific errors.
	FindMissingBlobs(context.Context, *connect.Request[v2.FindMissingBlobsRequest]) (*connect.Response[v2.FindMissingBlobsResponse], error)
	// Upload many blobs at once.
	//
	// The server may enforce a limit of the combined total size of blobs
	// to be uploaded using this API. This limit may be obtained using the
	// [Capabilities][build.bazel.remote.execution.v2.Capabilities] API.
	// Requests exceeding the limit should either be split into smaller
	// chunks or uploaded using the
	// [ByteStream API][google.bytestream.ByteStream], as appropriate.
	//
	// This request is equivalent to calling a Bytestream `Write` request
	// on each individual blob, in parallel. The requests may succeed or fail
	// independently.
	//
	// Errors:
	//
	//   - `INVALID_ARGUMENT`: The client attempted to upload more than the
	//     server supported limit.
	//
	// Individual requests may return the following errors, additionally:
	//
	// * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob.
	// * `INVALID_ARGUMENT`: The
	// [Digest][build.bazel.remote.execution.v2.Digest] does not match the
	// provided data.
	BatchUpdateBlobs(context.Context, *connect.Request[v2.BatchUpdateBlobsRequest]) (*connect.Response[v2.BatchUpdateBlobsResponse], error)
	// Download many blobs at once.
	//
	// The server may enforce a limit of the combined total size of blobs
	// to be downloaded using this API. This limit may be obtained using the
	// [Capabilities][build.bazel.remote.execution.v2.Capabilities] API.
	// Requests exceeding the limit should either be split into smaller
	// chunks or downloaded using the
	// [ByteStream API][google.bytestream.ByteStream], as appropriate.
	//
	// This request is equivalent to calling a Bytestream `Read` request
	// on each individual blob, in parallel. The requests may succeed or fail
	// independently.
	//
	// Errors:
	//
	//   - `INVALID_ARGUMENT`: The client attempted to read more than the
	//     server supported limit.
	//
	// Every error on individual read will be returned in the corresponding digest
	// status.
	BatchReadBlobs(context.Context, *connect.Request[v2.BatchReadBlobsRequest]) (*connect.Response[v2.BatchReadBlobsResponse], error)
	// Fetch the entire directory tree rooted at a node.
	//
	// This request must be targeted at a
	// [Directory][build.bazel.remote.execution.v2.Directory] stored in the
	// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
	// (CAS). The server will enumerate the `Directory` tree recursively and
	// return every node descended from the root.
	//
	// The GetTreeRequest.page_token parameter can be used to skip ahead in
	// the stream (e.g. when retrying a partially completed and aborted request),
	// by setting it to a value taken from GetTreeResponse.next_page_token of the
	// last successfully processed GetTreeResponse).
	//
	// The exact traversal order is unspecified and, unless retrieving subsequent
	// pages from an earlier request, is not guaranteed to be stable across
	// multiple invocations of `GetTree`.
	//
	// If part of the tree is missing from the CAS, the server will return the
	// portion present and omit the rest.
	//
	// Errors:
	//
	// * `NOT_FOUND`: The requested tree root is not present in the CAS.
	GetTree(context.Context, *connect.Request[v2.GetTreeRequest]) (*connect.ServerStreamForClient[v2.GetTreeResponse], error)
}

ContentAddressableStorageClient is a client for the build.bazel.remote.execution.v2.ContentAddressableStorage service.

func NewContentAddressableStorageClient

func NewContentAddressableStorageClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ContentAddressableStorageClient

NewContentAddressableStorageClient constructs a client for the build.bazel.remote.execution.v2.ContentAddressableStorage service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type ContentAddressableStorageHandler

type ContentAddressableStorageHandler interface {
	// Determine if blobs are present in the CAS.
	//
	// Clients can use this API before uploading blobs to determine which ones are
	// already present in the CAS and do not need to be uploaded again.
	//
	// Servers SHOULD increase the lifetimes of the referenced blobs if necessary and
	// applicable.
	//
	// There are no method-specific errors.
	FindMissingBlobs(context.Context, *connect.Request[v2.FindMissingBlobsRequest]) (*connect.Response[v2.FindMissingBlobsResponse], error)
	// Upload many blobs at once.
	//
	// The server may enforce a limit of the combined total size of blobs
	// to be uploaded using this API. This limit may be obtained using the
	// [Capabilities][build.bazel.remote.execution.v2.Capabilities] API.
	// Requests exceeding the limit should either be split into smaller
	// chunks or uploaded using the
	// [ByteStream API][google.bytestream.ByteStream], as appropriate.
	//
	// This request is equivalent to calling a Bytestream `Write` request
	// on each individual blob, in parallel. The requests may succeed or fail
	// independently.
	//
	// Errors:
	//
	//   - `INVALID_ARGUMENT`: The client attempted to upload more than the
	//     server supported limit.
	//
	// Individual requests may return the following errors, additionally:
	//
	// * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob.
	// * `INVALID_ARGUMENT`: The
	// [Digest][build.bazel.remote.execution.v2.Digest] does not match the
	// provided data.
	BatchUpdateBlobs(context.Context, *connect.Request[v2.BatchUpdateBlobsRequest]) (*connect.Response[v2.BatchUpdateBlobsResponse], error)
	// Download many blobs at once.
	//
	// The server may enforce a limit of the combined total size of blobs
	// to be downloaded using this API. This limit may be obtained using the
	// [Capabilities][build.bazel.remote.execution.v2.Capabilities] API.
	// Requests exceeding the limit should either be split into smaller
	// chunks or downloaded using the
	// [ByteStream API][google.bytestream.ByteStream], as appropriate.
	//
	// This request is equivalent to calling a Bytestream `Read` request
	// on each individual blob, in parallel. The requests may succeed or fail
	// independently.
	//
	// Errors:
	//
	//   - `INVALID_ARGUMENT`: The client attempted to read more than the
	//     server supported limit.
	//
	// Every error on individual read will be returned in the corresponding digest
	// status.
	BatchReadBlobs(context.Context, *connect.Request[v2.BatchReadBlobsRequest]) (*connect.Response[v2.BatchReadBlobsResponse], error)
	// Fetch the entire directory tree rooted at a node.
	//
	// This request must be targeted at a
	// [Directory][build.bazel.remote.execution.v2.Directory] stored in the
	// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]
	// (CAS). The server will enumerate the `Directory` tree recursively and
	// return every node descended from the root.
	//
	// The GetTreeRequest.page_token parameter can be used to skip ahead in
	// the stream (e.g. when retrying a partially completed and aborted request),
	// by setting it to a value taken from GetTreeResponse.next_page_token of the
	// last successfully processed GetTreeResponse).
	//
	// The exact traversal order is unspecified and, unless retrieving subsequent
	// pages from an earlier request, is not guaranteed to be stable across
	// multiple invocations of `GetTree`.
	//
	// If part of the tree is missing from the CAS, the server will return the
	// portion present and omit the rest.
	//
	// Errors:
	//
	// * `NOT_FOUND`: The requested tree root is not present in the CAS.
	GetTree(context.Context, *connect.Request[v2.GetTreeRequest], *connect.ServerStream[v2.GetTreeResponse]) error
}

ContentAddressableStorageHandler is an implementation of the build.bazel.remote.execution.v2.ContentAddressableStorage service.

type ExecutionClient

type ExecutionClient interface {
	// Execute an action remotely.
	//
	// In order to execute an action, the client must first upload all of the
	// inputs, the
	// [Command][build.bazel.remote.execution.v2.Command] to run, and the
	// [Action][build.bazel.remote.execution.v2.Action] into the
	// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
	// It then calls `Execute` with an `action_digest` referring to them. The
	// server will run the action and eventually return the result.
	//
	// The input `Action`'s fields MUST meet the various canonicalization
	// requirements specified in the documentation for their types so that it has
	// the same digest as other logically equivalent `Action`s. The server MAY
	// enforce the requirements and return errors if a non-canonical input is
	// received. It MAY also proceed without verifying some or all of the
	// requirements, such as for performance reasons. If the server does not
	// verify the requirement, then it will treat the `Action` as distinct from
	// another logically equivalent action if they hash differently.
	//
	// Returns a stream of
	// [google.longrunning.Operation][google.longrunning.Operation] messages
	// describing the resulting execution, with eventual `response`
	// [ExecuteResponse][build.bazel.remote.execution.v2.ExecuteResponse]. The
	// `metadata` on the operation is of type
	// [ExecuteOperationMetadata][build.bazel.remote.execution.v2.ExecuteOperationMetadata].
	//
	// If the client remains connected after the first response is returned after
	// the server, then updates are streamed as if the client had called
	// [WaitExecution][build.bazel.remote.execution.v2.Execution.WaitExecution]
	// until the execution completes or the request reaches an error. The
	// operation can also be queried using [Operations
	// API][google.longrunning.Operations.GetOperation].
	//
	// The server NEED NOT implement other methods or functionality of the
	// Operations API.
	//
	// Errors discovered during creation of the `Operation` will be reported
	// as gRPC Status errors, while errors that occurred while running the
	// action will be reported in the `status` field of the `ExecuteResponse`. The
	// server MUST NOT set the `error` field of the `Operation` proto.
	// The possible errors include:
	//
	//   - `INVALID_ARGUMENT`: One or more arguments are invalid.
	//   - `FAILED_PRECONDITION`: One or more errors occurred in setting up the
	//     action requested, such as a missing input or command or no worker being
	//     available. The client may be able to fix the errors and retry.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run
	//     the action.
	//   - `UNAVAILABLE`: Due to a transient condition, such as all workers being
	//     occupied (and the server does not support a queue), the action could not
	//     be started. The client should retry.
	//   - `INTERNAL`: An internal error occurred in the execution engine or the
	//     worker.
	//   - `DEADLINE_EXCEEDED`: The execution timed out.
	//   - `CANCELLED`: The operation was cancelled by the client. This status is
	//     only possible if the server implements the Operations API CancelOperation
	//     method, and it was called for the current execution.
	//
	// In the case of a missing input or command, the server SHOULD additionally
	// send a [PreconditionFailure][google.rpc.PreconditionFailure] error detail
	// where, for each requested blob not present in the CAS, there is a
	// `Violation` with a `type` of `MISSING` and a `subject` of
	// `"blobs/{digest_function/}{hash}/{size}"` indicating the digest of the
	// missing blob. The `subject` is formatted the same way as the
	// `resource_name` provided to
	// [ByteStream.Read][google.bytestream.ByteStream.Read], with the leading
	// instance name omitted. `digest_function` MUST thus be omitted if its value
	// is one of MD5, MURMUR3, SHA1, SHA256, SHA384, SHA512, or VSO.
	//
	// The server does not need to guarantee that a call to this method leads to
	// at most one execution of the action. The server MAY execute the action
	// multiple times, potentially in parallel. These redundant executions MAY
	// continue to run, even if the operation is completed.
	Execute(context.Context, *connect.Request[v2.ExecuteRequest]) (*connect.ServerStreamForClient[longrunningpb.Operation], error)
	// Wait for an execution operation to complete. When the client initially
	// makes the request, the server immediately responds with the current status
	// of the execution. The server will leave the request stream open until the
	// operation completes, and then respond with the completed operation. The
	// server MAY choose to stream additional updates as execution progresses,
	// such as to provide an update as to the state of the execution.
	WaitExecution(context.Context, *connect.Request[v2.WaitExecutionRequest]) (*connect.ServerStreamForClient[longrunningpb.Operation], error)
}

ExecutionClient is a client for the build.bazel.remote.execution.v2.Execution service.

func NewExecutionClient

func NewExecutionClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ExecutionClient

NewExecutionClient constructs a client for the build.bazel.remote.execution.v2.Execution service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type ExecutionHandler

type ExecutionHandler interface {
	// Execute an action remotely.
	//
	// In order to execute an action, the client must first upload all of the
	// inputs, the
	// [Command][build.bazel.remote.execution.v2.Command] to run, and the
	// [Action][build.bazel.remote.execution.v2.Action] into the
	// [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage].
	// It then calls `Execute` with an `action_digest` referring to them. The
	// server will run the action and eventually return the result.
	//
	// The input `Action`'s fields MUST meet the various canonicalization
	// requirements specified in the documentation for their types so that it has
	// the same digest as other logically equivalent `Action`s. The server MAY
	// enforce the requirements and return errors if a non-canonical input is
	// received. It MAY also proceed without verifying some or all of the
	// requirements, such as for performance reasons. If the server does not
	// verify the requirement, then it will treat the `Action` as distinct from
	// another logically equivalent action if they hash differently.
	//
	// Returns a stream of
	// [google.longrunning.Operation][google.longrunning.Operation] messages
	// describing the resulting execution, with eventual `response`
	// [ExecuteResponse][build.bazel.remote.execution.v2.ExecuteResponse]. The
	// `metadata` on the operation is of type
	// [ExecuteOperationMetadata][build.bazel.remote.execution.v2.ExecuteOperationMetadata].
	//
	// If the client remains connected after the first response is returned after
	// the server, then updates are streamed as if the client had called
	// [WaitExecution][build.bazel.remote.execution.v2.Execution.WaitExecution]
	// until the execution completes or the request reaches an error. The
	// operation can also be queried using [Operations
	// API][google.longrunning.Operations.GetOperation].
	//
	// The server NEED NOT implement other methods or functionality of the
	// Operations API.
	//
	// Errors discovered during creation of the `Operation` will be reported
	// as gRPC Status errors, while errors that occurred while running the
	// action will be reported in the `status` field of the `ExecuteResponse`. The
	// server MUST NOT set the `error` field of the `Operation` proto.
	// The possible errors include:
	//
	//   - `INVALID_ARGUMENT`: One or more arguments are invalid.
	//   - `FAILED_PRECONDITION`: One or more errors occurred in setting up the
	//     action requested, such as a missing input or command or no worker being
	//     available. The client may be able to fix the errors and retry.
	//   - `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run
	//     the action.
	//   - `UNAVAILABLE`: Due to a transient condition, such as all workers being
	//     occupied (and the server does not support a queue), the action could not
	//     be started. The client should retry.
	//   - `INTERNAL`: An internal error occurred in the execution engine or the
	//     worker.
	//   - `DEADLINE_EXCEEDED`: The execution timed out.
	//   - `CANCELLED`: The operation was cancelled by the client. This status is
	//     only possible if the server implements the Operations API CancelOperation
	//     method, and it was called for the current execution.
	//
	// In the case of a missing input or command, the server SHOULD additionally
	// send a [PreconditionFailure][google.rpc.PreconditionFailure] error detail
	// where, for each requested blob not present in the CAS, there is a
	// `Violation` with a `type` of `MISSING` and a `subject` of
	// `"blobs/{digest_function/}{hash}/{size}"` indicating the digest of the
	// missing blob. The `subject` is formatted the same way as the
	// `resource_name` provided to
	// [ByteStream.Read][google.bytestream.ByteStream.Read], with the leading
	// instance name omitted. `digest_function` MUST thus be omitted if its value
	// is one of MD5, MURMUR3, SHA1, SHA256, SHA384, SHA512, or VSO.
	//
	// The server does not need to guarantee that a call to this method leads to
	// at most one execution of the action. The server MAY execute the action
	// multiple times, potentially in parallel. These redundant executions MAY
	// continue to run, even if the operation is completed.
	Execute(context.Context, *connect.Request[v2.ExecuteRequest], *connect.ServerStream[longrunningpb.Operation]) error
	// Wait for an execution operation to complete. When the client initially
	// makes the request, the server immediately responds with the current status
	// of the execution. The server will leave the request stream open until the
	// operation completes, and then respond with the completed operation. The
	// server MAY choose to stream additional updates as execution progresses,
	// such as to provide an update as to the state of the execution.
	WaitExecution(context.Context, *connect.Request[v2.WaitExecutionRequest], *connect.ServerStream[longrunningpb.Operation]) error
}

ExecutionHandler is an implementation of the build.bazel.remote.execution.v2.Execution service.

type UnimplementedActionCacheHandler

type UnimplementedActionCacheHandler struct{}

UnimplementedActionCacheHandler returns CodeUnimplemented from all methods.

func (UnimplementedActionCacheHandler) GetActionResult

func (UnimplementedActionCacheHandler) UpdateActionResult

type UnimplementedCapabilitiesHandler

type UnimplementedCapabilitiesHandler struct{}

UnimplementedCapabilitiesHandler returns CodeUnimplemented from all methods.

func (UnimplementedCapabilitiesHandler) GetCapabilities

type UnimplementedContentAddressableStorageHandler

type UnimplementedContentAddressableStorageHandler struct{}

UnimplementedContentAddressableStorageHandler returns CodeUnimplemented from all methods.

func (UnimplementedContentAddressableStorageHandler) BatchReadBlobs

func (UnimplementedContentAddressableStorageHandler) BatchUpdateBlobs

func (UnimplementedContentAddressableStorageHandler) FindMissingBlobs

func (UnimplementedContentAddressableStorageHandler) GetTree

type UnimplementedExecutionHandler

type UnimplementedExecutionHandler struct{}

UnimplementedExecutionHandler returns CodeUnimplemented from all methods.

func (UnimplementedExecutionHandler) Execute

func (UnimplementedExecutionHandler) WaitExecution

Source Files

  • remote_execution.connect.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL