Class MultiNodeJobDefinition
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.batch.MultiNodeJobDefinition
- All Implemented Interfaces:
IResource
,IJobDefinition
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-09-11T18:01:12.086Z")
@Stability(Stable)
public class MultiNodeJobDefinition
extends Resource
implements IJobDefinition
A JobDefinition that uses Ecs orchestration to run multiple containers.
Example:
MultiNodeJobDefinition multiNodeJob = MultiNodeJobDefinition.Builder.create(this, "JobDefinition") .instanceType(InstanceType.of(InstanceClass.R4, InstanceSize.LARGE)) // optional, omit to let Batch choose the type for you .containers(List.of(MultiNodeContainer.builder() .container(EcsEc2ContainerDefinition.Builder.create(this, "mainMPIContainer") .image(ContainerImage.fromRegistry("yourregsitry.com/yourMPIImage:latest")) .cpu(256) .memory(Size.mebibytes(2048)) .build()) .startNode(0) .endNode(5) .build())) .build(); // convenience method multiNodeJob.addContainer(MultiNodeContainer.builder() .startNode(6) .endNode(10) .container(EcsEc2ContainerDefinition.Builder.create(this, "multiContainer") .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample")) .cpu(256) .memory(Size.mebibytes(2048)) .build()) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IJobDefinition
IJobDefinition.Jsii$Default, IJobDefinition.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
MultiNodeJobDefinition
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
MultiNodeJobDefinition
(software.amazon.jsii.JsiiObjectRef objRef) MultiNodeJobDefinition
(software.constructs.Construct scope, String id) MultiNodeJobDefinition
(software.constructs.Construct scope, String id, MultiNodeJobDefinitionProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContainer
(MultiNodeContainer container) Add a container to this multinode job.void
addRetryStrategy
(RetryStrategy strategy) Add a RetryStrategy to this JobDefinition.static IJobDefinition
fromJobDefinitionArn
(software.constructs.Construct scope, String id, String jobDefinitionArn) refer to an existing JobDefinition by its arn.The containers that this multinode job will run.If the propinstanceType
is leftundefined
, then this will hold a fake instance type, for backwards compatibility reasons.The ARN of this job definition.The name of this job definition.The index of the main node in this job.The default parameters passed to the container These parameters can be referenced in thecommand
that you give to the container.Whether to propogate tags from the JobDefinition to the ECS task that Batch spawns.The number of times to retry a job.Defines the retry behavior for this job.The priority of this Job.The timeout time for jobs that are submitted with this job definition.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
MultiNodeJobDefinition
protected MultiNodeJobDefinition(software.amazon.jsii.JsiiObjectRef objRef) -
MultiNodeJobDefinition
protected MultiNodeJobDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
MultiNodeJobDefinition
@Stability(Stable) public MultiNodeJobDefinition(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable MultiNodeJobDefinitionProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
MultiNodeJobDefinition
@Stability(Stable) public MultiNodeJobDefinition(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
fromJobDefinitionArn
@Stability(Stable) @NotNull public static IJobDefinition fromJobDefinitionArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String jobDefinitionArn) refer to an existing JobDefinition by its arn.- Parameters:
scope
- This parameter is required.id
- This parameter is required.jobDefinitionArn
- This parameter is required.
-
addContainer
Add a container to this multinode job.- Parameters:
container
- This parameter is required.
-
addRetryStrategy
Add a RetryStrategy to this JobDefinition.- Specified by:
addRetryStrategy
in interfaceIJobDefinition
- Parameters:
strategy
- This parameter is required.
-
getContainers
The containers that this multinode job will run. -
getInstanceType
If the propinstanceType
is leftundefined
, then this will hold a fake instance type, for backwards compatibility reasons. -
getJobDefinitionArn
The ARN of this job definition.- Specified by:
getJobDefinitionArn
in interfaceIJobDefinition
-
getJobDefinitionName
The name of this job definition.- Specified by:
getJobDefinitionName
in interfaceIJobDefinition
-
getRetryStrategies
Defines the retry behavior for this job.- Specified by:
getRetryStrategies
in interfaceIJobDefinition
-
getMainNode
The index of the main node in this job.The main node is responsible for orchestration.
-
getParameters
The default parameters passed to the container These parameters can be referenced in thecommand
that you give to the container.- Specified by:
getParameters
in interfaceIJobDefinition
- See Also:
-
getPropagateTags
Whether to propogate tags from the JobDefinition to the ECS task that Batch spawns. -
getRetryAttempts
The number of times to retry a job.The job is retried on failure the same number of attempts as the value.
- Specified by:
getRetryAttempts
in interfaceIJobDefinition
-
getSchedulingPriority
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.
- Specified by:
getSchedulingPriority
in interfaceIJobDefinition
-
getTimeout
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.
- Specified by:
getTimeout
in interfaceIJobDefinition
-