Class CfnModelPackagePropsMixin.S3ModelDataSourceProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnModelPackagePropsMixin.S3ModelDataSourceProperty>
- Enclosing interface:
CfnModelPackagePropsMixin.S3ModelDataSourceProperty
CfnModelPackagePropsMixin.S3ModelDataSourceProperty-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.compressionType(String compressionType) Sets the value ofCfnModelPackagePropsMixin.S3ModelDataSourceProperty.getCompressionType()modelAccessConfig(CfnModelPackagePropsMixin.ModelAccessConfigProperty modelAccessConfig) modelAccessConfig(IResolvable modelAccessConfig) s3DataType(String s3DataType) Sets the value ofCfnModelPackagePropsMixin.S3ModelDataSourceProperty.getS3DataType()Sets the value ofCfnModelPackagePropsMixin.S3ModelDataSourceProperty.getS3Uri()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
compressionType
@Stability(Stable) public CfnModelPackagePropsMixin.S3ModelDataSourceProperty.Builder compressionType(String compressionType) Sets the value ofCfnModelPackagePropsMixin.S3ModelDataSourceProperty.getCompressionType()- Parameters:
compressionType- Specifies how the ML model data is prepared. If you chooseGzipand chooseS3Objectas the value ofS3DataType,S3Uriidentifies an object that is a gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the object during model deployment.If you choose
Noneand choooseS3Objectas the value ofS3DataType,S3Uriidentifies an object that represents an uncompressed ML model to deploy.If you choose None and choose
S3Prefixas the value ofS3DataType,S3Uriidentifies a key name prefix, under which all objects represents the uncompressed ML model to deploy.If you choose None, then SageMaker will follow rules below when creating model data files under /opt/ml/model directory for use by your inference code:
- If you choose
S3Objectas the value ofS3DataType, then SageMaker will split the key of the S3 object referenced byS3Uriby slash (/), and use the last part as the filename of the file holding the content of the S3 object. - If you choose
S3Prefixas the value ofS3DataType, then for each S3 object under the key name pefix referenced byS3Uri, SageMaker will trim its key by the prefix, and use the remainder as the path (relative to/opt/ml/model) of the file holding the content of the S3 object. SageMaker will split the remainder by slash (/), using intermediate parts as directory names and the last part as filename of the file holding the content of the S3 object. - Do not use any of the following as file names or directory names:
- An empty or blank string
- A string which contains null bytes
- A string longer than 255 bytes
- A single dot (
.) - A double dot (
..) - Ambiguous file names will result in model deployment failure. For example, if your uncompressed ML model consists of two S3 objects
s3://mybucket/model/weightsands3://mybucket/model/weights/part1and you specifys3://mybucket/model/as the value ofS3UriandS3Prefixas the value ofS3DataType, then it will result in name clash between/opt/ml/model/weights(a regular file) and/opt/ml/model/weights/(a directory). - Do not organize the model artifacts in S3 console using folders . When you create a folder in S3 console, S3 creates a 0-byte object with a key set to the folder name you provide. They key of the 0-byte object ends with a slash (/) which violates SageMaker restrictions on model artifact file names, leading to model deployment failure.
- If you choose
- Returns:
this
-
modelAccessConfig
@Stability(Stable) public CfnModelPackagePropsMixin.S3ModelDataSourceProperty.Builder modelAccessConfig(IResolvable modelAccessConfig) - Parameters:
modelAccessConfig- Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within theModelAccessConfig. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.- Returns:
this
-
modelAccessConfig
@Stability(Stable) public CfnModelPackagePropsMixin.S3ModelDataSourceProperty.Builder modelAccessConfig(CfnModelPackagePropsMixin.ModelAccessConfigProperty modelAccessConfig) - Parameters:
modelAccessConfig- Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within theModelAccessConfig. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.- Returns:
this
-
s3DataType
@Stability(Stable) public CfnModelPackagePropsMixin.S3ModelDataSourceProperty.Builder s3DataType(String s3DataType) Sets the value ofCfnModelPackagePropsMixin.S3ModelDataSourceProperty.getS3DataType()- Parameters:
s3DataType- Specifies the type of ML model data to deploy. If you chooseS3Prefix,S3Uriidentifies a key name prefix. SageMaker uses all objects that match the specified key name prefix as part of the ML model data to deploy. A valid key name prefix identified byS3Urialways ends with a forward slash (/).If you choose
S3Object,S3Uriidentifies an object that is the ML model data to deploy.- Returns:
this
-
s3Uri
@Stability(Stable) public CfnModelPackagePropsMixin.S3ModelDataSourceProperty.Builder s3Uri(String s3Uri) Sets the value ofCfnModelPackagePropsMixin.S3ModelDataSourceProperty.getS3Uri()- Parameters:
s3Uri- Specifies the S3 path of ML model data to deploy.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CfnModelPackagePropsMixin.S3ModelDataSourceProperty>- Returns:
- a new instance of
CfnModelPackagePropsMixin.S3ModelDataSourceProperty - Throws:
NullPointerException- if any required attribute was not provided
-