Amazon SageMaker

Amazon SageMaker Task states.

class rhodes.states.services.sagemaker.AmazonSageMakerCreateEndpoint(title, *, Comment=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, EndpointConfigName=None, EndpointName=None, Tags=None)[source]

Bases: rhodes.states.State

Create an endpoint using the endpoint configuration specified in the request.

See service docs for more details.

Parameters:
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • EndpointConfigName – The name of an endpoint configuration.
  • EndpointName – The name of the endpoint.
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
class rhodes.states.services.sagemaker.AmazonSageMakerCreateEndpointConfig(title, *, Comment=None, KmsKeyId=None, ProductionVariants=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, EndpointConfigName=None, Tags=None)[source]

Bases: rhodes.states.State

Create an endpoint configuration that Amazon SageMaker hosting services uses to deploy models.

See service docs for more details.

Parameters:
  • KmsKeyId – The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint.
  • ProductionVariants – An list of ProductionVariant objects, one for each model that you want to host at this endpoint.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • EndpointConfigName – The name of an endpoint configuration.
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
class rhodes.states.services.sagemaker.AmazonSageMakerCreateHyperParameterTuningJob(title, *, Comment=None, HyperParameterTuningJobConfig=None, HyperParameterTuningJobName=None, TrainingJobDefinition=None, WarmStartConfig=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, Tags=None)[source]

Bases: rhodes.states.State

Start a hyperparameter tuning job.

See service docs for more details.

Parameters:
  • HyperParameterTuningJobConfig – The HyperParameterTuningJobConfig object that describes the tuning job, including the search strategy, the objective metric used to evaluate training jobs, ranges of parameters to search, and resource limits for the tuning job.
  • HyperParameterTuningJobName – The name of the tuning job. This name is the prefix for the names of all training jobs that this tuning job launches. The name must be unique within the same AWS account and AWS Region. The name must have { } to { } characters. Valid characters are a-z, A-Z, 0-9, and : + = @ _ % - (hyphen). The name is not case sensitive.
  • TrainingJobDefinition – The HyperParameterTrainingJobDefinition object that describes the training jobs that this tuning job launches, including static hyperparameters, input data configuration, output data configuration, resource configuration, and stopping condition.
  • WarmStartConfig – Specifies the configuration for starting the hyperparameter tuning job using one or more previous tuning jobs as a starting point. The results of previous tuning jobs are used to inform which combinations of hyperparameters to search over in the new tuning job.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
class rhodes.states.services.sagemaker.AmazonSageMakerCreateLabelingJob(title, *, Comment=None, HumanTaskConfig=None, InputConfig=None, LabelAttributeName=None, LabelCategoryConfigS3Uri=None, LabelingJobAlgorithmsConfig=None, LabelingJobName=None, OutputConfig=None, RoleArn=None, StoppingConditions=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, Tags=None)[source]

Bases: rhodes.states.State

Create a job that uses workers to label the data objects in your input dataset.

See service docs for more details.

Parameters:
  • HumanTaskConfig – Configures the labeling task and how it is presented to workers; including, but not limited to price, keywords, and batch size (task count).
  • InputConfig – Input data for the labeling job, such as the Amazon S3 location of the data objects and the location of the manifest file that describes the data objects.
  • LabelAttributeName – The attribute name to use for the label in the output manifest file.
  • LabelCategoryConfigS3Uri – The S3 URL of the file that defines the categories used to label the data objects.
  • LabelingJobAlgorithmsConfig – Configures the information required to perform automated data labeling.
  • LabelingJobName – The name of the labeling job. This name is used to identify the job in a list of labeling jobs.
  • OutputConfig – The location of the output data and the AWS Key Management Service key ID for the key used to encrypt the output data, if any.
  • RoleArn – The Amazon Resource Number (ARN) that Amazon SageMaker assumes to perform tasks on your behalf during data labeling. You must grant this role the necessary permissions so that Amazon SageMaker can successfully complete data labeling.
  • StoppingConditions – A set of conditions for stopping the labeling job. If any of the conditions are met, the job is automatically stopped. You can use these conditions to control the cost of data labeling.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
class rhodes.states.services.sagemaker.AmazonSageMakerCreateModel(title, *, Comment=None, Containers=None, EnableNetworkIsolation=None, ExecutionRoleArn=None, ModelName=None, PrimaryContainer=None, VpcConfig=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, Tags=None)[source]

Bases: rhodes.states.State

Create a model in Amazon SageMaker.

See service docs for more details.

Parameters:
  • Containers – Specifies the containers in the inference pipeline.
  • EnableNetworkIsolation – Isolates the model container. No inbound or outbound network calls can be made to or from the model container.
  • ExecutionRoleArn – The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs. Deploying on ML compute instances is part of model hosting. For more information, see Amazon SageMaker Roles.
  • ModelName – The name of the new model.
  • PrimaryContainer – The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.
  • VpcConfig – A VpcConfig object that specifies the VPC that you want your model to connect to.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
class rhodes.states.services.sagemaker.AmazonSageMakerCreateTrainingJob(title, *, Comment=None, AlgorithmSpecification=None, HyperParameters=None, InputDataConfig=None, OutputDataConfig=None, ResourceConfig=None, RoleArn=None, StoppingCondition=None, TrainingJobName=None, VpcConfig=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, Tags=None)[source]

Bases: rhodes.states.State

Start a model training job.

See service docs for more details.

Parameters:
  • AlgorithmSpecification – The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode.
  • HyperParameters – Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process.
  • InputDataConfig – An array of Channel objects. Each channel is a named input source. InputDataConfig describes the input data and its location.
  • OutputDataConfig – Specifies the path to the S3 location where you want to store model artifacts. Amazon SageMaker creates subfolders for the artifacts.
  • ResourceConfig – The resources, including the ML compute instances and ML storage volumes, to use for model training.
  • RoleArn – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.
  • StoppingCondition – Specifies a limit to how long a model training job can run. When the job reaches the time limit, Amazon SageMaker ends the training job. Use this API to cap model training costs.
  • TrainingJobName – The name of the training job. The name must be unique within an AWS Region in an AWS account.
  • VpcConfig – A VpcConfig object that specifies the VPC that you want your training job to connect to.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
class rhodes.states.services.sagemaker.AmazonSageMakerCreateTransformJob(title, *, Comment=None, BatchStrategy=None, Environment=None, MaxConcurrentTransforms=None, MaxPayloadInMB=None, ModelName=None, TransformInput=None, TransformJobName=None, TransformOutput=None, TransformResources=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, Tags=None)[source]

Bases: rhodes.states.State

Start a transform job.

See service docs for more details.

Parameters:
  • BatchStrategy – Specifies the number of records to include in a mini-batch for an HTTP inference request. A record is a single unit of input data that inference can be made on. For example, a single line in a CSV file is a record.
  • Environment – The environment variables to set in the Docker container.
  • MaxConcurrentTransforms – The maximum number of parallel requests that can be sent to each instance in a transform job.
  • MaxPayloadInMB – The maximum allowed size of the payload, in MB.
  • ModelName – The name of the model that you want to use for the transform job. ModelName must be the name of an existing Amazon SageMaker model within an AWS Region in an AWS account.
  • TransformInput – Describes the input source and the way the transform job consumes it.
  • TransformJobName – The name of the transform job. The name must be unique within an AWS Region in an AWS account.
  • TransformOutput – Describes the results of the transform job.
  • TransformResources – Describes the resources, including ML instance types and ML instance count, to use for the transform job.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
class rhodes.states.services.sagemaker.AmazonSageMakerUpdateEndpoint(title, *, Comment=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>, EndpointConfigName=None, EndpointName=None, Tags=None)[source]

Bases: rhodes.states.State

Deploy the new EndpointConfig specified in the request. Then switch to using newly created endpoint and delete resources provisioned for the endpoint using the previous EndpointConfig.

See service docs for more details.

Parameters:
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
  • EndpointConfigName – The name of an endpoint configuration.
  • EndpointName – The name of the endpoint.
  • Tags – An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict