execution

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Bazel Remote Execution API gRPC server Contains limited implementation of the Execution API interface

Index

Constants

View Source
const (
	TaskIDPrefix   = "Bazel_ExecuteRequest"
	CommandDefault = "BZ_PLACEHOLDER"
)

Variables

This section is empty.

Functions

func CancelOperation

func CancelOperation(r dialer.Resolver, name string) (*empty.Empty, error)

Make a CancelOperation request against a server support the google.longrunning.operations API Takes a Resolver and name of the Operation to Cancel

func Execute

func Execute(r dialer.Resolver, actionDigest *remoteexecution.Digest, skipCache bool) (*longrunning.Operation, error)

Makes an Execute request against a server supporting the google.devtools.remoteexecution API Takes a Resolver and ExecuteRequest data. Currently supported: * ActionDigest * SkipCache TBD support for: * Misc specs: InstanceName, Policies

func ExecuteOperationToStr

func ExecuteOperationToStr(op *longrunning.Operation) string

String conversion for human consumption of Operation's nested data

func ExtractOpFromJson

func ExtractOpFromJson(opBytes []byte) (*longrunning.Operation, error)

TODO - used by bazel-integration, may be possible to replace with OperationToJson via bzutil and remove this JSON unmarshalling doesn't work for Operations with nested Results, as they're of unexported type isOperation_Result. Thus, we need custom unmarshalling logic.

func GetOperation

func GetOperation(r dialer.Resolver, name string) (*longrunning.Operation, error)

Make a GetOperation request against a server supporting the google.longrunning.operations API Takes a Resolver and name of the Operation to Get

func MakeExecutionServer

func MakeExecutionServer(gc *bazel.GRPCConfig, s server.Scheduler, stat stats.StatsReceiver) *executionServer

Creates a new GRPCServer (executionServer) based on a GRPC config, scheduler, and stats, and preregisters the service

func OperationToJson

func OperationToJson(op *longrunning.Operation) ([]byte, error)

Converts a longrunning.Operation to a Json-encoded []byte. Because an Operation's Result field is not natively compatible with json.Marshal, this does the minimum necessary extraction of nested data and wrapping with custom types so that it can be used with Marshal.

func ParseExecuteOperation

Parse a generic longrunning.Operation structure into expected Execution API components. Deserializes Operation.Metadata as an ExecuteOperationMetadata always. Checks for Operation.Result as a Response and if found deserializes as an ExecuteResponse. Per Bazel API, does not check for Operation.Result as a GRPC Status/Error - not allowed.

Types

This section is empty.

Directories

Path Synopsis
Execution Request & Action Result Definitions Domain structures for tracking ExecuteRequest info (use cases include Scheduler JobDefs and Worker RunCommands), ActionResult info (used in Worker RunStatuses), and conversions for internal thrift APIs.
Execution Request & Action Result Definitions Domain structures for tracking ExecuteRequest info (use cases include Scheduler JobDefs and Worker RunCommands), ActionResult info (used in Worker RunStatuses), and conversions for internal thrift APIs.
Package mock_longrunning is a generated GoMock package.
Package mock_longrunning is a generated GoMock package.
Package mock_remoteexecution is a generated GoMock package.
Package mock_remoteexecution is a generated GoMock package.

Jump to

Keyboard shortcuts

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