Class: AWSCDK::Sagemaker::CfnModelPackage::S3DataSourceProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sagemaker/cfn_model_package.rb

Overview

Describes the S3 data source.

Your input bucket must be in the same AWS region as your training job.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(s3_data_type:, s3_uri:) ⇒ S3DataSourceProperty

Returns a new instance of S3DataSourceProperty.

Parameters:

  • s3_data_type (String)

    If you choose S3Prefix , S3Uri identifies a key name prefix.

  • s3_uri (String)

    Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest.



2141
2142
2143
2144
2145
2146
# File 'sagemaker/cfn_model_package.rb', line 2141

def initialize(s3_data_type:, s3_uri:)
  @s3_data_type = s3_data_type
  Jsii::Type.check_type(@s3_data_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "s3DataType")
  @s3_uri = s3_uri
  Jsii::Type.check_type(@s3_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "s3Uri")
end

Instance Attribute Details

#s3_data_typeString (readonly)

If you choose S3Prefix , S3Uri identifies a key name prefix.

SageMaker uses all objects that match the specified key name prefix for model training.

If you choose ManifestFile , S3Uri identifies an object that is a manifest file containing a list of object keys that you want SageMaker to use for model training.

If you choose AugmentedManifestFile , S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training. AugmentedManifestFile can only be used if the Channel's input mode is Pipe .

If you choose Converse , S3Uri identifies an Amazon S3 location that contains data formatted according to Converse format. This format structures conversational messages with specific roles and content types used for training and fine-tuning foundational models.



2160
2161
2162
# File 'sagemaker/cfn_model_package.rb', line 2160

def s3_data_type
  @s3_data_type
end

#s3_uriString (readonly)

Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest.

For example:

  • A key name prefix might look like this: s3://bucketname/exampleprefix/
  • A manifest might look like this: s3://bucketname/example.manifest

A manifest is an S3 object which is a JSON file consisting of an array of elements. The first element is a prefix which is followed by one or more suffixes. SageMaker appends the suffix elements to the prefix to get a full set of S3Uri . Note that the prefix must be a valid non-empty S3Uri that precludes users from specifying a manifest whose individual S3Uri is sourced from different S3 buckets.

The following code example shows a valid manifest format:

[ {"prefix": "s3://customer_bucket/some/prefix/"},

"relative/path/to/custdata-1",

"relative/path/custdata-2",

...

"relative/path/custdata-N"

]

This JSON is equivalent to the following S3Uri list:

s3://customer_bucket/some/prefix/relative/path/to/custdata-1

s3://customer_bucket/some/prefix/relative/path/custdata-2

...

s3://customer_bucket/some/prefix/relative/path/custdata-N

The complete set of S3Uri in this manifest is the input data for the channel for this data source. The object that each S3Uri points to must be readable by the IAM role that SageMaker uses to perform tasks on your behalf.

Your input bucket must be located in same AWS region as your training job.



2200
2201
2202
# File 'sagemaker/cfn_model_package.rb', line 2200

def s3_uri
  @s3_uri
end

Class Method Details

.jsii_propertiesObject



2202
2203
2204
2205
2206
2207
# File 'sagemaker/cfn_model_package.rb', line 2202

def self.jsii_properties
  {
    :s3_data_type => "s3DataType",
    :s3_uri => "s3Uri",
  }
end

Instance Method Details

#to_jsiiObject



2209
2210
2211
2212
2213
2214
2215
2216
# File 'sagemaker/cfn_model_package.rb', line 2209

def to_jsii
  result = {}
  result.merge!({
    "s3DataType" => @s3_data_type,
    "s3Uri" => @s3_uri,
  })
  result.compact
end