Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tfx.orchestration.launcher.base_component_launcher.BaseComponentLauncher

View source on GitHub

Responsible for launching driver, executor and publisher of component.

tfx.orchestration.launcher.base_component_launcher.BaseComponentLauncher(
    component, pipeline_info, driver_args, metadata_connection, beam_pipeline_args,
    additional_pipeline_args, component_config=None
)

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: ML metadata connection. The connection is expected to not be opened when given to this object.
  • 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 with an optional component config.

create

View source

@classmethod
create(
    cls, component, pipeline_info, driver_args, metadata_connection,
    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: ML metadata connection. The connection is expected to not be opened when given to this object.
  • 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.