Interface MultiNodeContainer

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
MultiNodeContainer.Jsii$Proxy

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-08-02T00:29:07.243Z") @Stability(Stable) public interface MultiNodeContainer extends software.amazon.jsii.JsiiSerializable
Runs the container on nodes [startNode, endNode].

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());
 
  • Method Details

    • getContainer

      @Stability(Stable) @NotNull IEcsContainerDefinition getContainer()
      The container that this node range will run.
    • getEndNode

      @Stability(Stable) @NotNull Number getEndNode()
      The index of the last node to run this container.

      The container is run on all nodes in the range [startNode, endNode] (inclusive)

    • getStartNode

      @Stability(Stable) @NotNull Number getStartNode()
      The index of the first node to run this container.

      The container is run on all nodes in the range [startNode, endNode] (inclusive)

    • builder

      @Stability(Stable) static MultiNodeContainer.Builder builder()
      Returns:
      a MultiNodeContainer.Builder of MultiNodeContainer