#[non_exhaustive]pub struct ContainerDefinitionBuilder { /* private fields */ }
Expand description
A builder for ContainerDefinition
.
Implementations§
Source§impl ContainerDefinitionBuilder
impl ContainerDefinitionBuilder
Sourcepub fn container_hostname(self, input: impl Into<String>) -> Self
pub fn container_hostname(self, input: impl Into<String>) -> Self
This parameter is ignored for models that contain only a PrimaryContainer
.
When a ContainerDefinition
is part of an inference pipeline, the value of the parameter uniquely identifies the container for the purposes of logging and metrics. For information, see Use Logs and Metrics to Monitor an Inference Pipeline. If you don't specify a value for this parameter for a ContainerDefinition
that is part of an inference pipeline, a unique name is automatically assigned based on the position of the ContainerDefinition
in the pipeline. If you specify a value for the ContainerHostName
for any ContainerDefinition
that is part of an inference pipeline, you must specify a value for the ContainerHostName
parameter of every ContainerDefinition
in that pipeline.
Sourcepub fn set_container_hostname(self, input: Option<String>) -> Self
pub fn set_container_hostname(self, input: Option<String>) -> Self
This parameter is ignored for models that contain only a PrimaryContainer
.
When a ContainerDefinition
is part of an inference pipeline, the value of the parameter uniquely identifies the container for the purposes of logging and metrics. For information, see Use Logs and Metrics to Monitor an Inference Pipeline. If you don't specify a value for this parameter for a ContainerDefinition
that is part of an inference pipeline, a unique name is automatically assigned based on the position of the ContainerDefinition
in the pipeline. If you specify a value for the ContainerHostName
for any ContainerDefinition
that is part of an inference pipeline, you must specify a value for the ContainerHostName
parameter of every ContainerDefinition
in that pipeline.
Sourcepub fn get_container_hostname(&self) -> &Option<String>
pub fn get_container_hostname(&self) -> &Option<String>
This parameter is ignored for models that contain only a PrimaryContainer
.
When a ContainerDefinition
is part of an inference pipeline, the value of the parameter uniquely identifies the container for the purposes of logging and metrics. For information, see Use Logs and Metrics to Monitor an Inference Pipeline. If you don't specify a value for this parameter for a ContainerDefinition
that is part of an inference pipeline, a unique name is automatically assigned based on the position of the ContainerDefinition
in the pipeline. If you specify a value for the ContainerHostName
for any ContainerDefinition
that is part of an inference pipeline, you must specify a value for the ContainerHostName
parameter of every ContainerDefinition
in that pipeline.
Sourcepub fn image(self, input: impl Into<String>) -> Self
pub fn image(self, input: impl Into<String>) -> Self
The path where inference code is stored. This can be either in Amazon EC2 Container Registry or in a Docker registry that is accessible from the same VPC that you configure for your endpoint. If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports both registry/repository\[:tag\]
and registry/repository\[@digest\]
image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker.
The model artifacts in an Amazon S3 bucket and the Docker image for inference container in Amazon EC2 Container Registry must be in the same region as the model or endpoint you are creating.
Sourcepub fn set_image(self, input: Option<String>) -> Self
pub fn set_image(self, input: Option<String>) -> Self
The path where inference code is stored. This can be either in Amazon EC2 Container Registry or in a Docker registry that is accessible from the same VPC that you configure for your endpoint. If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports both registry/repository\[:tag\]
and registry/repository\[@digest\]
image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker.
The model artifacts in an Amazon S3 bucket and the Docker image for inference container in Amazon EC2 Container Registry must be in the same region as the model or endpoint you are creating.
Sourcepub fn get_image(&self) -> &Option<String>
pub fn get_image(&self) -> &Option<String>
The path where inference code is stored. This can be either in Amazon EC2 Container Registry or in a Docker registry that is accessible from the same VPC that you configure for your endpoint. If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports both registry/repository\[:tag\]
and registry/repository\[@digest\]
image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker.
The model artifacts in an Amazon S3 bucket and the Docker image for inference container in Amazon EC2 Container Registry must be in the same region as the model or endpoint you are creating.
Sourcepub fn image_config(self, input: ImageConfig) -> Self
pub fn image_config(self, input: ImageConfig) -> Self
Specifies whether the model container is in Amazon ECR or a private Docker registry accessible from your Amazon Virtual Private Cloud (VPC). For information about storing containers in a private Docker registry, see Use a Private Docker Registry for Real-Time Inference Containers.
The model artifacts in an Amazon S3 bucket and the Docker image for inference container in Amazon EC2 Container Registry must be in the same region as the model or endpoint you are creating.
Sourcepub fn set_image_config(self, input: Option<ImageConfig>) -> Self
pub fn set_image_config(self, input: Option<ImageConfig>) -> Self
Specifies whether the model container is in Amazon ECR or a private Docker registry accessible from your Amazon Virtual Private Cloud (VPC). For information about storing containers in a private Docker registry, see Use a Private Docker Registry for Real-Time Inference Containers.
The model artifacts in an Amazon S3 bucket and the Docker image for inference container in Amazon EC2 Container Registry must be in the same region as the model or endpoint you are creating.
Sourcepub fn get_image_config(&self) -> &Option<ImageConfig>
pub fn get_image_config(&self) -> &Option<ImageConfig>
Specifies whether the model container is in Amazon ECR or a private Docker registry accessible from your Amazon Virtual Private Cloud (VPC). For information about storing containers in a private Docker registry, see Use a Private Docker Registry for Real-Time Inference Containers.
The model artifacts in an Amazon S3 bucket and the Docker image for inference container in Amazon EC2 Container Registry must be in the same region as the model or endpoint you are creating.
Sourcepub fn mode(self, input: ContainerMode) -> Self
pub fn mode(self, input: ContainerMode) -> Self
Whether the container hosts a single model or multiple models.
Sourcepub fn set_mode(self, input: Option<ContainerMode>) -> Self
pub fn set_mode(self, input: Option<ContainerMode>) -> Self
Whether the container hosts a single model or multiple models.
Sourcepub fn get_mode(&self) -> &Option<ContainerMode>
pub fn get_mode(&self) -> &Option<ContainerMode>
Whether the container hosts a single model or multiple models.
Sourcepub fn model_data_url(self, input: impl Into<String>) -> Self
pub fn model_data_url(self, input: impl Into<String>) -> Self
The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix). The S3 path is required for SageMaker built-in algorithms, but not if you use your own algorithms. For more information on built-in algorithms, see Common Parameters.
The model artifacts must be in an S3 bucket that is in the same region as the model or endpoint you are creating.
If you provide a value for this parameter, SageMaker uses Amazon Web Services Security Token Service to download model artifacts from the S3 path you provide. Amazon Web Services STS is activated in your Amazon Web Services account by default. If you previously deactivated Amazon Web Services STS for a region, you need to reactivate Amazon Web Services STS for that region. For more information, see Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region in the Amazon Web Services Identity and Access Management User Guide.
If you use a built-in algorithm to create a model, SageMaker requires that you provide a S3 path to the model artifacts in ModelDataUrl
.
Sourcepub fn set_model_data_url(self, input: Option<String>) -> Self
pub fn set_model_data_url(self, input: Option<String>) -> Self
The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix). The S3 path is required for SageMaker built-in algorithms, but not if you use your own algorithms. For more information on built-in algorithms, see Common Parameters.
The model artifacts must be in an S3 bucket that is in the same region as the model or endpoint you are creating.
If you provide a value for this parameter, SageMaker uses Amazon Web Services Security Token Service to download model artifacts from the S3 path you provide. Amazon Web Services STS is activated in your Amazon Web Services account by default. If you previously deactivated Amazon Web Services STS for a region, you need to reactivate Amazon Web Services STS for that region. For more information, see Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region in the Amazon Web Services Identity and Access Management User Guide.
If you use a built-in algorithm to create a model, SageMaker requires that you provide a S3 path to the model artifacts in ModelDataUrl
.
Sourcepub fn get_model_data_url(&self) -> &Option<String>
pub fn get_model_data_url(&self) -> &Option<String>
The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix). The S3 path is required for SageMaker built-in algorithms, but not if you use your own algorithms. For more information on built-in algorithms, see Common Parameters.
The model artifacts must be in an S3 bucket that is in the same region as the model or endpoint you are creating.
If you provide a value for this parameter, SageMaker uses Amazon Web Services Security Token Service to download model artifacts from the S3 path you provide. Amazon Web Services STS is activated in your Amazon Web Services account by default. If you previously deactivated Amazon Web Services STS for a region, you need to reactivate Amazon Web Services STS for that region. For more information, see Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region in the Amazon Web Services Identity and Access Management User Guide.
If you use a built-in algorithm to create a model, SageMaker requires that you provide a S3 path to the model artifacts in ModelDataUrl
.
Sourcepub fn model_data_source(self, input: ModelDataSource) -> Self
pub fn model_data_source(self, input: ModelDataSource) -> Self
Specifies the location of ML model data to deploy.
Currently you cannot use ModelDataSource
in conjunction with SageMaker batch transform, SageMaker serverless endpoints, SageMaker multi-model endpoints, and SageMaker Marketplace.
Sourcepub fn set_model_data_source(self, input: Option<ModelDataSource>) -> Self
pub fn set_model_data_source(self, input: Option<ModelDataSource>) -> Self
Specifies the location of ML model data to deploy.
Currently you cannot use ModelDataSource
in conjunction with SageMaker batch transform, SageMaker serverless endpoints, SageMaker multi-model endpoints, and SageMaker Marketplace.
Sourcepub fn get_model_data_source(&self) -> &Option<ModelDataSource>
pub fn get_model_data_source(&self) -> &Option<ModelDataSource>
Specifies the location of ML model data to deploy.
Currently you cannot use ModelDataSource
in conjunction with SageMaker batch transform, SageMaker serverless endpoints, SageMaker multi-model endpoints, and SageMaker Marketplace.
Sourcepub fn additional_model_data_sources(
self,
input: AdditionalModelDataSource,
) -> Self
pub fn additional_model_data_sources( self, input: AdditionalModelDataSource, ) -> Self
Appends an item to additional_model_data_sources
.
To override the contents of this collection use set_additional_model_data_sources
.
Data sources that are available to your model in addition to the one that you specify for ModelDataSource
when you use the CreateModel
action.
Sourcepub fn set_additional_model_data_sources(
self,
input: Option<Vec<AdditionalModelDataSource>>,
) -> Self
pub fn set_additional_model_data_sources( self, input: Option<Vec<AdditionalModelDataSource>>, ) -> Self
Data sources that are available to your model in addition to the one that you specify for ModelDataSource
when you use the CreateModel
action.
Sourcepub fn get_additional_model_data_sources(
&self,
) -> &Option<Vec<AdditionalModelDataSource>>
pub fn get_additional_model_data_sources( &self, ) -> &Option<Vec<AdditionalModelDataSource>>
Data sources that are available to your model in addition to the one that you specify for ModelDataSource
when you use the CreateModel
action.
Sourcepub fn environment(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn environment(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to environment
.
To override the contents of this collection use set_environment
.
The environment variables to set in the Docker container. Don't include any sensitive data in your environment variables.
The maximum length of each key and value in the Environment
map is 1024 bytes. The maximum length of all keys and values in the map, combined, is 32 KB. If you pass multiple containers to a CreateModel
request, then the maximum length of all of their maps, combined, is also 32 KB.
Sourcepub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
The environment variables to set in the Docker container. Don't include any sensitive data in your environment variables.
The maximum length of each key and value in the Environment
map is 1024 bytes. The maximum length of all keys and values in the map, combined, is 32 KB. If you pass multiple containers to a CreateModel
request, then the maximum length of all of their maps, combined, is also 32 KB.
Sourcepub fn get_environment(&self) -> &Option<HashMap<String, String>>
pub fn get_environment(&self) -> &Option<HashMap<String, String>>
The environment variables to set in the Docker container. Don't include any sensitive data in your environment variables.
The maximum length of each key and value in the Environment
map is 1024 bytes. The maximum length of all keys and values in the map, combined, is 32 KB. If you pass multiple containers to a CreateModel
request, then the maximum length of all of their maps, combined, is also 32 KB.
Sourcepub fn model_package_name(self, input: impl Into<String>) -> Self
pub fn model_package_name(self, input: impl Into<String>) -> Self
The name or Amazon Resource Name (ARN) of the model package to use to create the model.
Sourcepub fn set_model_package_name(self, input: Option<String>) -> Self
pub fn set_model_package_name(self, input: Option<String>) -> Self
The name or Amazon Resource Name (ARN) of the model package to use to create the model.
Sourcepub fn get_model_package_name(&self) -> &Option<String>
pub fn get_model_package_name(&self) -> &Option<String>
The name or Amazon Resource Name (ARN) of the model package to use to create the model.
Sourcepub fn inference_specification_name(self, input: impl Into<String>) -> Self
pub fn inference_specification_name(self, input: impl Into<String>) -> Self
The inference specification name in the model package version.
Sourcepub fn set_inference_specification_name(self, input: Option<String>) -> Self
pub fn set_inference_specification_name(self, input: Option<String>) -> Self
The inference specification name in the model package version.
Sourcepub fn get_inference_specification_name(&self) -> &Option<String>
pub fn get_inference_specification_name(&self) -> &Option<String>
The inference specification name in the model package version.
Sourcepub fn multi_model_config(self, input: MultiModelConfig) -> Self
pub fn multi_model_config(self, input: MultiModelConfig) -> Self
Specifies additional configuration for multi-model endpoints.
Sourcepub fn set_multi_model_config(self, input: Option<MultiModelConfig>) -> Self
pub fn set_multi_model_config(self, input: Option<MultiModelConfig>) -> Self
Specifies additional configuration for multi-model endpoints.
Sourcepub fn get_multi_model_config(&self) -> &Option<MultiModelConfig>
pub fn get_multi_model_config(&self) -> &Option<MultiModelConfig>
Specifies additional configuration for multi-model endpoints.
Sourcepub fn build(self) -> ContainerDefinition
pub fn build(self) -> ContainerDefinition
Consumes the builder and constructs a ContainerDefinition
.
Trait Implementations§
Source§impl Clone for ContainerDefinitionBuilder
impl Clone for ContainerDefinitionBuilder
Source§fn clone(&self) -> ContainerDefinitionBuilder
fn clone(&self) -> ContainerDefinitionBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ContainerDefinitionBuilder
impl Debug for ContainerDefinitionBuilder
Source§impl Default for ContainerDefinitionBuilder
impl Default for ContainerDefinitionBuilder
Source§fn default() -> ContainerDefinitionBuilder
fn default() -> ContainerDefinitionBuilder
impl StructuralPartialEq for ContainerDefinitionBuilder
Auto Trait Implementations§
impl Freeze for ContainerDefinitionBuilder
impl RefUnwindSafe for ContainerDefinitionBuilder
impl Send for ContainerDefinitionBuilder
impl Sync for ContainerDefinitionBuilder
impl Unpin for ContainerDefinitionBuilder
impl UnwindSafe for ContainerDefinitionBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);