Class: AWSCDK::Batch::MultiNodeJobDefinitionProps
- Inherits:
-
JobDefinitionProps
- Object
- JobDefinitionProps
- AWSCDK::Batch::MultiNodeJobDefinitionProps
- Defined in:
- batch/multi_node_job_definition_props.rb
Overview
Props to configure a MultiNodeJobDefinition.
Instance Attribute Summary collapse
-
#containers ⇒ Array<AWSCDK::Batch::MultiNodeContainer>?
readonly
The containers that this multinode job will run.
-
#instance_type ⇒ AWSCDK::EC2::InstanceType?
readonly
The instance type that this job definition will run.
-
#job_definition_name ⇒ String?
readonly
The name of this job definition.
-
#main_node ⇒ Numeric?
readonly
The index of the main node in this job.
-
#parameters ⇒ Hash{String => Object}?
readonly
The default parameters passed to the container These parameters can be referenced in the
commandthat you give to the container. -
#propagate_tags ⇒ Boolean?
readonly
Whether to propagate tags from the JobDefinition to the ECS task that Batch spawns.
-
#retry_attempts ⇒ Numeric?
readonly
The number of times to retry a job.
-
#retry_strategies ⇒ Array<AWSCDK::Batch::RetryStrategy>?
readonly
Defines the retry behavior for this job.
-
#scheduling_priority ⇒ Numeric?
readonly
The priority of this Job.
-
#skip_deregister_on_update ⇒ Boolean?
readonly
Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource.
-
#timeout ⇒ AWSCDK::Duration?
readonly
The timeout time for jobs that are submitted with this job definition.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(job_definition_name: nil, parameters: nil, retry_attempts: nil, retry_strategies: nil, scheduling_priority: nil, skip_deregister_on_update: nil, timeout: nil, containers: nil, instance_type: nil, main_node: nil, propagate_tags: nil) ⇒ MultiNodeJobDefinitionProps
constructor
A new instance of MultiNodeJobDefinitionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(job_definition_name: nil, parameters: nil, retry_attempts: nil, retry_strategies: nil, scheduling_priority: nil, skip_deregister_on_update: nil, timeout: nil, containers: nil, instance_type: nil, main_node: nil, propagate_tags: nil) ⇒ MultiNodeJobDefinitionProps
Returns a new instance of MultiNodeJobDefinitionProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'batch/multi_node_job_definition_props.rb', line 18 def initialize(job_definition_name: nil, parameters: nil, retry_attempts: nil, retry_strategies: nil, scheduling_priority: nil, skip_deregister_on_update: nil, timeout: nil, containers: nil, instance_type: nil, main_node: nil, propagate_tags: nil) @job_definition_name = job_definition_name Jsii::Type.check_type(@job_definition_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jobDefinitionName") unless @job_definition_name.nil? @parameters = parameters Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "parameters") unless @parameters.nil? @retry_attempts = retry_attempts Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil? @retry_strategies = retry_strategies Jsii::Type.check_type(@retry_strategies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5SZXRyeVN0cmF0ZWd5In0sImtpbmQiOiJhcnJheSJ9fQ==")), "retryStrategies") unless @retry_strategies.nil? @scheduling_priority = scheduling_priority Jsii::Type.check_type(@scheduling_priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "schedulingPriority") unless @scheduling_priority.nil? @skip_deregister_on_update = skip_deregister_on_update Jsii::Type.check_type(@skip_deregister_on_update, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "skipDeregisterOnUpdate") unless @skip_deregister_on_update.nil? @timeout = timeout Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil? @containers = containers.is_a?(Array) ? containers.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Batch::MultiNodeContainer.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : containers Jsii::Type.check_type(@containers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5NdWx0aU5vZGVDb250YWluZXIifSwia2luZCI6ImFycmF5In19")), "containers") unless @containers.nil? @instance_type = instance_type Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlVHlwZSJ9")), "instanceType") unless @instance_type.nil? @main_node = main_node Jsii::Type.check_type(@main_node, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "mainNode") unless @main_node.nil? @propagate_tags = Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "propagateTags") unless @propagate_tags.nil? end |
Instance Attribute Details
#containers ⇒ Array<AWSCDK::Batch::MultiNodeContainer>? (readonly)
Default: none
The containers that this multinode job will run.
96 97 98 |
# File 'batch/multi_node_job_definition_props.rb', line 96 def containers @containers end |
#instance_type ⇒ AWSCDK::EC2::InstanceType? (readonly)
Default: - optimal instance, selected by Batch
The instance type that this job definition will run.
101 102 103 |
# File 'batch/multi_node_job_definition_props.rb', line 101 def instance_type @instance_type end |
#job_definition_name ⇒ String? (readonly)
Default: - generated by CloudFormation
The name of this job definition.
47 48 49 |
# File 'batch/multi_node_job_definition_props.rb', line 47 def job_definition_name @job_definition_name end |
#main_node ⇒ Numeric? (readonly)
Default: 0
The index of the main node in this job.
The main node is responsible for orchestration.
108 109 110 |
# File 'batch/multi_node_job_definition_props.rb', line 108 def main_node @main_node end |
#parameters ⇒ Hash{String => Object}? (readonly)
Default: none
The default parameters passed to the container These parameters can be referenced in the command that you give to the container.
53 54 55 |
# File 'batch/multi_node_job_definition_props.rb', line 53 def parameters @parameters end |
#propagate_tags ⇒ Boolean? (readonly)
Default: false
Whether to propagate tags from the JobDefinition to the ECS task that Batch spawns.
113 114 115 |
# File 'batch/multi_node_job_definition_props.rb', line 113 def @propagate_tags end |
#retry_attempts ⇒ Numeric? (readonly)
Default: 1
The number of times to retry a job.
The job is retried on failure the same number of attempts as the value.
60 61 62 |
# File 'batch/multi_node_job_definition_props.rb', line 60 def retry_attempts @retry_attempts end |
#retry_strategies ⇒ Array<AWSCDK::Batch::RetryStrategy>? (readonly)
Default: - no RetryStrategy
Defines the retry behavior for this job.
65 66 67 |
# File 'batch/multi_node_job_definition_props.rb', line 65 def retry_strategies @retry_strategies end |
#scheduling_priority ⇒ Numeric? (readonly)
Default: none
The priority of this Job.
Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.
74 75 76 |
# File 'batch/multi_node_job_definition_props.rb', line 74 def scheduling_priority @scheduling_priority end |
#skip_deregister_on_update ⇒ Boolean? (readonly)
Default: undefined - AWS Batch default is false
Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource.
When the property is set to false, the previous revision of the job definition is de-registered after a new revision is created. When the property is set to true, the previous revision of the job definition is not de-registered.
82 83 84 |
# File 'batch/multi_node_job_definition_props.rb', line 82 def skip_deregister_on_update @skip_deregister_on_update end |
#timeout ⇒ AWSCDK::Duration? (readonly)
Default: - no timeout
The timeout time for jobs that are submitted with this job definition.
After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.
90 91 92 |
# File 'batch/multi_node_job_definition_props.rb', line 90 def timeout @timeout end |
Class Method Details
.jsii_properties ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'batch/multi_node_job_definition_props.rb', line 115 def self.jsii_properties { :job_definition_name => "jobDefinitionName", :parameters => "parameters", :retry_attempts => "retryAttempts", :retry_strategies => "retryStrategies", :scheduling_priority => "schedulingPriority", :skip_deregister_on_update => "skipDeregisterOnUpdate", :timeout => "timeout", :containers => "containers", :instance_type => "instanceType", :main_node => "mainNode", :propagate_tags => "propagateTags", } end |
Instance Method Details
#to_jsii ⇒ Object
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'batch/multi_node_job_definition_props.rb', line 131 def to_jsii result = {} result.merge!(super) result.merge!({ "jobDefinitionName" => @job_definition_name, "parameters" => @parameters, "retryAttempts" => @retry_attempts, "retryStrategies" => @retry_strategies, "schedulingPriority" => @scheduling_priority, "skipDeregisterOnUpdate" => @skip_deregister_on_update, "timeout" => @timeout, "containers" => @containers, "instanceType" => @instance_type, "mainNode" => @main_node, "propagateTags" => @propagate_tags, }) result.compact end |