buildgrid.server.server module

class buildgrid.server.server.Server(max_workers=None, monitor=False, mon_endpoint_type=<MonitoringOutputType.STDOUT: 'stdout'>, mon_endpoint_location=None, mon_serialisation_format=<MonitoringOutputFormat.JSON: 'json'>, mon_metric_prefix='', auth_method=<AuthMetadataMethod.NONE: 'none'>, auth_secret=None, auth_algorithm=<AuthMetadataAlgorithm.UNSPECIFIED: 'unspecified'>, enable_server_reflection=True)

Bases: object

Creates a BuildGrid server instance.

The Server class binds together all the gRPC services.

start(*, on_server_start_cb=None)

Starts the BuildGrid server.

stop()

Stops the BuildGrid server.

add_port(address, credentials)

Adds a port to the server.

Must be called before the server starts. If a credentials object exists, it will make a secure port.

Parameters
  • address (str) – The address with port number.

  • credentials (grpc.ChannelCredentials) – Credentials object.

Returns

Number of the bound port.

Return type

int

Raises

PermissionDeniedError – If socket binding fails.

add_execution_instance(instance, instance_name)

Adds an ExecutionInstance to the service.

If no service exists, it creates one.

Parameters
  • instance (ExecutionInstance) – Instance to add.

  • instance_name (str) – Instance name.

add_bots_interface(instance, instance_name)

Adds a BotsInterface to the service.

If no service exists, it creates one.

Parameters
  • instance (BotsInterface) – Instance to add.

  • instance_name (str) – Instance name.

add_operations_instance(instance, instance_name)

Adds an OperationsInstance to the service.

If no service exists, it creates one.

Parameters
  • instance (OperationsInstance) – Instance to add.

  • instance_name (str) – Instance name.

add_reference_storage_instance(instance, instance_name)

Adds a ReferenceCache to the service.

If no service exists, it creates one.

Parameters
  • instance (ReferenceCache) – Instance to add.

  • instance_name (str) – Instance name.

add_action_cache_instance(instance, instance_name)

Adds a ReferenceCache to the service.

If no service exists, it creates one.

Parameters
  • instance (ReferenceCache) – Instance to add.

  • instance_name (str) – Instance name.

add_cas_instance(instance, instance_name)

Adds a ContentAddressableStorageInstance to the service.

If no service exists, it creates one.

Parameters
  • instance (ReferenceCache) – Instance to add.

  • instance_name (str) – Instance name.

add_bytestream_instance(instance, instance_name)

Adds a ByteStreamInstance to the service.

If no service exists, it creates one.

Parameters
  • instance (ByteStreamInstance) – Instance to add.

  • instance_name (str) – Instance name.

property is_instrumented