class_docstr: Kubeflow pipelines task builder.
  
  Constructs a pipeline task spec based on the TFX node information. Meanwhile,
  augments the deployment config associated with the node.
docstr: Creates a StepBuilder object.
  
  A StepBuilder takes in a TFX node object (usually it's a component/resolver/
  importer), together with other configuration (e.g., TFX image, beam args).
  Then, step_builder.build() outputs the StepSpec pb object.
  
  Args:
    node: A TFX node. The logical unit of a step. Note, currently for resolver
      node we only support two types of resolver policies, including: 1)
      latest blessed model, and 2) latest model artifact.
    deployment_config: The deployment config in Kubeflow IR to be populated.
    component_defs: Dict mapping from node id to compiled ComponetSpec proto.
      Items in the dict will get updated as the pipeline is built.
    dsl_context_reg: A DslContextRegistry instance from
      Pipeline.dsl_context_registry.
    dynamic_exec_properties: A dictionary mapping upstream component output
      names to types used to resolve Placeholder authoring in downstream
      components.
    image: TFX image used in the underlying container spec. Required if node
      is a TFX component.
    image_cmds: Optional. If not specified the default `ENTRYPOINT` defined in
      the docker image will be used. Note: the commands here refers to the K8S
      container command, which maps to Docker entrypoint field. If one
      supplies command but no args are provided for the container, the
      container will be invoked with the provided command, ignoring the
      `ENTRYPOINT` and `CMD` defined in the Dockerfile. One can find more
      details regarding the difference between K8S and Docker conventions at
      https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes
    beam_pipeline_args: Pipeline arguments for Beam powered Components.
    enable_cache: If true, enables cache lookup for this pipeline step.
      Defaults to False.
    pipeline_info: Optionally, the pipeline info associated with current
      pipeline. The pipeline context is required if the current node is a
      resolver. Defaults to None.
    channel_redirect_map: Map from (producer component id, output key) to (new
      producer component id, output key). This is needed for cases where one
      DSL node is splitted into multiple tasks in pipeline API proto. For
      example, latest blessed model resolver.
    is_exit_handler: Marking whether the task is for exit handler.
  
  Raises:
    ValueError: On the following two cases:
      1. The node being built is an instance of BaseComponent but image was
         not provided.
      2. The node being built is a Resolver but the associated pipeline
         info was not provided.
docstr_tok: ["Creates","a","StepBuilder","object",".","A","StepBuilder","takes","in","a","TFX","node","object","(","usually","it","'s","a","component\/resolver\/","importer",")",",","together","with","other","configuration","(","e.g.",",","TFX","image",",","beam","args",")",".","Then",",","step_builder.build","(",")","outputs","the","StepSpec","pb","object",".","Args",":","node",":","A","TFX","node",".","The","logical","unit","of","a","step",".","Note",",","currently","for","resolver","node","we","only","support","two","types","of","resolver","policies",",","including",":","1",")","latest","blessed","model",",","and","2",")","latest","model","artifact",".","deployment_config",":","The","deployment","config","in","Kubeflow","IR","to","be","populated",".","component_defs",":","Dict","mapping","from","node","id","to","compiled","ComponetSpec","proto",".","Items","in","the","dict","will","get","updated","as","the","pipeline","is","built",".","dsl_context_reg",":","A","DslContextRegistry","instance","from","Pipeline.dsl_context_registry",".","dynamic_exec_properties",":","A","dictionary","mapping","upstream","component","output","names","to","types","used","to","resolve","Placeholder","authoring","in","downstream","components",".","image",":","TFX","image","used","in","the","underlying","container","spec",".","Required","if","node","is","a","TFX","component",".","image_cmds",":","Optional",".","If","not","specified","the","default","`","ENTRYPOINT","`","defined","in","the","docker","image","will","be","used",".","Note",":","the","commands","here","refers","to","the","K8S","container","command",",","which","maps","to","Docker","entrypoint","field",".","If","one","supplies","command","but","no","args","are","provided","for","the","container",",","the","container","will","be","invoked","with","the","provided","command",",","ignoring","the","`","ENTRYPOINT","`","and","`","CMD","`","defined","in","the","Dockerfile",".","One","can","find","more","details","regarding","the","difference","between","K8S","and","Docker","conventions","at","https",":","\/\/kubernetes.io\/docs\/tasks\/inject-data-application\/define-command-argument-container\/","#","notes","beam_pipeline_args",":","Pipeline","arguments","for","Beam","powered","Components",".","enable_cache",":","If","true",",","enables","cache","lookup","for","this","pipeline","step",".","Defaults","to","False",".","pipeline_info",":","Optionally",",","the","pipeline","info","associated","with","current","pipeline",".","The","pipeline","context","is","required","if","the","current","node","is","a","resolver",".","Defaults","to","None",".","channel_redirect_map",":","Map","from","(","producer","component","id",",","output","key",")","to","(","new","producer","component","id",",","output","key",")",".","This","is","needed","for","cases","where","one","DSL","node","is","splitted","into","multiple","tasks","in","pipeline","API","proto",".","For","example",",","latest","blessed","model","resolver",".","is_exit_handler",":","Marking","whether","the","task","is","for","exit","handler",".","Raises",":","ValueError",":","On","the","following","two","cases",":","1",".","The","node","being","built","is","an","instance","of","BaseComponent","but","image","was","not","provided",".","2",".","The","node","being","built","is","a","Resolver","but","the","associated","pipeline","info","was","not","provided","."]
code: def __init__(
      self,
      node: base_node.BaseNode,
      deployment_config: pipeline_pb2.PipelineDeploymentConfig,
      component_defs: Dict[str, pipeline_pb2.ComponentSpec],
      dsl_context_reg: dsl_context_registry.DslContextRegistry,
      dynamic_exec_properties: Optional[
          Dict[Tuple[str, str], str]
      ] = None,
      image: Optional[str] = None,
      image_cmds: Optional[List[str]] = None,
      beam_pipeline_args: Optional[List[str]] = None,
      enable_cache: bool = False,
      pipeline_info: Optional[data_types.PipelineInfo] = None,
      channel_redirect_map: Optional[Dict[Tuple[str, str], str]] = None,
      is_exit_handler: bool = False,
  ):
      """Creates a StepBuilder object.
  
      A StepBuilder takes in a TFX node object (usually it's a component/resolver/
      importer), together with other configuration (e.g., TFX image, beam args).
      Then, step_builder.build() outputs the StepSpec pb object.
  
      Args:
        node: A TFX node. The logical unit of a step. Note, currently for resolver
          node we only support two types of resolver policies, including: 1)
          latest blessed model, and 2) latest model artifact.
        deployment_config: The deployment config in Kubeflow IR to be populated.
        component_defs: Dict mapping from node id to compiled ComponetSpec proto.
          Items in the dict will get updated as the pipeline is built.
        dsl_context_reg: A DslContextRegistry instance from
          Pipeline.dsl_context_registry.
        dynamic_exec_properties: A dictionary mapping upstream component output
          names to types used to resolve Placeholder authoring in downstream
          components.
        image: TFX image used in the underlying container spec. Required if node
          is a TFX component.
        image_cmds: Optional. If not specified the default `ENTRYPOINT` defined in
          the docker image will be used. Note: the commands here refers to the K8S
          container command, which maps to Docker entrypoint field. If one
          supplies command but no args are provided for the container, the
          container will be invoked with the provided command, ignoring the
          `ENTRYPOINT` and `CMD` defined in the Dockerfile. One can find more
          details regarding the difference between K8S and Docker conventions at
          https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes
        beam_pipeline_args: Pipeline arguments for Beam powered Components.
        enable_cache: If true, enables cache lookup for this pipeline step.
          Defaults to False.
        pipeline_info: Optionally, the pipeline info associated with current
          pipeline. The pipeline context is required if the current node is a
          resolver. Defaults to None.
        channel_redirect_map: Map from (producer component id, output key) to (new
          producer component id, output key). This is needed for cases where one
          DSL node is splitted into multiple tasks in pipeline API proto. For
          example, latest blessed model resolver.
        is_exit_handler: Marking whether the task is for exit handler.
  
      Raises:
        ValueError: On the following two cases:
          1. The node being built is an instance of BaseComponent but image was
             not provided.
          2. The node being built is a Resolver but the associated pipeline
             info was not provided.
      """
      self._name = node.id
      self._node = node
      self._deployment_config = deployment_config
      self._component_defs = component_defs
      self._dynamic_exec_properties = dynamic_exec_properties
      self._dsl_context_registry = dsl_context_reg
      self._inputs = node.inputs
      self._outputs = node.outputs
      self._enable_cache = enable_cache
      self._is_exit_handler = is_exit_handler
      if channel_redirect_map is None:
          self._channel_redirect_map = {}
      else:
          self._channel_redirect_map = channel_redirect_map
  
      self._exec_properties = node.exec_properties
  
      if (
          isinstance(self._node, base_component.BaseComponent)
          and not image
      ):
          raise ValueError(
              "TFX image is required for component of type %s"
              % type(self._node)
          )
      if (
          isinstance(self._node, resolver.Resolver)
          and not pipeline_info
      ):
          raise ValueError("pipeline_info is needed for resolver node.")
  
      self._tfx_image = image
      self._image_cmds = image_cmds
      self._beam_pipeline_args = beam_pipeline_args or []
      if isinstance(
          self._node.executor_spec, executor_spec.BeamExecutorSpec
      ):
          self._beam_pipeline_args = (
              self._node.executor_spec.beam_pipeline_args
          )
      self._pipeline_info = pipeline_info
  
imports: import itertools
  from typing import Any, Dict, List, Optional, Tuple, cast
  from absl import logging
  from kfp.pipeline_spec import pipeline_spec_pb2
  from tfx import components
  from tfx.components.evaluator import constants
  from tfx.dsl.compiler import compiler_utils
  from tfx.dsl.component.experimental import executor_specs
  from tfx.dsl.component.experimental import placeholders
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_node
  from tfx.dsl.components.base import executor_spec
  from tfx.dsl.components.common import importer
  from tfx.dsl.components.common import resolver
  from tfx.dsl.context_managers import dsl_context_registry
  from tfx.dsl.experimental.conditionals import conditional
  from tfx.dsl.input_resolution.strategies import latest_artifact_strategy
  from tfx.dsl.input_resolution.strategies import latest_blessed_model_strategy
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types
  from tfx.orchestration.kubeflow import decorators
  from tfx.orchestration.kubeflow import utils
  from tfx.orchestration.kubeflow.v2 import compiler_utils
  from tfx.orchestration.kubeflow.v2 import parameter_utils
  from tfx.types import channel_utils
  from tfx.types import standard_artifacts
  from tfx.types.channel import Channel
  from tfx.utils import deprecation_utils
  from tfx.utils import name_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 to create a new StepBuilder object  with example: obj = StepBuilder(node, deployment_config, component_defs, dsl_context_reg, dynamic_exec_properties, image, image_cmds, beam_pipeline_args, enable_cache, pipeline_info, channel_redirect_map, is_exit_handler)