Class: AWSCDK::StepFunctionsTasks::ContainerOverrides

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

Overview

The overrides that should be sent to a container.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command: nil, environment: nil, gpu_count: nil, instance_type: nil, memory: nil, vcpus: nil) ⇒ ContainerOverrides

Returns a new instance of ContainerOverrides.

Parameters:

  • command (Array<String>, nil) (defaults to: nil)

    The command to send to the container that overrides the default command from the Docker image or the job definition.

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

    The environment variables to send to the container.

  • gpu_count (Numeric, nil) (defaults to: nil)

    The number of physical GPUs to reserve for the container.

  • instance_type (AWSCDK::EC2::InstanceType, nil) (defaults to: nil)

    The instance type to use for a multi-node parallel job.

  • memory (Numeric, nil) (defaults to: nil)

    The number of MiB of memory reserved for the job.

  • vcpus (Numeric, nil) (defaults to: nil)

    The number of vCPUs to reserve for the container.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'step_functions_tasks/container_overrides.rb', line 13

def initialize(command: nil, environment: nil, gpu_count: nil, instance_type: nil, memory: nil, vcpus: nil)
  @command = command
  Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil?
  @environment = environment
  Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil?
  @gpu_count = gpu_count
  Jsii::Type.check_type(@gpu_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "gpuCount") unless @gpu_count.nil?
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlVHlwZSJ9")), "instanceType") unless @instance_type.nil?
  @memory = memory
  Jsii::Type.check_type(@memory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memory") unless @memory.nil?
  @vcpus = vcpus
  Jsii::Type.check_type(@vcpus, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "vcpus") unless @vcpus.nil?
end

Instance Attribute Details

#commandArray<String>? (readonly)

Note:

Default: - No command overrides

The command to send to the container that overrides the default command from the Docker image or the job definition.

Returns:

  • (Array<String>, nil)


32
33
34
# File 'step_functions_tasks/container_overrides.rb', line 32

def command
  @command
end

#environmentHash{String => String}? (readonly)

Note:

Default: - No environment overrides

The environment variables to send to the container.

You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the job definition.

Returns:

  • (Hash{String => String}, nil)


41
42
43
# File 'step_functions_tasks/container_overrides.rb', line 41

def environment
  @environment
end

#gpu_countNumeric? (readonly)

Note:

Default: - No GPU reservation

The number of physical GPUs to reserve for the container.

The number of GPUs reserved for all containers in a job should not exceed the number of available GPUs on the compute resource that the job is launched on.

Returns:

  • (Numeric, nil)


50
51
52
# File 'step_functions_tasks/container_overrides.rb', line 50

def gpu_count
  @gpu_count
end

#instance_typeAWSCDK::EC2::InstanceType? (readonly)

Note:

Default: - No instance type overrides

The instance type to use for a multi-node parallel job.

This parameter is not valid for single-node container jobs.

Returns:



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

def instance_type
  @instance_type
end

#memoryNumeric? (readonly)

Note:

Default: - No memory overrides

The number of MiB of memory reserved for the job.

This value overrides the value set in the job definition.

Returns:

  • (Numeric, nil)


64
65
66
# File 'step_functions_tasks/container_overrides.rb', line 64

def memory
  @memory
end

#vcpusNumeric? (readonly)

Note:

Default: - No vCPUs overrides

The number of vCPUs to reserve for the container.

This value overrides the value set in the job definition.

Returns:

  • (Numeric, nil)


71
72
73
# File 'step_functions_tasks/container_overrides.rb', line 71

def vcpus
  @vcpus
end

Class Method Details

.jsii_propertiesObject



73
74
75
76
77
78
79
80
81
82
# File 'step_functions_tasks/container_overrides.rb', line 73

def self.jsii_properties
  {
    :command => "command",
    :environment => "environment",
    :gpu_count => "gpuCount",
    :instance_type => "instanceType",
    :memory => "memory",
    :vcpus => "vcpus",
  }
end

Instance Method Details

#to_jsiiObject



84
85
86
87
88
89
90
91
92
93
94
95
# File 'step_functions_tasks/container_overrides.rb', line 84

def to_jsii
  result = {}
  result.merge!({
    "command" => @command,
    "environment" => @environment,
    "gpuCount" => @gpu_count,
    "instanceType" => @instance_type,
    "memory" => @memory,
    "vcpus" => @vcpus,
  })
  result.compact
end