Join the SIG TFX-Addons community and help make TFX even better!

tfx.extensions.google_cloud_ai_platform.training_clients.AbstractJobClient

Abstract class interacting with CAIP CMLE job or uCAIP CustomJob.

Methods

create_client

View source

Creates the job client.

Can also be used for recreating the job client (e.g. in the case of communication failure).

Multiple job requests can be done in parallel if needed, by creating an instance of the class for each job. Note that one class instance should only be used for one job, as each instance stores variables (e.g. job_id) specific to each job.

create_training_args

View source

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.
training_inputs Training input argument for AI Platform training job.
job_id Job ID for AI Platform Training job. If not supplied, system-determined unique ID is given.

Returns
A dict containing the training arguments

get_job

View source

Gets the the long-running job.

get_job_name

View source

Gets the job name.

get_job_state

View source

Gets the state of the long-running job.

Args
response The response from get_job

Returns
The job state.

launch_job

View source

Launches a long-running job.

Args
job_id The job ID of the AI Platform training job.
parent The project name in the form of 'projects/{project_id}'
training_input Training input argument for AI Platform training job. See https://cloud.google.com/ml-engine/reference/rest/v1/projects.jobs#TrainingInput for the detailed schema.
job_labels The dict of labels that will be attached to this job.

JOB_STATES_COMPLETED ()
JOB_STATES_FAILED ()