Class: AWSCDK::StepFunctionsTasks::ContainerDefinitionOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
step_functions_tasks/container_definition_options.rb

Overview

Properties to define a ContainerDefinition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container_host_name: nil, environment_variables: nil, image: nil, mode: nil, model_package_name: nil, model_s3_location: nil) ⇒ ContainerDefinitionOptions

Returns a new instance of ContainerDefinitionOptions.

Parameters:

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

    This parameter is ignored for models that contain only a PrimaryContainer.

  • environment_variables (AWSCDK::StepFunctions::TaskInput, nil) (defaults to: nil)

    The environment variables to set in the Docker container.

  • image (AWSCDK::StepFunctionsTasks::DockerImage, nil) (defaults to: nil)

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

  • mode (AWSCDK::StepFunctionsTasks::Mode, nil) (defaults to: nil)

    Defines how many models the container hosts.

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

    The name or Amazon Resource Name (ARN) of the model package to use to create the model.

  • model_s3_location (AWSCDK::StepFunctionsTasks::S3Location, nil) (defaults to: nil)

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



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'step_functions_tasks/container_definition_options.rb', line 15

def initialize(container_host_name: nil, environment_variables: nil, image: nil, mode: nil, model_package_name: nil, model_s3_location: nil)
  @container_host_name = container_host_name
  Jsii::Type.check_type(@container_host_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerHostName") unless @container_host_name.nil?
  @environment_variables = environment_variables
  Jsii::Type.check_type(@environment_variables, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5UYXNrSW5wdXQifQ==")), "environmentVariables") unless @environment_variables.nil?
  @image = image
  Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5Eb2NrZXJJbWFnZSJ9")), "image") unless @image.nil?
  @mode = mode
  Jsii::Type.check_type(@mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5Nb2RlIn0=")), "mode") unless @mode.nil?
  @model_package_name = model_package_name
  Jsii::Type.check_type(@model_package_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelPackageName") unless @model_package_name.nil?
  @model_s3_location = model_s3_location
  Jsii::Type.check_type(@model_s3_location, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5TM0xvY2F0aW9uIn0=")), "modelS3Location") unless @model_s3_location.nil?
end

Instance Attribute Details

#container_host_nameString? (readonly)

Note:

Default: - None

This parameter is ignored for models that contain only a PrimaryContainer.

When a ContainerDefinition is part of an inference pipeline, the value of the parameter uniquely identifies the container for the purposes of logging and metrics.

Returns:

  • (String, nil)


37
38
39
# File 'step_functions_tasks/container_definition_options.rb', line 37

def container_host_name
  @container_host_name
end

#environment_variablesAWSCDK::StepFunctions::TaskInput? (readonly)

Note:

Default: - No variables

The environment variables to set in the Docker container.



42
43
44
# File 'step_functions_tasks/container_definition_options.rb', line 42

def environment_variables
  @environment_variables
end

#imageAWSCDK::StepFunctionsTasks::DockerImage? (readonly)

Note:

Default: - None

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



47
48
49
# File 'step_functions_tasks/container_definition_options.rb', line 47

def image
  @image
end

#modeAWSCDK::StepFunctionsTasks::Mode? (readonly)

Note:

Default: - Mode.SINGLE_MODEL

Defines how many models the container hosts.



52
53
54
# File 'step_functions_tasks/container_definition_options.rb', line 52

def mode
  @mode
end

#model_package_nameString? (readonly)

Note:

Default: - None

The name or Amazon Resource Name (ARN) of the model package to use to create the model.

Returns:

  • (String, nil)


57
58
59
# File 'step_functions_tasks/container_definition_options.rb', line 57

def model_package_name
  @model_package_name
end

#model_s3_locationAWSCDK::StepFunctionsTasks::S3Location? (readonly)

Note:

Default: - None

The 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 S3 path is required for Amazon SageMaker built-in algorithms, but not if you use your own algorithms.



65
66
67
# File 'step_functions_tasks/container_definition_options.rb', line 65

def model_s3_location
  @model_s3_location
end

Class Method Details

.jsii_propertiesObject



67
68
69
70
71
72
73
74
75
76
# File 'step_functions_tasks/container_definition_options.rb', line 67

def self.jsii_properties
  {
    :container_host_name => "containerHostName",
    :environment_variables => "environmentVariables",
    :image => "image",
    :mode => "mode",
    :model_package_name => "modelPackageName",
    :model_s3_location => "modelS3Location",
  }
end

Instance Method Details

#to_jsiiObject



78
79
80
81
82
83
84
85
86
87
88
89
# File 'step_functions_tasks/container_definition_options.rb', line 78

def to_jsii
  result = {}
  result.merge!({
    "containerHostName" => @container_host_name,
    "environmentVariables" => @environment_variables,
    "image" => @image,
    "mode" => @mode,
    "modelPackageName" => @model_package_name,
    "modelS3Location" => @model_s3_location,
  })
  result.compact
end