buildgrid.server.execution.service module

ExecutionService

Serves remote execution requests.

class buildgrid.server.execution.service.ExecutionService(monitor: bool = False)

Bases: ExecutionServicer, InstancedServicer[ExecutionInstance]

REGISTER_METHOD(server)
FULL_NAME: ClassVar[str] = 'build.bazel.remote.execution.v2.Execution'

The full name of the servicer, used to match instances to the servicer and configure reflection. This value should be declared on the class of any Servicer implementations.

add_instance(name: str, instance: ExecutionInstance) None

Registers a new servicer instance.

Parameters:
  • name (str) – The new instance’s name.

  • instance (ExecutionInstance) – The new instance itself.

get_scheduler(instance_name: str) Scheduler

Retrieves a reference to the scheduler for an instance.

Parameters:

instance_name (str) – The name of the instance to query.

Returns:

A reference to the scheduler for instance_name.

Return type:

Scheduler

Raises:

InvalidArgumentError – If no instance named instance_name exists.

Execute(request: ExecuteRequest, context: ServicerContext) Iterator[Operation]

Handles ExecuteRequest messages.

Parameters:
  • request (ExecuteRequest) – The incoming RPC request.

  • context (grpc.ServicerContext) – Context for the RPC call.

WaitExecution(request: WaitExecutionRequest, context: ServicerContext) Iterator[Operation]

Handles WaitExecutionRequest messages.

Parameters:
  • request (WaitExecutionRequest) – The incoming RPC request.

  • context (grpc.ServicerContext) – Context for the RPC call.

property is_instrumented: bool
query_n_clients() int
query_n_clients_for_instance(instance_name: str) int