Class: AWSCDK::Batch::MultiNodeContainer

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
batch/multi_node_container.rb

Overview

Runs the container on nodes [startNode, endNode].

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container:, end_node:, start_node:) ⇒ MultiNodeContainer

Returns a new instance of MultiNodeContainer.

Parameters:

  • container (AWSCDK::Batch::IECSContainerDefinition)

    The container that this node range will run.

  • end_node (Numeric)

    The index of the last node to run this container.

  • start_node (Numeric)

    The index of the first node to run this container.



10
11
12
13
14
15
16
17
# File 'batch/multi_node_container.rb', line 10

def initialize(container:, end_node:, start_node:)
  @container = container
  Jsii::Type.check_type(@container, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guSUVjc0NvbnRhaW5lckRlZmluaXRpb24ifQ==")), "container")
  @end_node = end_node
  Jsii::Type.check_type(@end_node, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "endNode")
  @start_node = start_node
  Jsii::Type.check_type(@start_node, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "startNode")
end

Instance Attribute Details

#containerAWSCDK::Batch::IECSContainerDefinition (readonly)

The container that this node range will run.



22
23
24
# File 'batch/multi_node_container.rb', line 22

def container
  @container
end

#end_nodeNumeric (readonly)

The index of the last node to run this container.

The container is run on all nodes in the range startNode, endNode

Returns:

  • (Numeric)


28
29
30
# File 'batch/multi_node_container.rb', line 28

def end_node
  @end_node
end

#start_nodeNumeric (readonly)

The index of the first node to run this container.

The container is run on all nodes in the range startNode, endNode

Returns:

  • (Numeric)


34
35
36
# File 'batch/multi_node_container.rb', line 34

def start_node
  @start_node
end

Class Method Details

.jsii_propertiesObject



36
37
38
39
40
41
42
# File 'batch/multi_node_container.rb', line 36

def self.jsii_properties
  {
    :container => "container",
    :end_node => "endNode",
    :start_node => "startNode",
  }
end

Instance Method Details

#to_jsiiObject



44
45
46
47
48
49
50
51
52
# File 'batch/multi_node_container.rb', line 44

def to_jsii
  result = {}
  result.merge!({
    "container" => @container,
    "endNode" => @end_node,
    "startNode" => @start_node,
  })
  result.compact
end