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 fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request hyperparameter variable or plain text fields.</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><important>
49/// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.</p>
50/// </important></li>
51/// <li>
52/// <p><code>RetryStrategy</code> - The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p></li>
53/// </ul>
54/// <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>
55#[derive(::std::clone::Clone, ::std::fmt::Debug)]
56pub struct CreateTrainingJobFluentBuilder {
57    handle: ::std::sync::Arc<crate::client::Handle>,
58    inner: crate::operation::create_training_job::builders::CreateTrainingJobInputBuilder,
59    config_override: ::std::option::Option<crate::config::Builder>,
60}
61impl
62    crate::client::customize::internal::CustomizableSend<
63        crate::operation::create_training_job::CreateTrainingJobOutput,
64        crate::operation::create_training_job::CreateTrainingJobError,
65    > for CreateTrainingJobFluentBuilder
66{
67    fn send(
68        self,
69        config_override: crate::config::Builder,
70    ) -> crate::client::customize::internal::BoxFuture<
71        crate::client::customize::internal::SendResult<
72            crate::operation::create_training_job::CreateTrainingJobOutput,
73            crate::operation::create_training_job::CreateTrainingJobError,
74        >,
75    > {
76        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
77    }
78}
79impl CreateTrainingJobFluentBuilder {
80    /// Creates a new `CreateTrainingJobFluentBuilder`.
81    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
82        Self {
83            handle,
84            inner: ::std::default::Default::default(),
85            config_override: ::std::option::Option::None,
86        }
87    }
88    /// Access the CreateTrainingJob as a reference.
89    pub fn as_input(&self) -> &crate::operation::create_training_job::builders::CreateTrainingJobInputBuilder {
90        &self.inner
91    }
92    /// Sends the request and returns the response.
93    ///
94    /// If an error occurs, an `SdkError` will be returned with additional details that
95    /// can be matched against.
96    ///
97    /// By default, any retryable failures will be retried twice. Retry behavior
98    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
99    /// set when configuring the client.
100    pub async fn send(
101        self,
102    ) -> ::std::result::Result<
103        crate::operation::create_training_job::CreateTrainingJobOutput,
104        ::aws_smithy_runtime_api::client::result::SdkError<
105            crate::operation::create_training_job::CreateTrainingJobError,
106            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
107        >,
108    > {
109        let input = self
110            .inner
111            .build()
112            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
113        let runtime_plugins = crate::operation::create_training_job::CreateTrainingJob::operation_runtime_plugins(
114            self.handle.runtime_plugins.clone(),
115            &self.handle.conf,
116            self.config_override,
117        );
118        crate::operation::create_training_job::CreateTrainingJob::orchestrate(&runtime_plugins, input).await
119    }
120
121    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
122    pub fn customize(
123        self,
124    ) -> crate::client::customize::CustomizableOperation<
125        crate::operation::create_training_job::CreateTrainingJobOutput,
126        crate::operation::create_training_job::CreateTrainingJobError,
127        Self,
128    > {
129        crate::client::customize::CustomizableOperation::new(self)
130    }
131    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
132        self.set_config_override(::std::option::Option::Some(config_override.into()));
133        self
134    }
135
136    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
137        self.config_override = config_override;
138        self
139    }
140    /// <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>
141    pub fn training_job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.training_job_name(input.into());
143        self
144    }
145    /// <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>
146    pub fn set_training_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_training_job_name(input);
148        self
149    }
150    /// <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>
151    pub fn get_training_job_name(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_training_job_name()
153    }
154    ///
155    /// Adds a key-value pair to `HyperParameters`.
156    ///
157    /// To override the contents of this collection use [`set_hyper_parameters`](Self::set_hyper_parameters).
158    ///
159    /// <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>
160    /// <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>
161    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request hyperparameter variable or plain text fields.</p>
162    /// </important>
163    pub fn hyper_parameters(
164        mut self,
165        k: impl ::std::convert::Into<::std::string::String>,
166        v: impl ::std::convert::Into<::std::string::String>,
167    ) -> Self {
168        self.inner = self.inner.hyper_parameters(k.into(), v.into());
169        self
170    }
171    /// <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>
172    /// <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>
173    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request hyperparameter variable or plain text fields.</p>
174    /// </important>
175    pub fn set_hyper_parameters(
176        mut self,
177        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
178    ) -> Self {
179        self.inner = self.inner.set_hyper_parameters(input);
180        self
181    }
182    /// <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>
183    /// <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>
184    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request hyperparameter variable or plain text fields.</p>
185    /// </important>
186    pub fn get_hyper_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
187        self.inner.get_hyper_parameters()
188    }
189    /// <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>
190    pub fn algorithm_specification(mut self, input: crate::types::AlgorithmSpecification) -> Self {
191        self.inner = self.inner.algorithm_specification(input);
192        self
193    }
194    /// <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>
195    pub fn set_algorithm_specification(mut self, input: ::std::option::Option<crate::types::AlgorithmSpecification>) -> Self {
196        self.inner = self.inner.set_algorithm_specification(input);
197        self
198    }
199    /// <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>
200    pub fn get_algorithm_specification(&self) -> &::std::option::Option<crate::types::AlgorithmSpecification> {
201        self.inner.get_algorithm_specification()
202    }
203    /// <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf.</p>
204    /// <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>
205    /// <p>To be able to pass this role to SageMaker, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
206    /// </note>
207    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.role_arn(input.into());
209        self
210    }
211    /// <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf.</p>
212    /// <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>
213    /// <p>To be able to pass this role to SageMaker, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
214    /// </note>
215    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_role_arn(input);
217        self
218    }
219    /// <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf.</p>
220    /// <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>
221    /// <p>To be able to pass this role to SageMaker, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
222    /// </note>
223    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
224        self.inner.get_role_arn()
225    }
226    ///
227    /// Appends an item to `InputDataConfig`.
228    ///
229    /// To override the contents of this collection use [`set_input_data_config`](Self::set_input_data_config).
230    ///
231    /// <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>
232    /// <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>
233    /// <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>
234    /// <p>Your input must be in the same Amazon Web Services region as your training job.</p>
235    pub fn input_data_config(mut self, input: crate::types::Channel) -> Self {
236        self.inner = self.inner.input_data_config(input);
237        self
238    }
239    /// <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>
240    /// <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>
241    /// <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>
242    /// <p>Your input must be in the same Amazon Web Services region as your training job.</p>
243    pub fn set_input_data_config(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>) -> Self {
244        self.inner = self.inner.set_input_data_config(input);
245        self
246    }
247    /// <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>
248    /// <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>
249    /// <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>
250    /// <p>Your input must be in the same Amazon Web Services region as your training job.</p>
251    pub fn get_input_data_config(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Channel>> {
252        self.inner.get_input_data_config()
253    }
254    /// <p>Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.</p>
255    pub fn output_data_config(mut self, input: crate::types::OutputDataConfig) -> Self {
256        self.inner = self.inner.output_data_config(input);
257        self
258    }
259    /// <p>Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.</p>
260    pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::OutputDataConfig>) -> Self {
261        self.inner = self.inner.set_output_data_config(input);
262        self
263    }
264    /// <p>Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.</p>
265    pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::OutputDataConfig> {
266        self.inner.get_output_data_config()
267    }
268    /// <p>The resources, including the ML compute instances and ML storage volumes, to use for model training.</p>
269    /// <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>
270    pub fn resource_config(mut self, input: crate::types::ResourceConfig) -> Self {
271        self.inner = self.inner.resource_config(input);
272        self
273    }
274    /// <p>The resources, including the ML compute instances and ML storage volumes, to use for model training.</p>
275    /// <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>
276    pub fn set_resource_config(mut self, input: ::std::option::Option<crate::types::ResourceConfig>) -> Self {
277        self.inner = self.inner.set_resource_config(input);
278        self
279    }
280    /// <p>The resources, including the ML compute instances and ML storage volumes, to use for model training.</p>
281    /// <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>
282    pub fn get_resource_config(&self) -> &::std::option::Option<crate::types::ResourceConfig> {
283        self.inner.get_resource_config()
284    }
285    /// <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>
286    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
287        self.inner = self.inner.vpc_config(input);
288        self
289    }
290    /// <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>
291    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
292        self.inner = self.inner.set_vpc_config(input);
293        self
294    }
295    /// <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>
296    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
297        self.inner.get_vpc_config()
298    }
299    /// <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>
300    /// <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>
301    pub fn stopping_condition(mut self, input: crate::types::StoppingCondition) -> Self {
302        self.inner = self.inner.stopping_condition(input);
303        self
304    }
305    /// <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>
306    /// <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>
307    pub fn set_stopping_condition(mut self, input: ::std::option::Option<crate::types::StoppingCondition>) -> Self {
308        self.inner = self.inner.set_stopping_condition(input);
309        self
310    }
311    /// <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>
312    /// <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>
313    pub fn get_stopping_condition(&self) -> &::std::option::Option<crate::types::StoppingCondition> {
314        self.inner.get_stopping_condition()
315    }
316    ///
317    /// Appends an item to `Tags`.
318    ///
319    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
320    ///
321    /// <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><important>
322    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any tags. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request tag variable or plain text fields.</p>
323    /// </important>
324    pub fn tags(mut self, input: crate::types::Tag) -> Self {
325        self.inner = self.inner.tags(input);
326        self
327    }
328    /// <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><important>
329    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any tags. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request tag variable or plain text fields.</p>
330    /// </important>
331    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
332        self.inner = self.inner.set_tags(input);
333        self
334    }
335    /// <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><important>
336    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any tags. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request tag variable or plain text fields.</p>
337    /// </important>
338    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
339        self.inner.get_tags()
340    }
341    /// <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>
342    pub fn enable_network_isolation(mut self, input: bool) -> Self {
343        self.inner = self.inner.enable_network_isolation(input);
344        self
345    }
346    /// <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>
347    pub fn set_enable_network_isolation(mut self, input: ::std::option::Option<bool>) -> Self {
348        self.inner = self.inner.set_enable_network_isolation(input);
349        self
350    }
351    /// <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>
352    pub fn get_enable_network_isolation(&self) -> &::std::option::Option<bool> {
353        self.inner.get_enable_network_isolation()
354    }
355    /// <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>
356    pub fn enable_inter_container_traffic_encryption(mut self, input: bool) -> Self {
357        self.inner = self.inner.enable_inter_container_traffic_encryption(input);
358        self
359    }
360    /// <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>
361    pub fn set_enable_inter_container_traffic_encryption(mut self, input: ::std::option::Option<bool>) -> Self {
362        self.inner = self.inner.set_enable_inter_container_traffic_encryption(input);
363        self
364    }
365    /// <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>
366    pub fn get_enable_inter_container_traffic_encryption(&self) -> &::std::option::Option<bool> {
367        self.inner.get_enable_inter_container_traffic_encryption()
368    }
369    /// <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>
370    /// <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>
371    pub fn enable_managed_spot_training(mut self, input: bool) -> Self {
372        self.inner = self.inner.enable_managed_spot_training(input);
373        self
374    }
375    /// <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>
376    /// <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>
377    pub fn set_enable_managed_spot_training(mut self, input: ::std::option::Option<bool>) -> Self {
378        self.inner = self.inner.set_enable_managed_spot_training(input);
379        self
380    }
381    /// <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>
382    /// <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>
383    pub fn get_enable_managed_spot_training(&self) -> &::std::option::Option<bool> {
384        self.inner.get_enable_managed_spot_training()
385    }
386    /// <p>Contains information about the output location for managed spot training checkpoint data.</p>
387    pub fn checkpoint_config(mut self, input: crate::types::CheckpointConfig) -> Self {
388        self.inner = self.inner.checkpoint_config(input);
389        self
390    }
391    /// <p>Contains information about the output location for managed spot training checkpoint data.</p>
392    pub fn set_checkpoint_config(mut self, input: ::std::option::Option<crate::types::CheckpointConfig>) -> Self {
393        self.inner = self.inner.set_checkpoint_config(input);
394        self
395    }
396    /// <p>Contains information about the output location for managed spot training checkpoint data.</p>
397    pub fn get_checkpoint_config(&self) -> &::std::option::Option<crate::types::CheckpointConfig> {
398        self.inner.get_checkpoint_config()
399    }
400    /// <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>
401    pub fn debug_hook_config(mut self, input: crate::types::DebugHookConfig) -> Self {
402        self.inner = self.inner.debug_hook_config(input);
403        self
404    }
405    /// <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>
406    pub fn set_debug_hook_config(mut self, input: ::std::option::Option<crate::types::DebugHookConfig>) -> Self {
407        self.inner = self.inner.set_debug_hook_config(input);
408        self
409    }
410    /// <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>
411    pub fn get_debug_hook_config(&self) -> &::std::option::Option<crate::types::DebugHookConfig> {
412        self.inner.get_debug_hook_config()
413    }
414    ///
415    /// Appends an item to `DebugRuleConfigurations`.
416    ///
417    /// To override the contents of this collection use [`set_debug_rule_configurations`](Self::set_debug_rule_configurations).
418    ///
419    /// <p>Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.</p>
420    pub fn debug_rule_configurations(mut self, input: crate::types::DebugRuleConfiguration) -> Self {
421        self.inner = self.inner.debug_rule_configurations(input);
422        self
423    }
424    /// <p>Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.</p>
425    pub fn set_debug_rule_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DebugRuleConfiguration>>) -> Self {
426        self.inner = self.inner.set_debug_rule_configurations(input);
427        self
428    }
429    /// <p>Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.</p>
430    pub fn get_debug_rule_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DebugRuleConfiguration>> {
431        self.inner.get_debug_rule_configurations()
432    }
433    /// <p>Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.</p>
434    pub fn tensor_board_output_config(mut self, input: crate::types::TensorBoardOutputConfig) -> Self {
435        self.inner = self.inner.tensor_board_output_config(input);
436        self
437    }
438    /// <p>Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.</p>
439    pub fn set_tensor_board_output_config(mut self, input: ::std::option::Option<crate::types::TensorBoardOutputConfig>) -> Self {
440        self.inner = self.inner.set_tensor_board_output_config(input);
441        self
442    }
443    /// <p>Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.</p>
444    pub fn get_tensor_board_output_config(&self) -> &::std::option::Option<crate::types::TensorBoardOutputConfig> {
445        self.inner.get_tensor_board_output_config()
446    }
447    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
448    /// <ul>
449    /// <li>
450    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
451    /// <li>
452    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
453    /// <li>
454    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
455    /// </ul>
456    pub fn experiment_config(mut self, input: crate::types::ExperimentConfig) -> Self {
457        self.inner = self.inner.experiment_config(input);
458        self
459    }
460    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
461    /// <ul>
462    /// <li>
463    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
464    /// <li>
465    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
466    /// <li>
467    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
468    /// </ul>
469    pub fn set_experiment_config(mut self, input: ::std::option::Option<crate::types::ExperimentConfig>) -> Self {
470        self.inner = self.inner.set_experiment_config(input);
471        self
472    }
473    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
474    /// <ul>
475    /// <li>
476    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
477    /// <li>
478    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
479    /// <li>
480    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
481    /// </ul>
482    pub fn get_experiment_config(&self) -> &::std::option::Option<crate::types::ExperimentConfig> {
483        self.inner.get_experiment_config()
484    }
485    /// <p>Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.</p>
486    pub fn profiler_config(mut self, input: crate::types::ProfilerConfig) -> Self {
487        self.inner = self.inner.profiler_config(input);
488        self
489    }
490    /// <p>Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.</p>
491    pub fn set_profiler_config(mut self, input: ::std::option::Option<crate::types::ProfilerConfig>) -> Self {
492        self.inner = self.inner.set_profiler_config(input);
493        self
494    }
495    /// <p>Configuration information for Amazon SageMaker Debugger system monitoring, framework profiling, and storage paths.</p>
496    pub fn get_profiler_config(&self) -> &::std::option::Option<crate::types::ProfilerConfig> {
497        self.inner.get_profiler_config()
498    }
499    ///
500    /// Appends an item to `ProfilerRuleConfigurations`.
501    ///
502    /// To override the contents of this collection use [`set_profiler_rule_configurations`](Self::set_profiler_rule_configurations).
503    ///
504    /// <p>Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.</p>
505    pub fn profiler_rule_configurations(mut self, input: crate::types::ProfilerRuleConfiguration) -> Self {
506        self.inner = self.inner.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 set_profiler_rule_configurations(
511        mut self,
512        input: ::std::option::Option<::std::vec::Vec<crate::types::ProfilerRuleConfiguration>>,
513    ) -> Self {
514        self.inner = self.inner.set_profiler_rule_configurations(input);
515        self
516    }
517    /// <p>Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.</p>
518    pub fn get_profiler_rule_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProfilerRuleConfiguration>> {
519        self.inner.get_profiler_rule_configurations()
520    }
521    ///
522    /// Adds a key-value pair to `Environment`.
523    ///
524    /// To override the contents of this collection use [`set_environment`](Self::set_environment).
525    ///
526    /// <p>The environment variables to set in the Docker container.</p><important>
527    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.</p>
528    /// </important>
529    pub fn environment(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
530        self.inner = self.inner.environment(k.into(), v.into());
531        self
532    }
533    /// <p>The environment variables to set in the Docker container.</p><important>
534    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.</p>
535    /// </important>
536    pub fn set_environment(
537        mut self,
538        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
539    ) -> Self {
540        self.inner = self.inner.set_environment(input);
541        self
542    }
543    /// <p>The environment variables to set in the Docker container.</p><important>
544    /// <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.</p>
545    /// </important>
546    pub fn get_environment(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
547        self.inner.get_environment()
548    }
549    /// <p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>
550    pub fn retry_strategy(mut self, input: crate::types::RetryStrategy) -> Self {
551        self.inner = self.inner.retry_strategy(input);
552        self
553    }
554    /// <p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>
555    pub fn set_retry_strategy(mut self, input: ::std::option::Option<crate::types::RetryStrategy>) -> Self {
556        self.inner = self.inner.set_retry_strategy(input);
557        self
558    }
559    /// <p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>
560    pub fn get_retry_strategy(&self) -> &::std::option::Option<crate::types::RetryStrategy> {
561        self.inner.get_retry_strategy()
562    }
563    /// <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>
564    pub fn remote_debug_config(mut self, input: crate::types::RemoteDebugConfig) -> Self {
565        self.inner = self.inner.remote_debug_config(input);
566        self
567    }
568    /// <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>
569    pub fn set_remote_debug_config(mut self, input: ::std::option::Option<crate::types::RemoteDebugConfig>) -> Self {
570        self.inner = self.inner.set_remote_debug_config(input);
571        self
572    }
573    /// <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>
574    pub fn get_remote_debug_config(&self) -> &::std::option::Option<crate::types::RemoteDebugConfig> {
575        self.inner.get_remote_debug_config()
576    }
577    /// <p>Contains information about the infrastructure health check configuration for the training job.</p>
578    pub fn infra_check_config(mut self, input: crate::types::InfraCheckConfig) -> Self {
579        self.inner = self.inner.infra_check_config(input);
580        self
581    }
582    /// <p>Contains information about the infrastructure health check configuration for the training job.</p>
583    pub fn set_infra_check_config(mut self, input: ::std::option::Option<crate::types::InfraCheckConfig>) -> Self {
584        self.inner = self.inner.set_infra_check_config(input);
585        self
586    }
587    /// <p>Contains information about the infrastructure health check configuration for the training job.</p>
588    pub fn get_infra_check_config(&self) -> &::std::option::Option<crate::types::InfraCheckConfig> {
589        self.inner.get_infra_check_config()
590    }
591    /// <p>Contains information about attribute-based access control (ABAC) for the training job.</p>
592    pub fn session_chaining_config(mut self, input: crate::types::SessionChainingConfig) -> Self {
593        self.inner = self.inner.session_chaining_config(input);
594        self
595    }
596    /// <p>Contains information about attribute-based access control (ABAC) for the training job.</p>
597    pub fn set_session_chaining_config(mut self, input: ::std::option::Option<crate::types::SessionChainingConfig>) -> Self {
598        self.inner = self.inner.set_session_chaining_config(input);
599        self
600    }
601    /// <p>Contains information about attribute-based access control (ABAC) for the training job.</p>
602    pub fn get_session_chaining_config(&self) -> &::std::option::Option<crate::types::SessionChainingConfig> {
603        self.inner.get_session_chaining_config()
604    }
605}