Registration is open for TensorFlow Dev Summit 2020 Learn more

tfx.orchestration.launcher.docker_component_launcher.DockerComponentLauncher

View source on GitHub

Class DockerComponentLauncher

Responsible for launching a container executor.

Inherits From: BaseComponentLauncher

__init__

View source

__init__(
    component,
    pipeline_info,
    driver_args,
    metadata_connection_config,
    beam_pipeline_args,
    additional_pipeline_args,
    component_config=None
)

Initialize a BaseComponentLauncher.

Args:

  • component: The Tfx node to launch.
  • pipeline_info: An instance of data_types.PipelineInfo that holds pipeline properties.
  • driver_args: An instance of data_types.DriverArgs that holds component specific driver args.
  • metadata_connection_config: ML metadata connection config.
  • beam_pipeline_args: Beam pipeline args for beam jobs within executor.
  • additional_pipeline_args: Additional pipeline args.
  • component_config: Optional component specific config to instrument launcher on how to launch a component.

Raises:

  • ValueError: when component and component_config are not launchable by the launcher.

Methods

can_launch

View source

@classmethod
can_launch(
    cls,
    component_executor_spec,
    component_config
)

Checks if the launcher can launch the executor spec.

create

View source

create(
    cls,
    component,
    pipeline_info,
    driver_args,
    metadata_connection_config,
    beam_pipeline_args,
    additional_pipeline_args,
    component_config=None
)

Initialize a ComponentLauncher directly from a BaseComponent instance.

This class method is the contract between TfxRunner and BaseComponentLauncher to support launcher polymorphism. Sublcass of this class must make sure it can be initialized by the method.

Args:

  • component: The component to launch.
  • pipeline_info: An instance of data_types.PipelineInfo that holds pipeline properties.
  • driver_args: An instance of data_types.DriverArgs that holds component specific driver args.
  • metadata_connection_config: ML metadata connection config.
  • beam_pipeline_args: Beam pipeline args for beam jobs within executor.
  • additional_pipeline_args: Additional pipeline args.
  • component_config: Optional component specific config to instrument launcher on how to launch a component.

Returns:

A new instance of component launcher.

launch

View source

launch()

Execute the component, includes driver, executor and publisher.

Returns:

The execution decision of the launch.