Class: AWSCDK::Sagemaker::CfnModelPackage::ModelPackageContainerDefinitionProperty

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

Overview

Describes the Docker container for the model package.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image:, container_hostname: nil, environment: nil, framework: nil, framework_version: nil, image_digest: nil, model_data_source: nil, model_data_url: nil, model_input: nil, nearest_model_name: nil) ⇒ ModelPackageContainerDefinitionProperty

Returns a new instance of ModelPackageContainerDefinitionProperty.

Parameters:

  • image (String)

    The Amazon Elastic Container Registry (Amazon ECR) path where inference code is stored.

  • container_hostname (String, nil) (defaults to: nil)

    The DNS host name for the Docker container.

  • environment (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    The environment variables to set in the Docker container.

  • framework (String, nil) (defaults to: nil)

    The machine learning framework of the model package container image.

  • framework_version (String, nil) (defaults to: nil)

    The framework version of the Model Package Container Image.

  • image_digest (String, nil) (defaults to: nil)

    An MD5 hash of the training algorithm that identifies the Docker image used for training.

  • model_data_source (AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnModelPackage::ModelDataSourceProperty, nil) (defaults to: nil)

    Specifies the location of ML model data to deploy during endpoint creation.

  • model_data_url (String, nil) (defaults to: nil)

    The Amazon S3 path where the model artifacts, which result from model training, are stored.

  • model_input (Object, nil) (defaults to: nil)

    A structure with Model Input details.

  • nearest_model_name (String, nil) (defaults to: nil)

    The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model.



1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
# File 'sagemaker/cfn_model_package.rb', line 1885

def initialize(image:, container_hostname: nil, environment: nil, framework: nil, framework_version: nil, image_digest: nil, model_data_source: nil, model_data_url: nil, model_input: nil, nearest_model_name: nil)
  @image = image
  Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "image")
  @container_hostname = container_hostname
  Jsii::Type.check_type(@container_hostname, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerHostname") unless @container_hostname.nil?
  @environment = environment
  Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "environment") unless @environment.nil?
  @framework = framework
  Jsii::Type.check_type(@framework, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "framework") unless @framework.nil?
  @framework_version = framework_version
  Jsii::Type.check_type(@framework_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "frameworkVersion") unless @framework_version.nil?
  @image_digest = image_digest
  Jsii::Type.check_type(@image_digest, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageDigest") unless @image_digest.nil?
  @model_data_source = model_data_source.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnModelPackage::ModelDataSourceProperty.new(**model_data_source.transform_keys(&:to_sym)) : model_data_source
  Jsii::Type.check_type(@model_data_source, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuTW9kZWxQYWNrYWdlLk1vZGVsRGF0YVNvdXJjZVByb3BlcnR5In1dfX0=")), "modelDataSource") unless @model_data_source.nil?
  @model_data_url = model_data_url
  Jsii::Type.check_type(@model_data_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelDataUrl") unless @model_data_url.nil?
  @model_input = model_input
  Jsii::Type.check_type(@model_input, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "modelInput") unless @model_input.nil?
  @nearest_model_name = nearest_model_name
  Jsii::Type.check_type(@nearest_model_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nearestModelName") unless @nearest_model_name.nil?
end

Instance Attribute Details

#container_hostnameString? (readonly)

The DNS host name for the Docker container.



1919
1920
1921
# File 'sagemaker/cfn_model_package.rb', line 1919

def container_hostname
  @container_hostname
end

#environmentAWSCDK::IResolvable, ... (readonly)

The environment variables to set in the Docker container.

Each key and value in the Environment string to string map can have length of up to 1024. We support up to 16 entries in the map.



1926
1927
1928
# File 'sagemaker/cfn_model_package.rb', line 1926

def environment
  @environment
end

#frameworkString? (readonly)

The machine learning framework of the model package container image.



1931
1932
1933
# File 'sagemaker/cfn_model_package.rb', line 1931

def framework
  @framework
end

#framework_versionString? (readonly)

The framework version of the Model Package Container Image.



1936
1937
1938
# File 'sagemaker/cfn_model_package.rb', line 1936

def framework_version
  @framework_version
end

#imageString (readonly)

The Amazon Elastic Container Registry (Amazon ECR) path where inference code is stored.

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 .



1914
1915
1916
# File 'sagemaker/cfn_model_package.rb', line 1914

def image
  @image
end

#image_digestString? (readonly)

An MD5 hash of the training algorithm that identifies the Docker image used for training.



1941
1942
1943
# File 'sagemaker/cfn_model_package.rb', line 1941

def image_digest
  @image_digest
end

#model_data_sourceAWSCDK::IResolvable, ... (readonly)

Specifies the location of ML model data to deploy during endpoint creation.



1946
1947
1948
# File 'sagemaker/cfn_model_package.rb', line 1946

def model_data_source
  @model_data_source
end

#model_data_urlString? (readonly)

The Amazon 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 model artifacts must be in an S3 bucket that is in the same region as the model package.



1955
1956
1957
# File 'sagemaker/cfn_model_package.rb', line 1955

def model_data_url
  @model_data_url
end

#model_inputObject? (readonly)

A structure with Model Input details.



1960
1961
1962
# File 'sagemaker/cfn_model_package.rb', line 1960

def model_input
  @model_input
end

#nearest_model_nameString? (readonly)

The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model.

You can find a list of benchmarked models by calling ListModelMetadata .



1967
1968
1969
# File 'sagemaker/cfn_model_package.rb', line 1967

def nearest_model_name
  @nearest_model_name
end

Class Method Details

.jsii_propertiesObject



1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
# File 'sagemaker/cfn_model_package.rb', line 1969

def self.jsii_properties
  {
    :image => "image",
    :container_hostname => "containerHostname",
    :environment => "environment",
    :framework => "framework",
    :framework_version => "frameworkVersion",
    :image_digest => "imageDigest",
    :model_data_source => "modelDataSource",
    :model_data_url => "modelDataUrl",
    :model_input => "modelInput",
    :nearest_model_name => "nearestModelName",
  }
end

Instance Method Details

#to_jsiiObject



1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
# File 'sagemaker/cfn_model_package.rb', line 1984

def to_jsii
  result = {}
  result.merge!({
    "image" => @image,
    "containerHostname" => @container_hostname,
    "environment" => @environment,
    "framework" => @framework,
    "frameworkVersion" => @framework_version,
    "imageDigest" => @image_digest,
    "modelDataSource" => @model_data_source,
    "modelDataUrl" => @model_data_url,
    "modelInput" => @model_input,
    "nearestModelName" => @nearest_model_name,
  })
  result.compact
end