Show / Hide Table of Contents

Class MultiNodeJobDefinitionProps

Props to configure a MultiNodeJobDefinition.

Inheritance
object
MultiNodeJobDefinitionProps
Implements
IMultiNodeJobDefinitionProps
IJobDefinitionProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
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 command that you give to the container.

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

IMultiNodeContainer[]

Remarks

Default: none

See: https://aws.amazon.com/blogs/compute/building-a-tightly-coupled-molecular-dynamics-workflow-with-multi-node-parallel-jobs-in-aws-batch/

InstanceType

The instance type that this job definition will run.

public InstanceType? InstanceType { get; set; }
Property Value

InstanceType

Remarks

Default: - optimal instance, selected by Batch

JobDefinitionName

The name of this job definition.

public string? JobDefinitionName { get; set; }
Property Value

string

Remarks

Default: - generated by CloudFormation

MainNode

The index of the main node in this job.

public double? MainNode { get; set; }
Property Value

double?

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

IDictionary<string, object>

Remarks

Default: none

See: https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html#parameters

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

double?

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

RetryStrategy[]

Remarks

Default: - no RetryStrategy

SchedulingPriority

The priority of this Job.

public double? SchedulingPriority { get; set; }
Property Value

double?

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

Duration

Remarks

After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.

Default: - no timeout

Implements

IMultiNodeJobDefinitionProps
IJobDefinitionProps
Back to top Generated by DocFX