class_docstr: Kubeflow Pipelines runner.
  
  Constructs a pipeline definition YAML file based on the TFX logical pipeline.
class_docstr_tok: ["Kubeflow","Pipelines","runner",".","Constructs","a","pipeline","definition","YAML","file","based","on","the","TFX","logical","pipeline","."]
docstr: Compiles and outputs a Kubeflow Pipeline YAML definition file.
  
  Args:
    pipeline: The logical TFX pipeline to use when building the Kubeflow
      pipeline.
docstr_tok: ["Compiles","and","outputs","a","Kubeflow","Pipeline","YAML","definition","file",".","Args",":","pipeline",":","The","logical","TFX","pipeline","to","use","when","building","the","Kubeflow","pipeline","."]
code: def run(self, pipeline: tfx_pipeline.Pipeline):
      """Compiles and outputs a Kubeflow Pipeline YAML definition file.
  
      Args:
        pipeline: The logical TFX pipeline to use when building the Kubeflow
          pipeline.
      """
      # If exit handler is defined, append to existing pipeline components.
      if self._exit_handler:
          original_pipeline = pipeline
          pipeline = copy.copy(original_pipeline)
          pipeline.components.append(self._exit_handler)
  
      for component in pipeline.components:
          # TODO(b/187122662): Pass through pip dependencies as a first-class
          # component flag.
          if isinstance(component, tfx_base_component.BaseComponent):
              component._resolve_pip_dependencies(  # pylint: disable=protected-access
                  pipeline.pipeline_info.pipeline_root
              )
  
      # KFP DSL representation of pipeline root parameter.
      dsl_pipeline_root = dsl.PipelineParam(
          name=tfx_pipeline.ROOT_PARAMETER.name,
          value=pipeline.pipeline_info.pipeline_root,
      )
      self._params.append(dsl_pipeline_root)
  
      def _construct_pipeline():
          """Constructs a Kubeflow pipeline.
  
          Creates Kubeflow ContainerOps for each TFX component encountered in the
          logical pipeline definition.
          """
          self._construct_pipeline_graph(pipeline, dsl_pipeline_root)
  
      # Need to run this first to get self._params populated. Then KFP compiler
      # can correctly match default value with PipelineParam.
      self._parse_parameter_from_pipeline(pipeline)
  
      file_name = self._output_filename or get_default_output_filename(
          pipeline.pipeline_info.pipeline_name
      )
      # Create workflow spec and write out to package.
      self._compiler._create_and_write_workflow(  # pylint: disable=protected-access
          pipeline_func=_construct_pipeline,
          pipeline_name=pipeline.pipeline_info.pipeline_name,
          params_list=self._params,
          package_path=os.path.join(self._output_dir, file_name),
      )
  
imports: import collections
  import copy
  import os
  from typing import Any, Callable, Dict, List, Optional, Type, cast, MutableMapping
  from absl import logging
  from kfp import compiler
  from kfp import dsl
  from kfp import gcp
  from kubernetes import client
  from tfx import version
  from tfx.dsl.compiler import compiler
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_node
  from tfx.orchestration import data_types
  from tfx.orchestration import pipeline
  from tfx.orchestration import tfx_runner
  from tfx.orchestration.config import pipeline_config
  from tfx.orchestration.kubeflow import base_component
  from tfx.orchestration.kubeflow import utils
  from tfx.orchestration.kubeflow.proto import kubeflow_pb2
  from tfx.orchestration.launcher import base_component_launcher
  from tfx.orchestration.launcher import in_process_component_launcher
  from tfx.orchestration.launcher import kubernetes_component_launcher
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import telemetry_utils
label_desc: Use image node_id 8 for calling the KubeflowDagRunner obj's underlying member method code with example usage: obj.run(pipeline) without return types