Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit c3872bf

Browse files
wleepangcrabba
authored andcommitted
update job queue and compute environment guidance
1 parent dbf14a9 commit c3872bf

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

docs/core-env/setup-aws-batch.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ A complete AWS Batch environment consists of the following:
4646

4747
1. A Compute Environment that utilizes [EC2 Spot instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html) for cost-effective computing
4848
2. A Compute Environment that utilizes EC2 on-demand (e.g. [public pricing](https://aws.amazon.com/ec2/pricing/on-demand/)) instances for high-priority work that can't risk job interruptions or delays due to insufficient Spot capacity.
49-
3. A default Job Queue that utilizes the Spot compute environment first, but spills over to the on-demand compute environment if defined capacity limits (i.e. Max vCPUs) are reached.
50-
4. A priority Job Queue that leverages the on-demand and Spot CE's (in that order) and has higher priority than the default queue.
49+
3. A default Job Queue that solely utilizes the Spot compute environment. This is for jobs where timeliness isn't a constraint, and can wait for the right instances to become available, as well has handle interruption. It also ensures the most cost savings.
50+
4. A priority Job Queue that leverages the on-demand, and optionally Spot, CE's (in that order) and has higher priority than the default queue. This is for jobs that cannot handle interruption, and need to be executed immediately.
5151

5252
### Automated via CloudFormation
5353

@@ -81,7 +81,7 @@ You can create several compute environments to suit your needs. Below we'll cre
8181
6. In the "Service role" drop down, select the `AWSBatchServiceRole` you created previously
8282
7. In the "Instance role" drop down, select the `ecsInstanceRole` you created previously
8383
8. For "Provisioning model" select "On-Demand"
84-
9. "Allowed instance types" will be already populated with "optimal" - which is a mixture of M4, C4, and R4 instances.
84+
9. "Allowed instance types" will be already populated with "optimal" - which is a mixture of M4, C4, and R4 instances. This should be sufficient for demonstration purposes. In a production setting, it is recommended to specify the instance famimlies and sizes most apprioriate for the jobs the CE will support. For the On-Demand CE, selecting newer instance types is beneficial as they tend to have better price per performance.
8585
10. "Allocation strategy" will already be set to `BEST_FIT`. This is recommended for on-demand based compute environments as it ensures the most cost efficiency.
8686
11. In the "Launch template" drop down, select the `genomics-workflow-template` you created previously
8787
12. Set Minimum and Desired vCPUs to 0.
@@ -112,7 +112,7 @@ Click on "Create"
112112
6. In the "Service role" drop down, select the `AWSBatchServiceRole` you created previously
113113
7. In the "Instance role" drop down, select the `ecsInstanceRole` you created previously
114114
8. For "Provisioning model" select "Spot"
115-
9. "Allowed instance types" will be already populated with "optimal" - which is a mixture of M4, C4, and R4 instances.
115+
9. "Allowed instance types" will be already populated with "optimal" - which is a mixture of M4, C4, and R4 instances. This should be sufficient for demonstration purposes. In a production setting, it is recommended to specify the instance families and sizes most appropriate for the jobs the CE will support. For the SPOT CE a wider diversity of instance types is recommended to maximize the pools from which capacity can be drawn from. Limiting the size of instances is also recommended to avoid scheduling too many jobs on a SPOT instance that could be interrupted.
116116
10. "Allocation strategy" will already be set to `SPOT_CAPACITY_OPTIMIZED`. This is recommended for Spot based compute environments as it ensures the most compute capacity is available for your jobs.
117117
11. In the "Launch template" drop down, select the `genomics-workflow-template` you created previously
118118
12. Set Minimum and Desired vCPUs to 0.
@@ -135,20 +135,18 @@ Job queues can be associated with one or more compute environments in a preferre
135135
Below we'll create two job queues:
136136

137137
* A "Default" job queue
138-
* A "High Priority" job queue
138+
* A "Priority" job queue
139139

140140
Both job queues will use both compute environments you created previously.
141141

142142
##### Create a "default" job queue
143143

144-
This queue is intended for jobs that do not require urgent completion, and can handle potential interruption. This queue will schedule jobs to:
144+
This queue is intended for jobs that do not require urgent completion, and can handle potential interruption. This queue will schedule jobs to only the "spot" compute environment.
145145

146-
1. The "spot" compute environment
147-
2. The "ondemand" compute environment
146+
!!! note
147+
It is not recommended to configure a job queue to "spillover" from Spot to On-Demand. Doing so could lead Insufficient Capacity Errors, resulting in Batch unable to schedule jobs, leaving them stuck in "RUNNABLE"
148148

149-
in that order.
150-
151-
Because it primarily leverages Spot instances, it will also be the most cost effective job queue.
149+
Because it leverages Spot instances, it will also be the most cost effective job queue.
152150

153151
* Go to the AWS Batch Console
154152
* Click on "Job queues"
@@ -157,8 +155,7 @@ Because it primarily leverages Spot instances, it will also be the most cost eff
157155
* Set "Priority" to 1
158156
* Under "Connected compute environments for this queue", using the drop down menu:
159157

160-
1. Select the "spot" compute environment you created previously, then
161-
2. Select the "ondemand" compute environment you created previously
158+
1. Select the "spot" compute environment you created previously
162159

163160
* Click on "Create Job Queue"
164161

@@ -169,7 +166,7 @@ This queue is intended for jobs that are urgent and **cannot** handle potential
169166
1. The "ondemand" compute environment
170167
2. The "spot" compute environment
171168

172-
in that order.
169+
in that order. In this queue configuration, Batch will schedule jobs to the "ondemand" compute environment first. When the number of Max vCPUs for that environment is reached, Batch will begin scheduling jobs to the "spot" compute environment. The use of the "spot" compute environment is optional, and is used to help drain pending jobs from the queue faster.
173170

174171
* Go to the AWS Batch Console
175172
* Click on "Job queues"

src/templates/gwfcore/gwfcore-batch.template.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ Resources:
256256
ComputeEnvironmentOrder:
257257
- Order: 1
258258
ComputeEnvironment: !Ref SpotComputeEnv
259-
- Order: 2
260-
ComputeEnvironment: !Ref OnDemandComputeEnv
261-
259+
262260
ContainerInstanceLogGroup:
263261
Type: AWS::Logs::LogGroup
264262
Properties:

0 commit comments

Comments
 (0)