/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace SageMaker { namespace Model { /** *

Specifies the S3 location of ML model data to deploy.

See * Also:

AWS * API Reference

*/ class S3ModelDataSource { public: AWS_SAGEMAKER_API S3ModelDataSource(); AWS_SAGEMAKER_API S3ModelDataSource(Aws::Utils::Json::JsonView jsonValue); AWS_SAGEMAKER_API S3ModelDataSource& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_SAGEMAKER_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

Specifies the S3 path of ML model data to deploy.

*/ inline const Aws::String& GetS3Uri() const{ return m_s3Uri; } /** *

Specifies the S3 path of ML model data to deploy.

*/ inline bool S3UriHasBeenSet() const { return m_s3UriHasBeenSet; } /** *

Specifies the S3 path of ML model data to deploy.

*/ inline void SetS3Uri(const Aws::String& value) { m_s3UriHasBeenSet = true; m_s3Uri = value; } /** *

Specifies the S3 path of ML model data to deploy.

*/ inline void SetS3Uri(Aws::String&& value) { m_s3UriHasBeenSet = true; m_s3Uri = std::move(value); } /** *

Specifies the S3 path of ML model data to deploy.

*/ inline void SetS3Uri(const char* value) { m_s3UriHasBeenSet = true; m_s3Uri.assign(value); } /** *

Specifies the S3 path of ML model data to deploy.

*/ inline S3ModelDataSource& WithS3Uri(const Aws::String& value) { SetS3Uri(value); return *this;} /** *

Specifies the S3 path of ML model data to deploy.

*/ inline S3ModelDataSource& WithS3Uri(Aws::String&& value) { SetS3Uri(std::move(value)); return *this;} /** *

Specifies the S3 path of ML model data to deploy.

*/ inline S3ModelDataSource& WithS3Uri(const char* value) { SetS3Uri(value); return *this;} /** *

Specifies the type of ML model data to deploy.

If you choose * S3Prefix, S3Uri identifies 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 by * S3Uri always ends with a forward slash (/).

If you choose * S3Object, S3Uri identifies an object that is the ML * model data to deploy.

*/ inline const S3ModelDataType& GetS3DataType() const{ return m_s3DataType; } /** *

Specifies the type of ML model data to deploy.

If you choose * S3Prefix, S3Uri identifies 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 by * S3Uri always ends with a forward slash (/).

If you choose * S3Object, S3Uri identifies an object that is the ML * model data to deploy.

*/ inline bool S3DataTypeHasBeenSet() const { return m_s3DataTypeHasBeenSet; } /** *

Specifies the type of ML model data to deploy.

If you choose * S3Prefix, S3Uri identifies 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 by * S3Uri always ends with a forward slash (/).

If you choose * S3Object, S3Uri identifies an object that is the ML * model data to deploy.

*/ inline void SetS3DataType(const S3ModelDataType& value) { m_s3DataTypeHasBeenSet = true; m_s3DataType = value; } /** *

Specifies the type of ML model data to deploy.

If you choose * S3Prefix, S3Uri identifies 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 by * S3Uri always ends with a forward slash (/).

If you choose * S3Object, S3Uri identifies an object that is the ML * model data to deploy.

*/ inline void SetS3DataType(S3ModelDataType&& value) { m_s3DataTypeHasBeenSet = true; m_s3DataType = std::move(value); } /** *

Specifies the type of ML model data to deploy.

If you choose * S3Prefix, S3Uri identifies 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 by * S3Uri always ends with a forward slash (/).

If you choose * S3Object, S3Uri identifies an object that is the ML * model data to deploy.

*/ inline S3ModelDataSource& WithS3DataType(const S3ModelDataType& value) { SetS3DataType(value); return *this;} /** *

Specifies the type of ML model data to deploy.

If you choose * S3Prefix, S3Uri identifies 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 by * S3Uri always ends with a forward slash (/).

If you choose * S3Object, S3Uri identifies an object that is the ML * model data to deploy.

*/ inline S3ModelDataSource& WithS3DataType(S3ModelDataType&& value) { SetS3DataType(std::move(value)); return *this;} /** *

Specifies how the ML model data is prepared.

If you choose * Gzip and choose S3Object as the value of * S3DataType, S3Uri identifies an object that is a * gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the * object during model deployment.

If you choose None and * chooose S3Object as the value of S3DataType, * S3Uri identifies an object that represents an uncompressed ML model * to deploy.

If you choose None and choose S3Prefix as the * value of S3DataType, S3Uri identifies 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 S3Object as the * value of S3DataType, then SageMaker will split the key of the S3 * object referenced by S3Uri by slash (/), and use the last part as * the filename of the file holding the content of the S3 object.

  • *

    If you choose S3Prefix as the value of S3DataType, * then for each S3 object under the key name pefix referenced by * S3Uri, 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/weights and * s3://mybucket/model/weights/part1 and you specify * s3://mybucket/model/ as the value of S3Uri and * S3Prefix as the value of S3DataType, 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.

*/ inline const ModelCompressionType& GetCompressionType() const{ return m_compressionType; } /** *

Specifies how the ML model data is prepared.

If you choose * Gzip and choose S3Object as the value of * S3DataType, S3Uri identifies an object that is a * gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the * object during model deployment.

If you choose None and * chooose S3Object as the value of S3DataType, * S3Uri identifies an object that represents an uncompressed ML model * to deploy.

If you choose None and choose S3Prefix as the * value of S3DataType, S3Uri identifies 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 S3Object as the * value of S3DataType, then SageMaker will split the key of the S3 * object referenced by S3Uri by slash (/), and use the last part as * the filename of the file holding the content of the S3 object.

  • *

    If you choose S3Prefix as the value of S3DataType, * then for each S3 object under the key name pefix referenced by * S3Uri, 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/weights and * s3://mybucket/model/weights/part1 and you specify * s3://mybucket/model/ as the value of S3Uri and * S3Prefix as the value of S3DataType, 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.

*/ inline bool CompressionTypeHasBeenSet() const { return m_compressionTypeHasBeenSet; } /** *

Specifies how the ML model data is prepared.

If you choose * Gzip and choose S3Object as the value of * S3DataType, S3Uri identifies an object that is a * gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the * object during model deployment.

If you choose None and * chooose S3Object as the value of S3DataType, * S3Uri identifies an object that represents an uncompressed ML model * to deploy.

If you choose None and choose S3Prefix as the * value of S3DataType, S3Uri identifies 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 S3Object as the * value of S3DataType, then SageMaker will split the key of the S3 * object referenced by S3Uri by slash (/), and use the last part as * the filename of the file holding the content of the S3 object.

  • *

    If you choose S3Prefix as the value of S3DataType, * then for each S3 object under the key name pefix referenced by * S3Uri, 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/weights and * s3://mybucket/model/weights/part1 and you specify * s3://mybucket/model/ as the value of S3Uri and * S3Prefix as the value of S3DataType, 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.

*/ inline void SetCompressionType(const ModelCompressionType& value) { m_compressionTypeHasBeenSet = true; m_compressionType = value; } /** *

Specifies how the ML model data is prepared.

If you choose * Gzip and choose S3Object as the value of * S3DataType, S3Uri identifies an object that is a * gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the * object during model deployment.

If you choose None and * chooose S3Object as the value of S3DataType, * S3Uri identifies an object that represents an uncompressed ML model * to deploy.

If you choose None and choose S3Prefix as the * value of S3DataType, S3Uri identifies 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 S3Object as the * value of S3DataType, then SageMaker will split the key of the S3 * object referenced by S3Uri by slash (/), and use the last part as * the filename of the file holding the content of the S3 object.

  • *

    If you choose S3Prefix as the value of S3DataType, * then for each S3 object under the key name pefix referenced by * S3Uri, 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/weights and * s3://mybucket/model/weights/part1 and you specify * s3://mybucket/model/ as the value of S3Uri and * S3Prefix as the value of S3DataType, 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.

*/ inline void SetCompressionType(ModelCompressionType&& value) { m_compressionTypeHasBeenSet = true; m_compressionType = std::move(value); } /** *

Specifies how the ML model data is prepared.

If you choose * Gzip and choose S3Object as the value of * S3DataType, S3Uri identifies an object that is a * gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the * object during model deployment.

If you choose None and * chooose S3Object as the value of S3DataType, * S3Uri identifies an object that represents an uncompressed ML model * to deploy.

If you choose None and choose S3Prefix as the * value of S3DataType, S3Uri identifies 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 S3Object as the * value of S3DataType, then SageMaker will split the key of the S3 * object referenced by S3Uri by slash (/), and use the last part as * the filename of the file holding the content of the S3 object.

  • *

    If you choose S3Prefix as the value of S3DataType, * then for each S3 object under the key name pefix referenced by * S3Uri, 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/weights and * s3://mybucket/model/weights/part1 and you specify * s3://mybucket/model/ as the value of S3Uri and * S3Prefix as the value of S3DataType, 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.

*/ inline S3ModelDataSource& WithCompressionType(const ModelCompressionType& value) { SetCompressionType(value); return *this;} /** *

Specifies how the ML model data is prepared.

If you choose * Gzip and choose S3Object as the value of * S3DataType, S3Uri identifies an object that is a * gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the * object during model deployment.

If you choose None and * chooose S3Object as the value of S3DataType, * S3Uri identifies an object that represents an uncompressed ML model * to deploy.

If you choose None and choose S3Prefix as the * value of S3DataType, S3Uri identifies 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 S3Object as the * value of S3DataType, then SageMaker will split the key of the S3 * object referenced by S3Uri by slash (/), and use the last part as * the filename of the file holding the content of the S3 object.

  • *

    If you choose S3Prefix as the value of S3DataType, * then for each S3 object under the key name pefix referenced by * S3Uri, 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/weights and * s3://mybucket/model/weights/part1 and you specify * s3://mybucket/model/ as the value of S3Uri and * S3Prefix as the value of S3DataType, 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.

*/ inline S3ModelDataSource& WithCompressionType(ModelCompressionType&& value) { SetCompressionType(std::move(value)); return *this;} private: Aws::String m_s3Uri; bool m_s3UriHasBeenSet = false; S3ModelDataType m_s3DataType; bool m_s3DataTypeHasBeenSet = false; ModelCompressionType m_compressionType; bool m_compressionTypeHasBeenSet = false; }; } // namespace Model } // namespace SageMaker } // namespace Aws