aws_sdk_sagemaker/operation/create_training_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_training_job::_create_training_job_output::CreateTrainingJobOutputBuilder;
3
4pub use crate::operation::create_training_job::_create_training_job_input::CreateTrainingJobInputBuilder;
5
6impl crate::operation::create_training_job::builders::CreateTrainingJobInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_training_job::CreateTrainingJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_training_job::CreateTrainingJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_training_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTrainingJob`.
24///
25/// <p>Starts a model training job. After training completes, SageMaker saves the resulting model artifacts to an Amazon S3 location that you specify.</p>
26/// <p>If you choose to host your model using SageMaker hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts in a machine learning service other than SageMaker, provided that you know how to use them for inference.</p>
27/// <p>In the request body, you provide the following:</p>
28/// <ul>
29/// <li>
30/// <p><code>AlgorithmSpecification</code> - Identifies the training algorithm to use.</p></li>
31/// <li>
32/// <p><code>HyperParameters</code> - Specify these algorithm-specific parameters to enable the estimation of model parameters during training. Hyperparameters can be tuned to optimize this learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>.</p><important>
33/// <p>Do not include any security-sensitive information including account access IDs, secrets or tokens in any hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will reject your training job request and return an exception error.</p>
34/// </important></li>
35/// <li>
36/// <p><code>InputDataConfig</code> - Describes the input required by the training job and the Amazon S3, EFS, or FSx location where it is stored.</p></li>
37/// <li>
38/// <p><code>OutputDataConfig</code> - Identifies the Amazon S3 bucket where you want SageMaker to save the results of model training.</p></li>
39/// <li>
40/// <p><code>ResourceConfig</code> - Identifies the resources, ML compute instances, and ML storage volumes to deploy for model training. In distributed training, you specify more than one instance.</p></li>
41/// <li>
42/// <p><code>EnableManagedSpotTraining</code> - Optimize the cost of training machine learning models by up to 80% by using Amazon EC2 Spot instances. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html">Managed Spot Training</a>.</p></li>
43/// <li>
44/// <p><code>RoleArn</code> - The Amazon Resource Name (ARN) that SageMaker assumes to perform tasks on your behalf during model training. You must grant this role the necessary permissions so that SageMaker can successfully complete model training.</p></li>
45/// <li>
46/// <p><code>StoppingCondition</code> - To help cap training costs, use <code>MaxRuntimeInSeconds</code> to set a time limit for training. Use <code>MaxWaitTimeInSeconds</code> to specify how long a managed spot training job has to complete.</p></li>
47/// <li>
48/// <p><code>Environment</code> - The environment variables to set in the Docker container.</p></li>
49/// <li>
50/// <p><code>RetryStrategy</code> - The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p></li>
51/// </ul>
52/// <p>For more information about SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works.html">How It Works</a>.</p>
53#[derive(::std::clone::Clone, ::std::fmt::Debug)]
54pub struct CreateTrainingJobFluentBuilder {
55    handle: ::std::sync::Arc<crate::client::Handle>,
56    inner: crate::operation::create_training_job::builders::CreateTrainingJobInputBuilder,
57    config_override: ::std::option::Option<crate::config::Builder>,
58}
59impl
60    crate::client::customize::internal::CustomizableSend<
61        crate::operation::create_training_job::CreateTrainingJobOutput,
62        crate::operation::create_training_job::CreateTrainingJobError,
63    > for CreateTrainingJobFluentBuilder
64{
65    fn send(
66        self,
67        config_override: crate::config::Builder,
68    ) -> crate::client::customize::internal::BoxFuture<
69        crate::client::customize::internal::SendResult<
70            crate::operation::create_training_job::CreateTrainingJobOutput,
71            crate::operation::create_training_job::CreateTrainingJobError,
72        >,
73    > {
74        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
75    }
76}
77impl CreateTrainingJobFluentBuilder {
78    /// Creates a new `CreateTrainingJobFluentBuilder`.
79    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
80        Self {
81            handle,
82            inner: ::std::default::Default::default(),
83            config_override: ::std::option::Option::None,
84        }
85    }
86    /// Access the CreateTrainingJob as a reference.
87    pub fn as_input(&self) -> &crate::operation::create_training_job::builders::CreateTrainingJobInputBuilder {
88        &self.inner
89    }
90    /// Sends the request and returns the response.
91    ///
92    /// If an error occurs, an `SdkError` will be returned with additional details that
93    /// can be matched against.
94    ///
95    /// By default, any retryable failures will be retried twice. Retry behavior
96    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
97    /// set when configuring the client.
98    pub async fn send(
99        self,
100    ) -> ::std::result::Result<
101        crate::operation::create_training_job::CreateTrainingJobOutput,
102        ::aws_smithy_runtime_api::client::result::SdkError<
103            crate::operation::create_training_job::CreateTrainingJobError,
104            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
105        >,
106    > {
107        let input = self
108            .inner
109            .build()
110            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
111        let runtime_plugins = crate::operation::create_training_job::CreateTrainingJob::operation_runtime_plugins(
112            self.handle.runtime_plugins.clone(),
113            &self.handle.conf,
114            self.config_override,
115        );
116        crate::operation::create_training_job::CreateTrainingJob::orchestrate(&runtime_plugins, input).await
117    }
118
119    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
120    pub fn customize(
121        self,
122    ) -> crate::client::customize::CustomizableOperation<
123        crate::operation::create_training_job::CreateTrainingJobOutput,
124        crate::operation::create_training_job::CreateTrainingJobError,
125        Self,
126    > {
127        crate::client::customize::CustomizableOperation::new(self)
128    }
129    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
130        self.set_config_override(::std::option::Option::Some(config_override.into()));
131        self
132    }
133
134    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
135        self.config_override = config_override;
136        self
137    }
138    /// <p>The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account.</p>
139    pub fn training_job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.training_job_name(input.into());
141        self
142    }
143    /// <p>The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account.</p>
144    pub fn set_training_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_training_job_name(input);
146        self
147    }
148    /// <p>The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account.</p>
149    pub fn get_training_job_name(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_training_job_name()
151    }
152    ///
153    /// Adds a key-value pair to `HyperParameters`.
154    ///
155    /// To override the contents of this collection use [`set_hyper_parameters`](Self::set_hyper_parameters).
156    ///
157    /// <p>Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>.</p>
158    /// <p>You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the <code>Length Constraint</code>.</p><important>
159    /// <p>Do not include any security-sensitive information including account access IDs, secrets or tokens in any hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will reject your training job request and return an exception error.</p>
160    /// </important>
161    pub fn hyper_parameters(
162        mut self,
163        k: impl ::std::convert::Into<::std::string::String>,
164        v: impl ::std::convert::Into<::std::string::String>,
165    ) -> Self {
166        self.inner = self.inner.hyper_parameters(k.into(), v.into());
167        self
168    }
169    /// <p>Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>.</p>
170    /// <p>You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the <code>Length Constraint</code>.</p><important>
171    /// <p>Do not include any security-sensitive information including account access IDs, secrets or tokens in any hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will reject your training job request and return an exception error.</p>
172    /// </important>
173    pub fn set_hyper_parameters(
174        mut self,
175        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
176    ) -> Self {
177        self.inner = self.inner.set_hyper_parameters(input);
178        self
179    }
180    /// <p>Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>.</p>
181    /// <p>You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the <code>Length Constraint</code>.</p><important>
182    /// <p>Do not include any security-sensitive information including account access IDs, secrets or tokens in any hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will reject your training job request and return an exception error.</p>
183    /// </important>
184    pub fn get_hyper_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
185        self.inner.get_hyper_parameters()
186    }
187    /// <p>The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>. For information about providing your own algorithms, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html">Using Your Own Algorithms with Amazon SageMaker</a>.</p>
188    pub fn algorithm_specification(mut self, input: crate::types::AlgorithmSpecification) -> Self {
189        self.inner = self.inner.algorithm_specification(input);
190        self
191    }
192    /// <p>The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>. For information about providing your own algorithms, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html">Using Your Own Algorithms with Amazon SageMaker</a>.</p>
193    pub fn set_algorithm_specification(mut self, input: ::std::option::Option<crate::types::AlgorithmSpecification>) -> Self {
194        self.inner = self.inner.set_algorithm_specification(input);
195        self
196    }
197    /// <p>The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html">Algorithms</a>. For information about providing your own algorithms, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html">Using Your Own Algorithms with Amazon SageMaker</a>.</p>
198    pub fn get_algorithm_specification(&self) -> &::std::option::Option<crate::types::AlgorithmSpecification> {
199        self.inner.get_algorithm_specification()
200    }
201    /// <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf.</p>
202    /// <p>During model training, SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">SageMaker Roles</a>.</p><note>
203    /// <p>To be able to pass this role to SageMaker, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
204    /// </note>
205    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.inner = self.inner.role_arn(input.into());
207        self
208    }
209    /// <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf.</p>
210    /// <p>During model training, SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">SageMaker Roles</a>.</p><note>
211    /// <p>To be able to pass this role to SageMaker, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
212    /// </note>
213    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.inner = self.inner.set_role_arn(input);
215        self
216    }
217    /// <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf.</p>
218    /// <p>During model training, SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">SageMaker Roles</a>.</p><note>
219    /// <p>To be able to pass this role to SageMaker, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
220    /// </note>
221    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
222        self.inner.get_role_arn()
223    }
224    ///
225    /// Appends an item to `InputDataConfig`.
226    ///
227    /// To override the contents of this collection use [`set_input_data_config`](Self::set_input_data_config).
228    ///
229    /// <p>An array of <code>Channel</code> objects. Each channel is a named input source. <code>InputDataConfig</code> describes the input data and its location.</p>
230    /// <p>Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, <code>training_data</code> and <code>validation_data</code>. The configuration for each channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format.</p>
231    /// <p>Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For example, if you specify an EFS location, input data files are available as input streams. They do not need to be downloaded.</p>
232    /// <p>Your input must be in the same Amazon Web Services region as your training job.</p>
233    pub fn input_data_config(mut self, input: crate::types::Channel) -> Self {
234        self.inner = self.inner.input_data_config(input);
235        self
236    }
237    /// <p>An array of <code>Channel</code> objects. Each channel is a named input source. <code>InputDataConfig</code> describes the input data and its location.</p>
238    /// <p>Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, <code>training_data</code> and <code>validation_data</code>. The configuration for each channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format.</p>
239    /// <p>Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For example, if you specify an EFS location, input data files are available as input streams. They do not need to be downloaded.</p>
240    /// <p>Your input must be in the same Amazon Web Services region as your training job.</p>
241    pub fn set_input_data_config(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>) -> Self {
242        self.inner = self.inner.set_input_data_config(input);
243        self
244    }
245    /// <p>An array of <code>Channel</code> objects. Each channel is a named input source. <code>InputDataConfig</code> describes the input data and its location.</p>
246    /// <p>Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, <code>training_data</code> and <code>validation_data</code>. The configuration for each channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format.</p>
247    /// <p>Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For example, if you specify an EFS location, input data files are available as input streams. They do not need to be downloaded.</p>
248    /// <p>Your input must be in the same Amazon Web Services region as your training job.</p>
249    pub fn get_input_data_config(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Channel>> {
250        self.inner.get_input_data_config()
251    }
252    /// <p>Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.</p>
253    pub fn output_data_config(mut self, input: crate::types::OutputDataConfig) -> Self {
254        self.inner = self.inner.output_data_config(input);
255        self
256    }
257    /// <p>Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.</p>
258    pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::OutputDataConfig>) -> Self {
259        self.inner = self.inner.set_output_data_config(input);
260        self
261    }
262    /// <p>Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.</p>
263    pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::OutputDataConfig> {
264        self.inner.get_output_data_config()
265    }
266    /// <p>The resources, including the ML compute instances and ML storage volumes, to use for model training.</p>
267    /// <p>ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training data, choose <code>File</code> as the <code>TrainingInputMode</code> in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.</p>
268    pub fn resource_config(mut self, input: crate::types::ResourceConfig) -> Self {
269        self.inner = self.inner.resource_config(input);
270        self
271    }
272    /// <p>The resources, including the ML compute instances and ML storage volumes, to use for model training.</p>
273    /// <p>ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training data, choose <code>File</code> as the <code>TrainingInputMode</code> in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.</p>
274    pub fn set_resource_config(mut self, input: ::std::option::Option<crate::types::ResourceConfig>) -> Self {
275        self.inner = self.inner.set_resource_config(input);
276        self
277    }
278    /// <p>The resources, including the ML compute instances and ML storage volumes, to use for model training.</p>
279    /// <p>ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training data, choose <code>File</code> as the <code>TrainingInputMode</code> in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.</p>
280    pub fn get_resource_config(&self) -> &::std::option::Option<crate::types::ResourceConfig> {
281        self.inner.get_resource_config()
282    }
283    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html">Protect Training Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
284    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
285        self.inner = self.inner.vpc_config(input);
286        self
287    }
288    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html">Protect Training Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
289    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
290        self.inner = self.inner.set_vpc_config(input);
291        self
292    }
293    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html">Protect Training Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
294    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
295        self.inner.get_vpc_config()
296    }
297    /// <p>Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.</p>
298    /// <p>To stop a job, SageMaker sends the algorithm the <code>SIGTERM</code> signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.</p>
299    pub fn stopping_condition(mut self, input: crate::types::StoppingCondition) -> Self {
300        self.inner = self.inner.stopping_condition(input);
301        self
302    }
303    /// <p>Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.</p>
304    /// <p>To stop a job, SageMaker sends the algorithm the <code>SIGTERM</code> signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.</p>
305    pub fn set_stopping_condition(mut self, input: ::std::option::Option<crate::types::StoppingCondition>) -> Self {
306        self.inner = self.inner.set_stopping_condition(input);
307        self
308    }
309    /// <p>Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.</p>
310    /// <p>To stop a job, SageMaker sends the algorithm the <code>SIGTERM</code> signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.</p>
311    pub fn get_stopping_condition(&self) -> &::std::option::Option<crate::types::StoppingCondition> {
312        self.inner.get_stopping_condition()
313    }
314    ///
315    /// Appends an item to `Tags`.
316    ///
317    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
318    ///
319    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
320    pub fn tags(mut self, input: crate::types::Tag) -> Self {
321        self.inner = self.inner.tags(input);
322        self
323    }
324    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
325    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
326        self.inner = self.inner.set_tags(input);
327        self
328    }
329    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
330    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
331        self.inner.get_tags()
332    }
333    /// <p>Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If you enable network isolation for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.</p>
334    pub fn enable_network_isolation(mut self, input: bool) -> Self {
335        self.inner = self.inner.enable_network_isolation(input);
336        self
337    }
338    /// <p>Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If you enable network isolation for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.</p>
339    pub fn set_enable_network_isolation(mut self, input: ::std::option::Option<bool>) -> Self {
340        self.inner = self.inner.set_enable_network_isolation(input);
341        self
342    }
343    /// <p>Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If you enable network isolation for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.</p>
344    pub fn get_enable_network_isolation(&self) -> &::std::option::Option<bool> {
345        self.inner.get_enable_network_isolation()
346    }
347    /// <p>To encrypt all communications between ML compute instances in distributed training, choose <code>True</code>. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html">Protect Communications Between ML Compute Instances in a Distributed Training Job</a>.</p>
348    pub fn enable_inter_container_traffic_encryption(mut self, input: bool) -> Self {
349        self.inner = self.inner.enable_inter_container_traffic_encryption(input);
350        self
351    }
352    /// <p>To encrypt all communications between ML compute instances in distributed training, choose <code>True</code>. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html">Protect Communications Between ML Compute Instances in a Distributed Training Job</a>.</p>
353    pub fn set_enable_inter_container_traffic_encryption(mut self, input: ::std::option::Option<bool>) -> Self {
354        self.inner = self.inner.set_enable_inter_container_traffic_encryption(input);
355        self
356    }
357    /// <p>To encrypt all communications between ML compute instances in distributed training, choose <code>True</code>. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html">Protect Communications Between ML Compute Instances in a Distributed Training Job</a>.</p>
358    pub fn get_enable_inter_container_traffic_encryption(&self) -> &::std::option::Option<bool> {
359        self.inner.get_enable_inter_container_traffic_encryption()
360    }
361    /// <p>To train models using managed spot training, choose <code>True</code>. Managed spot training provides a fully managed and scalable infrastructure for training machine learning models. this option is useful when training jobs can be interrupted and when there is flexibility when the training job is run.</p>
362    /// <p>The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They can be used to see when managed spot training jobs are running, interrupted, resumed, or completed.</p>
363    pub fn enable_managed_spot_training(mut self, input: bool) -> Self {
364        self.inner = self.inner.enable_managed_spot_training(input);
365        self
366    }
367    /// <p>To train models using managed spot training, choose <code>True</code>. Managed spot training provides a fully managed and scalable infrastructure for training machine learning models. this option is useful when training jobs can be interrupted and when there is flexibility when the training job is run.</p>
368    /// <p>The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They can be used to see when managed spot training jobs are running, interrupted, resumed, or completed.</p>
369    pub fn set_enable_managed_spot_training(mut self, input: ::std::option::Option<bool>) -> Self {
370        self.inner = self.inner.set_enable_managed_spot_training(input);
371        self
372    }
373    /// <p>To train models using managed spot training, choose <code>True</code>. Managed spot training provides a fully managed and scalable infrastructure for training machine learning models. this option is useful when training jobs can be interrupted and when there is flexibility when the training job is run.</p>
374    /// <p>The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They can be used to see when managed spot training jobs are running, interrupted, resumed, or completed.</p>
375    pub fn get_enable_managed_spot_training(&self) -> &::std::option::Option<bool> {
376        self.inner.get_enable_managed_spot_training()
377    }
378    /// <p>Contains information about the output location for managed spot training checkpoint data.</p>
379    pub fn checkpoint_config(mut self, input: crate::types::CheckpointConfig) -> Self {
380        self.inner = self.inner.checkpoint_config(input);
381        self
382    }
383    /// <p>Contains information about the output location for managed spot training checkpoint data.</p>
384    pub fn set_checkpoint_config(mut self, input: ::std::option::Option<crate::types::CheckpointConfig>) -> Self {
385        self.inner = self.inner.set_checkpoint_config(input);
386        self
387    }
388    /// <p>Contains information about the output location for managed spot training checkpoint data.</p>
389    pub fn get_checkpoint_config(&self) -> &::std::option::Option<crate::types::CheckpointConfig> {
390        self.inner.get_checkpoint_config()
391    }
392    /// <p>Configuration information for the Amazon SageMaker Debugger hook parameters, metric and tensor collections, and storage paths. To learn more about how to configure the <code>DebugHookConfig</code> parameter, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html">Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job</a>.</p>
393    pub fn debug_hook_config(mut self, input: crate::types::DebugHookConfig) -> Self {
394        self.inner = self.inner.debug_hook_config(input);
395        self
396    }
397    /// <p>Configuration information for the Amazon SageMaker Debugger hook parameters, metric and tensor collections, and storage paths. To learn more about how to configure the <code>DebugHookConfig</code> parameter, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html">Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job</a>.</p>
398    pub fn set_debug_hook_config(mut self, input: ::std::option::Option<crate::types::DebugHookConfig>) -> Self {
399        self.inner = self.inner.set_debug_hook_config(input);
400        self
401    }
402    /// <p>Configuration information for the Amazon SageMaker Debugger hook parameters, metric and tensor collections, and storage paths. To learn more about how to configure the <code>DebugHookConfig</code> parameter, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html">Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job</a>.</p>
403    pub fn get_debug_hook_config(&self) -> &::std::option::Option<crate::types::DebugHookConfig> {
404        self.inner.get_debug_hook_config()
405    }
406    ///
407    /// Appends an item to `DebugRuleConfigurations`.
408    ///
409    /// To override the contents of this collection use [`set_debug_rule_configurations`](Self::set_debug_rule_configurations).
410    ///
411    /// <p>Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.</p>
412    pub fn debug_rule_configurations(mut self, input: crate::types::DebugRuleConfiguration) -> Self {
413        self.inner = self.inner.debug_rule_configurations(input);
414        self
415    }
416    /// <p>Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.</p>
417    pub fn set_debug_rule_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DebugRuleConfiguration>>) -> Self {
418        self.inner = self.inner.set_debug_rule_configurations(input);
419        self
420    }
421    /// <p>Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.</p>
422    pub fn get_debug_rule_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DebugRuleConfiguration>> {
423        self.inner.get_debug_rule_configurations()
424    }
425    /// <p>Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.</p>
426    pub fn tensor_board_output_config(mut self, input: crate::types::TensorBoardOutputConfig) -> Self {
427        self.inner = self.inner.tensor_board_output_config(input);
428        self
429    }
430    /// <p>Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.</p>
431    pub fn set_tensor_board_output_config(mut self, input: ::std::option::Option<crate::types::TensorBoardOutputConfig>) -> Self {
432        self.inner = self.inner.set_tensor_board_output_config(input);
433        self
434    }
435    /// <p>Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.</p>
436    pub fn get_tensor_board_output_config(&self) -> &::std::option::Option<crate::types::TensorBoardOutputConfig> {
437        self.inner.get_tensor_board_output_config()
438    }
439    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
440    /// <ul>
441    /// <li>
442    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
443    /// <li>
444    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
445    /// <li>
446    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
447    /// </ul>
448    pub fn experiment_config(mut self, input: crate::types::ExperimentConfig) -> Self {
449        self.inner = self.inner.experiment_config(input);
450        self
451    }
452    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
453    /// <ul>
454    /// <li>
455    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
456    /// <li>
457    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
458    /// <li>
459    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
460    /// </ul>
461    pub fn set_experiment_config(mut self, input: ::std::option::Option<crate::types::ExperimentConfig>) -> Self {
462        self.inner = self.inner.set_experiment_config(input);
463        self
464    }
465    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
466    /// <ul>
467    /// <li>
468    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
469    /// <li>
470    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
471    /// <li>
472    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
473    /// </ul>
474    pub fn get_experiment_config(&self) -> &::std::option::Option<crate::types::ExperimentConfig> {
475        self.inner.get_experiment_config()
476    }
477    /// <p>Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.</p>
478    pub fn profiler_config(mut self, input: crate::types::ProfilerConfig) -> Self {
479        self.inner = self.inner.profiler_config(input);
480        self
481    }
482    /// <p>Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.</p>
483    pub fn set_profiler_config(mut self, input: ::std::option::Option<crate::types::ProfilerConfig>) -> Self {
484        self.inner = self.inner.set_profiler_config(input);
485        self
486    }
487    /// <p>Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.</p>
488    pub fn get_profiler_config(&self) -> &::std::option::Option<crate::types::ProfilerConfig> {
489        self.inner.get_profiler_config()
490    }
491    ///
492    /// Appends an item to `ProfilerRuleConfigurations`.
493    ///
494    /// To override the contents of this collection use [`set_profiler_rule_configurations`](Self::set_profiler_rule_configurations).
495    ///
496    /// <p>Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.</p>
497    pub fn profiler_rule_configurations(mut self, input: crate::types::ProfilerRuleConfiguration) -> Self {
498        self.inner = self.inner.profiler_rule_configurations(input);
499        self
500    }
501    /// <p>Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.</p>
502    pub fn set_profiler_rule_configurations(
503        mut self,
504        input: ::std::option::Option<::std::vec::Vec<crate::types::ProfilerRuleConfiguration>>,
505    ) -> Self {
506        self.inner = self.inner.set_profiler_rule_configurations(input);
507        self
508    }
509    /// <p>Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.</p>
510    pub fn get_profiler_rule_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProfilerRuleConfiguration>> {
511        self.inner.get_profiler_rule_configurations()
512    }
513    ///
514    /// Adds a key-value pair to `Environment`.
515    ///
516    /// To override the contents of this collection use [`set_environment`](Self::set_environment).
517    ///
518    /// <p>The environment variables to set in the Docker container.</p>
519    pub fn environment(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
520        self.inner = self.inner.environment(k.into(), v.into());
521        self
522    }
523    /// <p>The environment variables to set in the Docker container.</p>
524    pub fn set_environment(
525        mut self,
526        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
527    ) -> Self {
528        self.inner = self.inner.set_environment(input);
529        self
530    }
531    /// <p>The environment variables to set in the Docker container.</p>
532    pub fn get_environment(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
533        self.inner.get_environment()
534    }
535    /// <p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>
536    pub fn retry_strategy(mut self, input: crate::types::RetryStrategy) -> Self {
537        self.inner = self.inner.retry_strategy(input);
538        self
539    }
540    /// <p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>
541    pub fn set_retry_strategy(mut self, input: ::std::option::Option<crate::types::RetryStrategy>) -> Self {
542        self.inner = self.inner.set_retry_strategy(input);
543        self
544    }
545    /// <p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>
546    pub fn get_retry_strategy(&self) -> &::std::option::Option<crate::types::RetryStrategy> {
547        self.inner.get_retry_strategy()
548    }
549    /// <p>Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html">Access a training container through Amazon Web Services Systems Manager (SSM) for remote debugging</a>.</p>
550    pub fn remote_debug_config(mut self, input: crate::types::RemoteDebugConfig) -> Self {
551        self.inner = self.inner.remote_debug_config(input);
552        self
553    }
554    /// <p>Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html">Access a training container through Amazon Web Services Systems Manager (SSM) for remote debugging</a>.</p>
555    pub fn set_remote_debug_config(mut self, input: ::std::option::Option<crate::types::RemoteDebugConfig>) -> Self {
556        self.inner = self.inner.set_remote_debug_config(input);
557        self
558    }
559    /// <p>Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html">Access a training container through Amazon Web Services Systems Manager (SSM) for remote debugging</a>.</p>
560    pub fn get_remote_debug_config(&self) -> &::std::option::Option<crate::types::RemoteDebugConfig> {
561        self.inner.get_remote_debug_config()
562    }
563    /// <p>Contains information about the infrastructure health check configuration for the training job.</p>
564    pub fn infra_check_config(mut self, input: crate::types::InfraCheckConfig) -> Self {
565        self.inner = self.inner.infra_check_config(input);
566        self
567    }
568    /// <p>Contains information about the infrastructure health check configuration for the training job.</p>
569    pub fn set_infra_check_config(mut self, input: ::std::option::Option<crate::types::InfraCheckConfig>) -> Self {
570        self.inner = self.inner.set_infra_check_config(input);
571        self
572    }
573    /// <p>Contains information about the infrastructure health check configuration for the training job.</p>
574    pub fn get_infra_check_config(&self) -> &::std::option::Option<crate::types::InfraCheckConfig> {
575        self.inner.get_infra_check_config()
576    }
577    /// <p>Contains information about attribute-based access control (ABAC) for the training job.</p>
578    pub fn session_chaining_config(mut self, input: crate::types::SessionChainingConfig) -> Self {
579        self.inner = self.inner.session_chaining_config(input);
580        self
581    }
582    /// <p>Contains information about attribute-based access control (ABAC) for the training job.</p>
583    pub fn set_session_chaining_config(mut self, input: ::std::option::Option<crate::types::SessionChainingConfig>) -> Self {
584        self.inner = self.inner.set_session_chaining_config(input);
585        self
586    }
587    /// <p>Contains information about attribute-based access control (ABAC) for the training job.</p>
588    pub fn get_session_chaining_config(&self) -> &::std::option::Option<crate::types::SessionChainingConfig> {
589        self.inner.get_session_chaining_config()
590    }
591}