class_docstr: TFX runner on Kubernetes.
class_docstr_tok: ["TFX","runner","on","Kubernetes","."]
docstr: Wrapper for container component.
  
  Args:
    component: Component to be executed.
    component_launcher_class: The class of the launcher to launch the
      component.
    component_config: component config to launch the component.
    pipeline: Logical pipeline that contains pipeline related information.
  
  Returns:
    A container component that runs the wrapped component upon execution.
docstr_tok: ["Wrapper","for","container","component",".","Args",":","component",":","Component","to","be","executed",".","component_launcher_class",":","The","class","of","the","launcher","to","launch","the","component",".","component_config",":","component","config","to","launch","the","component",".","pipeline",":","Logical","pipeline","that","contains","pipeline","related","information",".","Returns",":","A","container","component","that","runs","the","wrapped","component","upon","execution","."]
code: def _wrap_container_component(
      self,
      component: base_node.BaseNode,
      component_launcher_class: Type[
          base_component_launcher.BaseComponentLauncher
      ],
      component_config: Optional[
          base_component_config.BaseComponentConfig
      ],
      pipeline: tfx_pipeline.Pipeline,
  ) -> base_node.BaseNode:
      """Wrapper for container component.
  
      Args:
        component: Component to be executed.
        component_launcher_class: The class of the launcher to launch the
          component.
        component_config: component config to launch the component.
        pipeline: Logical pipeline that contains pipeline related information.
  
      Returns:
        A container component that runs the wrapped component upon execution.
      """
  
      component_launcher_class_path = name_utils.get_full_name(
          component_launcher_class
      )
  
      serialized_component = json_utils.dumps(
          node_wrapper.NodeWrapper(component)
      )
  
      arguments = [
          "--pipeline_name",
          pipeline.pipeline_info.pipeline_name,
          "--pipeline_root",
          pipeline.pipeline_info.pipeline_root,
          "--run_id",
          pipeline.pipeline_info.run_id,
          "--metadata_config",
          json_format.MessageToJson(
              message=get_default_kubernetes_metadata_config(),
              preserving_proto_field_name=True,
          ),
          "--beam_pipeline_args",
          json.dumps(pipeline.beam_pipeline_args),
          "--additional_pipeline_args",
          json.dumps(pipeline.additional_pipeline_args),
          "--component_launcher_class_path",
          component_launcher_class_path,
          "--serialized_component",
          serialized_component,
          "--component_config",
          json_utils.dumps(component_config),
      ]
  
      # Outputs/Parameters fields are not used as they are contained in
      # the serialized component.
      return container_component.create_container_component(
          name=component.__class__.__name__,
          outputs={},
          parameters={},
          image=self._config.tfx_image,
          command=_CONTAINER_COMMAND + arguments,
      )().with_id(component.id + _WRAPPER_SUFFIX)
  
imports: import datetime
  import json
  from typing import List, Optional, Type
  from absl import logging
  from tfx.dsl.component.experimental import container_component
  from tfx.dsl.components.base import base_node
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.orchestration import pipeline
  from tfx.orchestration import tfx_runner
  from tfx.orchestration.config import base_component_config
  from tfx.orchestration.config import config_utils
  from tfx.orchestration.config import pipeline_config
  from tfx.orchestration.experimental.kubernetes import kubernetes_remote_runner
  from tfx.orchestration.experimental.kubernetes import node_wrapper
  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.utils import json_utils
  from tfx.utils import kube_utils
  from tfx.utils import name_utils
  from google.protobuf import json_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling the KubernetesDagRunner obj's underlying member method code with example usage: obj._wrap_container_component(component, component_launcher_class, component_config, pipeline) and returns: container_component