Class MultiNodeJobDefinitionProps
Props to configure a MultiNodeJobDefinition.
Inherited Members
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class MultiNodeJobDefinitionProps : IMultiNodeJobDefinitionProps, IJobDefinitionProps
Syntax (vb)
Public Class MultiNodeJobDefinitionProps Implements IMultiNodeJobDefinitionProps, IJobDefinitionProps
Remarks
ExampleMetadata: infused
Examples
var multiNodeJob = new MultiNodeJobDefinition(this, "JobDefinition", new MultiNodeJobDefinitionProps {
InstanceType = InstanceType.Of(InstanceClass.R4, InstanceSize.LARGE), // optional, omit to let Batch choose the type for you
Containers = new [] { new MultiNodeContainer {
Container = new EcsEc2ContainerDefinition(this, "mainMPIContainer", new EcsEc2ContainerDefinitionProps {
Image = ContainerImage.FromRegistry("yourregsitry.com/yourMPIImage:latest"),
Cpu = 256,
Memory = Size.Mebibytes(2048)
}),
StartNode = 0,
EndNode = 5
} }
});
// convenience method
multiNodeJob.AddContainer(new MultiNodeContainer {
StartNode = 6,
EndNode = 10,
Container = new EcsEc2ContainerDefinition(this, "multiContainer", new EcsEc2ContainerDefinitionProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
Cpu = 256,
Memory = Size.Mebibytes(2048)
})
});
Synopsis
Constructors
| MultiNodeJobDefinitionProps() | Props to configure a MultiNodeJobDefinition. |
Properties
| Containers | The containers that this multinode job will run. |
| InstanceType | The instance type that this job definition will run. |
| JobDefinitionName | The name of this job definition. |
| MainNode | The index of the main node in this job. |
| Parameters | The default parameters passed to the container These parameters can be referenced in the |
| PropagateTags | Whether to propagate tags from the JobDefinition to the ECS task that Batch spawns. |
| RetryAttempts | The number of times to retry a job. |
| RetryStrategies | Defines the retry behavior for this job. |
| SchedulingPriority | The priority of this Job. |
| Timeout | The timeout time for jobs that are submitted with this job definition. |
Constructors
MultiNodeJobDefinitionProps()
Props to configure a MultiNodeJobDefinition.
public MultiNodeJobDefinitionProps()
Remarks
ExampleMetadata: infused
Examples
var multiNodeJob = new MultiNodeJobDefinition(this, "JobDefinition", new MultiNodeJobDefinitionProps {
InstanceType = InstanceType.Of(InstanceClass.R4, InstanceSize.LARGE), // optional, omit to let Batch choose the type for you
Containers = new [] { new MultiNodeContainer {
Container = new EcsEc2ContainerDefinition(this, "mainMPIContainer", new EcsEc2ContainerDefinitionProps {
Image = ContainerImage.FromRegistry("yourregsitry.com/yourMPIImage:latest"),
Cpu = 256,
Memory = Size.Mebibytes(2048)
}),
StartNode = 0,
EndNode = 5
} }
});
// convenience method
multiNodeJob.AddContainer(new MultiNodeContainer {
StartNode = 6,
EndNode = 10,
Container = new EcsEc2ContainerDefinition(this, "multiContainer", new EcsEc2ContainerDefinitionProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
Cpu = 256,
Memory = Size.Mebibytes(2048)
})
});
Properties
Containers
The containers that this multinode job will run.
public IMultiNodeContainer[]? Containers { get; set; }
Property Value
Remarks
InstanceType
The instance type that this job definition will run.
public InstanceType? InstanceType { get; set; }
Property Value
Remarks
Default: - optimal instance, selected by Batch
JobDefinitionName
The name of this job definition.
public string? JobDefinitionName { get; set; }
Property Value
Remarks
Default: - generated by CloudFormation
MainNode
The index of the main node in this job.
public double? MainNode { get; set; }
Property Value
Remarks
The main node is responsible for orchestration.
Default: 0
Parameters
The default parameters passed to the container These parameters can be referenced in the command that you give to the container.
public IDictionary<string, object>? Parameters { get; set; }
Property Value
Remarks
PropagateTags
Whether to propagate tags from the JobDefinition to the ECS task that Batch spawns.
public bool? PropagateTags { get; set; }
Property Value
bool?
Remarks
Default: false
RetryAttempts
The number of times to retry a job.
public double? RetryAttempts { get; set; }
Property Value
Remarks
The job is retried on failure the same number of attempts as the value.
Default: 1
RetryStrategies
Defines the retry behavior for this job.
public RetryStrategy[]? RetryStrategies { get; set; }
Property Value
Remarks
Default: - no RetryStrategy
SchedulingPriority
The priority of this Job.
public double? SchedulingPriority { get; set; }
Property Value
Remarks
Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.
Default: none
Timeout
The timeout time for jobs that are submitted with this job definition.
public Duration? Timeout { get; set; }
Property Value
Remarks
After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.
Default: - no timeout