sagemaker.train.aws_batch.training_queued_job#

Define QueuedJob class for AWS Batch service

Classes

TrainingQueuedJob(job_arn, job_name[, ...])

TrainingQueuedJob class for AWS Batch service.

class sagemaker.train.aws_batch.training_queued_job.TrainingQueuedJob(job_arn: str, job_name: str, share_identifier: str | None = None, quota_share_name: str | None = None)[source]#

Bases: object

TrainingQueuedJob class for AWS Batch service.

With this class, customers are able to attach the latest training job to a ModelTrainer.

describe() Dict[source]#

Describe Batch job.

Returns: A dict which includes job parameters, job status, attempts and so on.

async fetch_job_results(timeout: int | None = None) Dict[source]#

Async method that waits for the Batch job to complete or until timeout.

Parameters:

timeout – The time to wait for the Batch job to complete. Defaults to None.

Returns: The results of the Batch job, represented as a Dict, or an Error.

get_model_trainer() ModelTrainer[source]#

Attach the latest training job to a ModelTrainer and return.

Returns: a ModelTrainer instance.

result(timeout: int | None = None) Dict[source]#

Fetch the terminal result of the Batch job.

Parameters:

timeout – The time to wait for the Batch job to complete. Defaults to None.

Returns: The results of the Batch job, represented as a Dict.

terminate(reason: str | None = 'Default terminate reason') None[source]#

Terminate Batch job.

Parameters:

reason – Reason for terminating a job.

Returns: None

update(scheduling_priority: int) Dict[source]#

Update Batch job.

Parameters:

scheduling_priority – An integer representing scheduling priority.

Returns: A dict which includes jobArn, jobName and jobId.

wait(timeout: int | None = None) Dict[source]#

Wait for the Batch job to finish.

This method blocks on the job completing for up to the timeout value (if specified). If timeout is None, this method will block until the job is completed.

Parameters:
  • timeout (int) – Timeout in seconds to wait until the job is completed. None by

  • default.

Returns: The last describe_service_job response for the Batch job.