ProcessingJob: ProccesingJob Class

ProcessingJobR Documentation

ProccesingJob Class

Description

Provides functionality to start, describe, and stop processing jobs.

Super class

sagemaker.common::.Job -> ProcessingJob

Public fields

inputs

A list of :class:'~sagemaker.processing.ProcessingInput' objects.

outputs

A list of :class:'~sagemaker.processing.ProcessingOutput' objects.

output_kms_key

The output KMS key associated with the job

Methods

Public methods

Inherited methods

Method new()

Initializes a Processing job.

Usage
ProcessingJob$new(
  sagemaker_session = NULL,
  job_name = NULL,
  inputs = NULL,
  outputs = NULL,
  output_kms_key = NULL
)
Arguments
sagemaker_session

(:class:'~sagemaker.session.Session'): Session object which manages interactions with Amazon SageMaker and any other AWS services needed. If not specified, the processor creates one using the default AWS configuration chain.

job_name

(str): Name of the Processing job.

inputs

(list[:class:'~sagemaker.processing.ProcessingInput']): A list of :class:'~sagemaker.processing.ProcessingInput' objects.

outputs

(list[:class:'~sagemaker.processing.ProcessingOutput']): A list of :class:'~sagemaker.processing.ProcessingOutput' objects.

output_kms_key

(str): The output KMS key associated with the job (default: None).


Method start_new()

Starts a new processing job using the provided inputs and outputs.

Usage
ProcessingJob$start_new(processor, inputs, outputs, experiment_config)
Arguments
processor

(:class:'~sagemaker.processing.Processor'): The “Processor“ instance that started the job.

inputs

(list[:class:'~sagemaker.processing.ProcessingInput']): A list of :class:'~sagemaker.processing.ProcessingInput' objects.

outputs

(list[:class:'~sagemaker.processing.ProcessingOutput']): A list of :class:'~sagemaker.processing.ProcessingOutput' objects.

experiment_config

(dict[str, str]): Experiment management configuration. Dictionary contains three optional keys: 'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.

Returns

:class:'~sagemaker.processing.ProcessingJob': The instance of “ProcessingJob“ created using the “Processor“.


Method from_processing_name()

Initializes a “ProcessingJob“ from a processing job name.

Usage
ProcessingJob$from_processing_name(sagemaker_session, processing_job_name)
Arguments
sagemaker_session

(:class:'~sagemaker.session.Session'): Session object which manages interactions with Amazon SageMaker and any other AWS services needed. If not specified, the processor creates one using the default AWS configuration chain.

processing_job_name

(str): Name of the processing job.

Returns

:class:'~sagemaker.processing.ProcessingJob': The instance of “ProcessingJob“ created from the job name.


Method from_processing_arn()

Initializes a “ProcessingJob“ from a Processing ARN.

Usage
ProcessingJob$from_processing_arn(sagemaker_session, processing_job_arn)
Arguments
sagemaker_session

(:class:'~sagemaker.session.Session'): Session object which manages interactions with Amazon SageMaker and any other AWS services needed. If not specified, the processor creates one using the default AWS configuration chain.

processing_job_arn

(str): ARN of the processing job.

Returns

:class:'~sagemaker.processing.ProcessingJob': The instance of “ProcessingJob“ created from the processing job's ARN.


Method wait()

Waits for the processing job to complete.

Usage
ProcessingJob$wait(logs = TRUE)
Arguments
logs

(bool): Whether to show the logs produced by the job (default: True).


Method describe()

Prints out a response from the DescribeProcessingJob API call.

Usage
ProcessingJob$describe()

Method stop()

the processing job.

Usage
ProcessingJob$stop()

Method prepare_app_specification()

Prepares a dict that represents a ProcessingJob's AppSpecification.

Usage
ProcessingJob$prepare_app_specification(
  container_arguments,
  container_entrypoint,
  image_uri
)
Arguments
container_arguments

(list[str]): The arguments for a container used to run a processing job.

container_entrypoint

(list[str]): The entrypoint for a container used to run a processing job.

image_uri

(str): The container image to be run by the processing job.

Returns

dict: Represents AppSpecification which configures the processing job to run a specified Docker container image.


Method prepare_output_config()

Prepares a dict that represents a ProcessingOutputConfig.

Usage
ProcessingJob$prepare_output_config(kms_key_id, outputs)
Arguments
kms_key_id

(str): The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the processing job output. KmsKeyId can be an ID of a KMS key, ARN of a KMS key, alias of a KMS key, or alias of a KMS key. The KmsKeyId is applied to all outputs.

outputs

(list[dict]): Output configuration information for a processing job.

Returns

dict: Represents output configuration for the processing job.


Method prepare_processing_resources()

Prepares a dict that represents the ProcessingResources.

Usage
ProcessingJob$prepare_processing_resources(
  instance_count,
  instance_type,
  volume_kms_key_id,
  volume_size_in_gb
)
Arguments
instance_count

(int): The number of ML compute instances to use in the processing job. For distributed processing jobs, specify a value greater than 1. The default value is 1.

instance_type

(str): The ML compute instance type for the processing job.

volume_kms_key_id

(str): The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the processing job.

volume_size_in_gb

(int): The size of the ML storage volume in gigabytes that you want to provision. You must specify sufficient ML storage for your scenario.

Returns

dict: Represents ProcessingResources which identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job.


Method prepare_stopping_condition()

Prepares a dict that represents the job's StoppingCondition.

Usage
ProcessingJob$prepare_stopping_condition(max_runtime_in_seconds)
Arguments
max_runtime_in_seconds

(int): Specifies the maximum runtime in seconds.

Returns

list


Method clone()

The objects of this class are cloneable with this method.

Usage
ProcessingJob$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other Processor: ProcessingInput, ProcessingOutput, Processor, ScriptProcessor


DyfanJones/sagemaker-r-common documentation built on June 14, 2022, 10:31 p.m.