Class S3ModelDataSource

java.lang.Object
software.amazon.awssdk.services.sagemaker.model.S3ModelDataSource
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<S3ModelDataSource.Builder,S3ModelDataSource>

@Generated("software.amazon.awssdk:codegen") public final class S3ModelDataSource extends Object implements SdkPojo, Serializable, ToCopyableBuilder<S3ModelDataSource.Builder,S3ModelDataSource>

Specifies the S3 location of ML model data to deploy.

See Also:
  • Method Details

    • s3Uri

      public final String s3Uri()

      Specifies the S3 path of ML model data to deploy.

      Returns:
      Specifies the S3 path of ML model data to deploy.
    • s3DataType

      public final S3ModelDataType 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.

      If the service returns an enum value that is not available in the current SDK version, s3DataType will return S3ModelDataType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from s3DataTypeAsString().

      Returns:
      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.

      See Also:
    • s3DataTypeAsString

      public final String s3DataTypeAsString()

      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.

      If the service returns an enum value that is not available in the current SDK version, s3DataType will return S3ModelDataType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from s3DataTypeAsString().

      Returns:
      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.

      See Also:
    • compressionType

      public final ModelCompressionType 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.

      If the service returns an enum value that is not available in the current SDK version, compressionType will return ModelCompressionType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from compressionTypeAsString().

      Returns:
      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.

      See Also:
    • compressionTypeAsString

      public final String compressionTypeAsString()

      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.

      If the service returns an enum value that is not available in the current SDK version, compressionType will return ModelCompressionType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from compressionTypeAsString().

      Returns:
      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.

      See Also:
    • modelAccessConfig

      public final ModelAccessConfig modelAccessConfig()

      Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within the ModelAccessConfig. 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:
      Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within the ModelAccessConfig. 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.
    • toBuilder

      public S3ModelDataSource.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<S3ModelDataSource.Builder,S3ModelDataSource>
      Returns:
      a builder for type T
    • builder

      public static S3ModelDataSource.Builder builder()
    • serializableBuilderClass

      public static Class<? extends S3ModelDataSource.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.