Skip to content

Commit edbdca7

Browse files
author
awstools
committed
feat(client-batch): This release adds Batch support for configuration of multicontainer jobs in ECS, Fargate, and EKS. This support is available for all types of jobs, including both array jobs and multi-node parallel jobs.
1 parent 1ebc3aa commit edbdca7

16 files changed

+3637
-1362
lines changed

clients/client-batch/src/commands/CreateComputeEnvironmentCommand.ts

+59-45
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,42 @@ export interface CreateComputeEnvironmentCommandOutput extends CreateComputeEnvi
2828

2929
/**
3030
* @public
31-
* <p>Creates an Batch compute environment. You can create <code>MANAGED</code> or <code>UNMANAGED</code> compute
32-
* environments. <code>MANAGED</code> compute environments can use Amazon EC2 or Fargate resources.
33-
* <code>UNMANAGED</code> compute environments can only use EC2 resources.</p>
34-
* <p>In a managed compute environment, Batch manages the capacity and instance types of the compute resources
35-
* within the environment. This is based on the compute resource specification that you define or the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">launch template</a> that you
36-
* specify when you create the compute environment. Either, you can choose to use EC2 On-Demand Instances and EC2 Spot
37-
* Instances. Or, you can use Fargate and Fargate Spot capacity in your managed compute environment. You can
38-
* optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is less than a
39-
* specified percentage of the On-Demand price.</p>
31+
* <p>Creates an Batch compute environment. You can create <code>MANAGED</code> or
32+
* <code>UNMANAGED</code> compute environments. <code>MANAGED</code> compute environments can
33+
* use Amazon EC2 or Fargate resources. <code>UNMANAGED</code> compute environments can only use
34+
* EC2 resources.</p>
35+
* <p>In a managed compute environment, Batch manages the capacity and instance types of the
36+
* compute resources within the environment. This is based on the compute resource specification
37+
* that you define or the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">launch template</a> that you
38+
* specify when you create the compute environment. Either, you can choose to use EC2 On-Demand
39+
* Instances and EC2 Spot Instances. Or, you can use Fargate and Fargate Spot capacity in
40+
* your managed compute environment. You can optionally set a maximum price so that Spot
41+
* Instances only launch when the Spot Instance price is less than a specified percentage of the
42+
* On-Demand price.</p>
4043
* <note>
4144
* <p>Multi-node parallel jobs aren't supported on Spot Instances.</p>
4245
* </note>
43-
* <p>In an unmanaged compute environment, you can manage your own EC2 compute resources and have flexibility with how
44-
* you configure your compute resources. For example, you can use custom AMIs. However, you must verify that each of
45-
* your AMIs meet the Amazon ECS container instance AMI specification. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html">container instance AMIs</a> in the
46-
* <i>Amazon Elastic Container Service Developer Guide</i>. After you created your unmanaged compute environment, you can use the <a>DescribeComputeEnvironments</a> operation to find the Amazon ECS cluster that's associated with it. Then, launch
47-
* your container instances into that Amazon ECS cluster. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html">Launching an Amazon ECS container instance</a> in the
48-
* <i>Amazon Elastic Container Service Developer Guide</i>.</p>
46+
* <p>In an unmanaged compute environment, you can manage your own EC2 compute resources and
47+
* have flexibility with how you configure your compute resources. For example, you can use
48+
* custom AMIs. However, you must verify that each of your AMIs meet the Amazon ECS container instance
49+
* AMI specification. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html">container instance AMIs</a> in the
50+
* <i>Amazon Elastic Container Service Developer Guide</i>. After you created your unmanaged compute environment,
51+
* you can use the <a>DescribeComputeEnvironments</a> operation to find the Amazon ECS
52+
* cluster that's associated with it. Then, launch your container instances into that Amazon ECS
53+
* cluster. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html">Launching an Amazon ECS container
54+
* instance</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
4955
* <note>
50-
* <p>To create a compute environment that uses EKS resources, the caller must have permissions to call
51-
* <code>eks:DescribeCluster</code>.</p>
56+
* <p>To create a compute environment that uses EKS resources, the caller must have
57+
* permissions to call <code>eks:DescribeCluster</code>.</p>
5258
* </note>
5359
* <note>
54-
* <p>Batch doesn't automatically upgrade the AMIs in a compute environment after it's created. For example, it
55-
* also doesn't update the AMIs in your compute environment when a newer version of the Amazon ECS optimized AMI is
56-
* available. You're responsible for the management of the guest operating system. This includes any updates and
57-
* security patches. You're also responsible for any additional application software or utilities that you install on
58-
* the compute resources. There are two ways to use a new AMI for your Batch jobs. The original method is to complete
59-
* these steps:</p>
60+
* <p>Batch doesn't automatically upgrade the AMIs in a compute environment after it's
61+
* created. For example, it also doesn't update the AMIs in your compute environment when a
62+
* newer version of the Amazon ECS optimized AMI is available. You're responsible for the management
63+
* of the guest operating system. This includes any updates and security patches. You're also
64+
* responsible for any additional application software or utilities that you install on the
65+
* compute resources. There are two ways to use a new AMI for your Batch jobs. The original
66+
* method is to complete these steps:</p>
6067
* <ol>
6168
* <li>
6269
* <p>Create a new compute environment with the new AMI.</p>
@@ -71,17 +78,19 @@ export interface CreateComputeEnvironmentCommandOutput extends CreateComputeEnvi
7178
* <p>Delete the earlier compute environment.</p>
7279
* </li>
7380
* </ol>
74-
* <p>In April 2022, Batch added enhanced support for updating compute environments. For more information, see
75-
* <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute
76-
* environments</a>. To use the enhanced updating of compute environments to update AMIs, follow these
77-
* rules:</p>
81+
* <p>In April 2022, Batch added enhanced support for updating compute environments. For
82+
* more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a>.
83+
* To use the enhanced updating of compute environments to update AMIs, follow these
84+
* rules:</p>
7885
* <ul>
7986
* <li>
80-
* <p>Either don't set the service role (<code>serviceRole</code>) parameter or set it to the <b>AWSBatchServiceRole</b> service-linked role.</p>
87+
* <p>Either don't set the service role (<code>serviceRole</code>) parameter or set it to
88+
* the <b>AWSBatchServiceRole</b> service-linked role.</p>
8189
* </li>
8290
* <li>
83-
* <p>Set the allocation strategy (<code>allocationStrategy</code>) parameter to <code>BEST_FIT_PROGRESSIVE</code>,
84-
* <code>SPOT_CAPACITY_OPTIMIZED</code>, or <code>SPOT_PRICE_CAPACITY_OPTIMIZED</code>.</p>
91+
* <p>Set the allocation strategy (<code>allocationStrategy</code>) parameter to
92+
* <code>BEST_FIT_PROGRESSIVE</code>, <code>SPOT_CAPACITY_OPTIMIZED</code>, or
93+
* <code>SPOT_PRICE_CAPACITY_OPTIMIZED</code>.</p>
8594
* </li>
8695
* <li>
8796
* <p>Set the update to latest image version (<code>updateToLatestImageVersion</code>)
@@ -92,24 +101,29 @@ export interface CreateComputeEnvironmentCommandOutput extends CreateComputeEnvi
92101
* environment.</p>
93102
* </li>
94103
* <li>
95-
* <p>Don't specify an AMI ID in <code>imageId</code>, <code>imageIdOverride</code> (in <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_Ec2Configuration.html">
104+
* <p>Don't specify an AMI ID in <code>imageId</code>, <code>imageIdOverride</code> (in
105+
* <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_Ec2Configuration.html">
96106
* <code>ec2Configuration</code>
97-
* </a>), or in the launch
98-
* template (<code>launchTemplate</code>). In that case, Batch selects the latest Amazon ECS optimized AMI that's
99-
* supported by Batch at the time the infrastructure update is initiated. Alternatively, you can specify the AMI ID
100-
* in the <code>imageId</code> or <code>imageIdOverride</code> parameters, or the launch template identified by the
101-
* <code>LaunchTemplate</code> properties. Changing any of these properties starts an infrastructure update. If the
102-
* AMI ID is specified in the launch template, it can't be replaced by specifying an AMI ID in either the
103-
* <code>imageId</code> or <code>imageIdOverride</code> parameters. It can only be replaced by specifying a different
104-
* launch template, or if the launch template version is set to <code>$Default</code> or <code>$Latest</code>, by
105-
* setting either a new default version for the launch template (if <code>$Default</code>) or by adding a new version
106-
* to the launch template (if <code>$Latest</code>).</p>
107+
* </a>), or in the launch template
108+
* (<code>launchTemplate</code>). In that case, Batch selects the latest Amazon ECS
109+
* optimized AMI that's supported by Batch at the time the infrastructure update is
110+
* initiated. Alternatively, you can specify the AMI ID in the <code>imageId</code> or
111+
* <code>imageIdOverride</code> parameters, or the launch template identified by the
112+
* <code>LaunchTemplate</code> properties. Changing any of these properties starts an
113+
* infrastructure update. If the AMI ID is specified in the launch template, it can't be
114+
* replaced by specifying an AMI ID in either the <code>imageId</code> or
115+
* <code>imageIdOverride</code> parameters. It can only be replaced by specifying a
116+
* different launch template, or if the launch template version is set to
117+
* <code>$Default</code> or <code>$Latest</code>, by setting either a new default version
118+
* for the launch template (if <code>$Default</code>) or by adding a new version to the
119+
* launch template (if <code>$Latest</code>).</p>
107120
* </li>
108121
* </ul>
109-
* <p>If these rules are followed, any update that starts an infrastructure update causes the AMI ID to be
110-
* re-selected. If the <code>version</code> setting in the launch template (<code>launchTemplate</code>) is set to
111-
* <code>$Latest</code> or <code>$Default</code>, the latest or default version of the launch template is evaluated up
112-
* at the time of the infrastructure update, even if the <code>launchTemplate</code> wasn't updated.</p>
122+
* <p>If these rules are followed, any update that starts an infrastructure update causes the
123+
* AMI ID to be re-selected. If the <code>version</code> setting in the launch template
124+
* (<code>launchTemplate</code>) is set to <code>$Latest</code> or <code>$Default</code>, the
125+
* latest or default version of the launch template is evaluated up at the time of the
126+
* infrastructure update, even if the <code>launchTemplate</code> wasn't updated.</p>
113127
* </note>
114128
* @example
115129
* Use a bare-bones client and the command you need to make an API call.

clients/client-batch/src/commands/CreateJobQueueCommand.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ export interface CreateJobQueueCommandOutput extends CreateJobQueueResponse, __M
2828

2929
/**
3030
* @public
31-
* <p>Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the
32-
* queue and assign an order of preference for the compute environments.</p>
33-
* <p>You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto
34-
* its associated compute environments. For example, if a compute environment is associated with more than one job
35-
* queue, the job queue with a higher priority is given preference for scheduling jobs to that compute
36-
* environment.</p>
31+
* <p>Creates an Batch job queue. When you create a job queue, you associate one or more
32+
* compute environments to the queue and assign an order of preference for the compute
33+
* environments.</p>
34+
* <p>You also set a priority to the job queue that determines the order that the Batch
35+
* scheduler places jobs onto its associated compute environments. For example, if a compute
36+
* environment is associated with more than one job queue, the job queue with a higher priority
37+
* is given preference for scheduling jobs to that compute environment.</p>
3738
* @example
3839
* Use a bare-bones client and the command you need to make an API call.
3940
* ```javascript

clients/client-batch/src/commands/DeleteComputeEnvironmentCommand.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ export interface DeleteComputeEnvironmentCommandOutput extends DeleteComputeEnvi
2929
/**
3030
* @public
3131
* <p>Deletes an Batch compute environment.</p>
32-
* <p>Before you can delete a compute environment, you must set its state to <code>DISABLED</code> with the <a>UpdateComputeEnvironment</a> API operation and disassociate it from any job queues with the <a>UpdateJobQueue</a> API operation. Compute environments that use Fargate resources must terminate all
33-
* active jobs on that compute environment before deleting the compute environment. If this isn't done, the compute
34-
* environment enters an invalid state.</p>
32+
* <p>Before you can delete a compute environment, you must set its state to
33+
* <code>DISABLED</code> with the <a>UpdateComputeEnvironment</a> API operation and
34+
* disassociate it from any job queues with the <a>UpdateJobQueue</a> API operation.
35+
* Compute environments that use Fargate resources must terminate all active jobs on that
36+
* compute environment before deleting the compute environment. If this isn't done, the compute
37+
* environment enters an invalid state.</p>
3538
* @example
3639
* Use a bare-bones client and the command you need to make an API call.
3740
* ```javascript

clients/client-batch/src/commands/DeleteJobQueueCommand.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ export interface DeleteJobQueueCommandOutput extends DeleteJobQueueResponse, __M
2828

2929
/**
3030
* @public
31-
* <p>Deletes the specified job queue. You must first disable submissions for a queue with the <a>UpdateJobQueue</a> operation. All jobs in the queue are eventually terminated when you delete a job queue.
32-
* The jobs are terminated at a rate of about 16 jobs each second.</p>
31+
* <p>Deletes the specified job queue. You must first disable submissions for a queue with the
32+
* <a>UpdateJobQueue</a> operation. All jobs in the queue are eventually terminated
33+
* when you delete a job queue. The jobs are terminated at a rate of about 16 jobs each
34+
* second.</p>
3335
* <p>It's not necessary to disassociate compute environments from a queue before submitting a
34-
* <code>DeleteJobQueue</code> request.</p>
36+
* <code>DeleteJobQueue</code> request.</p>
3537
* @example
3638
* Use a bare-bones client and the command you need to make an API call.
3739
* ```javascript

clients/client-batch/src/commands/DeregisterJobDefinitionCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface DeregisterJobDefinitionCommandOutput extends DeregisterJobDefin
2828

2929
/**
3030
* @public
31-
* <p>Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days.</p>
31+
* <p>Deregisters an Batch job definition. Job definitions are permanently deleted after 180
32+
* days.</p>
3233
* @example
3334
* Use a bare-bones client and the command you need to make an API call.
3435
* ```javascript

clients/client-batch/src/commands/DescribeComputeEnvironmentsCommand.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export interface DescribeComputeEnvironmentsCommandOutput
3434
/**
3535
* @public
3636
* <p>Describes one or more of your compute environments.</p>
37-
* <p>If you're using an unmanaged compute environment, you can use the <code>DescribeComputeEnvironment</code>
38-
* operation to determine the <code>ecsClusterArn</code> that you launch your Amazon ECS container instances
39-
* into.</p>
37+
* <p>If you're using an unmanaged compute environment, you can use the
38+
* <code>DescribeComputeEnvironment</code> operation to determine the
39+
* <code>ecsClusterArn</code> that you launch your Amazon ECS container instances into.</p>
4040
* @example
4141
* Use a bare-bones client and the command you need to make an API call.
4242
* ```javascript

0 commit comments

Comments
 (0)