class_docstr: Class for interacting with CAIP CMLE job.
class_docstr_tok: ["Class","for","interacting","with","CAIP","CMLE","job","."]
docstr: Get training args for runner._launch_aip_training.
  
  The training args contain the inputs/outputs/exec_properties to the
  tfx.scripts.run_executor module.
  
  Args:
    input_dict: Passthrough input dict for tfx.components.Trainer.executor.
    output_dict: Passthrough input dict for tfx.components.Trainer.executor.
    exec_properties: Passthrough input dict for
      tfx.components.Trainer.executor.
    executor_class_path: class path for TFX core default trainer.
    job_args: Training input argument for AI Platform training job.
      'pythonModule', 'pythonVersion' and 'runtimeVersion' will be inferred.
      For the full set of parameters, refer to
      https://cloud.google.com/ml-engine/reference/rest/v1/projects.jobs#TrainingInput
    job_id: Job ID for AI Platform Training job. If not supplied,
      system-determined unique ID is given. Refer to
    https://cloud.google.com/ml-engine/reference/rest/v1/projects.jobs#resource-job
    job_labels: Labels for AI Platform training job.
  
  Returns:
    A dict containing the training arguments
docstr_tok: ["Get","training","args","for","runner._launch_aip_training",".","The","training","args","contain","the","inputs\/outputs\/exec_properties","to","the","tfx.scripts.run_executor","module",".","Args",":","input_dict",":","Passthrough","input","dict","for","tfx.components.Trainer.executor",".","output_dict",":","Passthrough","input","dict","for","tfx.components.Trainer.executor",".","exec_properties",":","Passthrough","input","dict","for","tfx.components.Trainer.executor",".","executor_class_path",":","class","path","for","TFX","core","default","trainer",".","job_args",":","Training","input","argument","for","AI","Platform","training","job",".","'pythonModule","'",",","'pythonVersion","'","and","'runtimeVersion","'","will","be","inferred",".","For","the","full","set","of","parameters",",","refer","to","https",":","\/\/cloud.google.com\/ml-engine\/reference\/rest\/v1\/projects.jobs","#","TrainingInput","job_id",":","Job","ID","for","AI","Platform","Training","job",".","If","not","supplied",",","system-determined","unique","ID","is","given",".","Refer","to","https",":","\/\/cloud.google.com\/ml-engine\/reference\/rest\/v1\/projects.jobs","#","resource-job","job_labels",":","Labels","for","AI","Platform","training","job",".","Returns",":","A","dict","containing","the","training","arguments"]
code: def create_training_job(
      self,
      input_dict: Dict[str, List[types.Artifact]],
      output_dict: Dict[str, List[types.Artifact]],
      exec_properties: Dict[str, Any],
      executor_class_path: str,
      job_args: Dict[str, Any],
      job_id: Optional[str],
      job_labels: Optional[Dict[str, Any]],
  ) -> Dict[str, Any]:
      """Get training args for runner._launch_aip_training.
  
      The training args contain the inputs/outputs/exec_properties to the
      tfx.scripts.run_executor module.
  
      Args:
        input_dict: Passthrough input dict for tfx.components.Trainer.executor.
        output_dict: Passthrough input dict for tfx.components.Trainer.executor.
        exec_properties: Passthrough input dict for
          tfx.components.Trainer.executor.
        executor_class_path: class path for TFX core default trainer.
        job_args: Training input argument for AI Platform training job.
          'pythonModule', 'pythonVersion' and 'runtimeVersion' will be inferred.
          For the full set of parameters, refer to
          https://cloud.google.com/ml-engine/reference/rest/v1/projects.jobs#TrainingInput
        job_id: Job ID for AI Platform Training job. If not supplied,
          system-determined unique ID is given. Refer to
        https://cloud.google.com/ml-engine/reference/rest/v1/projects.jobs#resource-job
        job_labels: Labels for AI Platform training job.
  
      Returns:
        A dict containing the training arguments
      """
      training_inputs = job_args.copy()
  
      container_command = self.generate_container_command(
          input_dict, output_dict, exec_properties, executor_class_path
      )
  
      if not training_inputs.get("masterConfig"):
          training_inputs["masterConfig"] = {
              "imageUri": _TFX_IMAGE,
          }
  
      # Always use our own entrypoint instead of relying on container default.
      if "containerCommand" in training_inputs["masterConfig"]:
          logging.warn("Overriding custom value of containerCommand")
      training_inputs["masterConfig"][
          "containerCommand"
      ] = container_command
  
      job_labels = job_labels or {}
  
      with telemetry_utils.scoped_labels(
          {telemetry_utils.LABEL_TFX_EXECUTOR: executor_class_path}
      ):
          job_labels.update(telemetry_utils.make_labels_dict())
  
      # 'tfx_YYYYmmddHHMMSS' is the default job ID if not explicitly specified.
      job_id = job_id or "tfx_{}".format(
          datetime.datetime.now().strftime("%Y%m%d%H%M%S")
      )
  
      caip_job = {
          "job_id": job_id,
          "training_input": training_inputs,
          "labels": job_labels,
      }
  
      return caip_job
  
imports: import abc
  import datetime
  import json
  import random
  from typing import Any, Dict, List, Optional, Union
  from absl import logging
  from google.api_core import retry
  from google.cloud.aiplatform import gapic
  from google.cloud.aiplatform_v1.types.custom_job import CustomJob
  from google.cloud.aiplatform_v1.types.job_state import JobState
  from googleapiclient import discovery
  from tfx import types
  from tfx.types import artifact_utils
  from tfx.utils import telemetry_utils
  from tfx.utils import version_utils
label_desc: Use image node_id 2 for calling the CAIPJobClient obj's underlying member method code with example usage: obj.create_training_job(input_dict, output_dict, exec_properties, executor_class_path, job_args, job_id, job_labels) and returns: caip_job