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

Commit 47a9f94

Browse files
committed
Add nextflow-and-core template
1 parent 486c124 commit 47a9f94

File tree

3 files changed

+274
-6
lines changed

3 files changed

+274
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ Parameters:
7878
Description: Does this bucket already exist?
7979
Type: String
8080
AllowedValues:
81-
- Yes
82-
- No
83-
Default: No
81+
- "Yes"
82+
- "No"
83+
Default: "No"
8484
DefaultCEMinvCpus:
8585
Description: The minimum number of CPUs for the default Batch Compute Environment
8686
Type: Number

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Parameters:
3232
Type: String
3333
Description: Does this bucket already exist? If not, it will be created.
3434
AllowedValues:
35-
- Yes
36-
- No
37-
Default: No
35+
- "Yes"
36+
- "No"
37+
Default: "No"
3838

3939
Conditions:
4040
BucketDoesNotExist:
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
---
2+
AWSTemplateFormatVersion: '2010-09-09'
3+
Description: >-
4+
(WWPS-GLS-WF-NEXTFLOW-AIO) Creates the complete set of resources needed to run
5+
genomics workflows using Nextflow on AWS Batch
6+
7+
8+
Mappings:
9+
TagMap:
10+
default:
11+
architecture: "genomics-workflows"
12+
solution: "nextflow"
13+
tags:
14+
- Key: "architecture"
15+
Value: "genomics-workflows"
16+
- Key: "solution"
17+
Value: "nextflow"
18+
19+
20+
Metadata:
21+
AWS::CloudFormation::Interface:
22+
ParameterGroups:
23+
- Label:
24+
default: "VPC"
25+
Parameters:
26+
- VpcId
27+
- SubnetIds
28+
- Label:
29+
default: "Data Storage"
30+
Parameters:
31+
- S3DataBucketName
32+
- ExistingDataBucket
33+
- Label:
34+
default: "AWS Batch"
35+
Parameters:
36+
- DefaultCEMinvCpus
37+
- DefaultCEMaxvCpus
38+
- PriorityCEMinvCpus
39+
- PriorityCEMaxvCpus
40+
- Label:
41+
default: "Nextflow Resources"
42+
Parameters:
43+
- S3NextflowPrefix
44+
- S3LogsDirPrefix
45+
- S3WorkDirPrefix
46+
- NextflowVersion
47+
- NextflowVersionSpecified
48+
49+
ParameterLabels:
50+
VpcId:
51+
default: VPC ID
52+
SubnetIds:
53+
default: VPC Subnet IDs
54+
S3DataBucketName:
55+
default: S3 Data Bucket Name
56+
ExistingDataBucket:
57+
default: Existing Data Bucket?
58+
DefaultCEMinvCpus:
59+
default: Default Min vCPU
60+
DefaultCEMaxvCpus:
61+
default: Default Max vCPU
62+
PriorityCEMinvCpus:
63+
default: High Priority Min vCPU
64+
PriorityCEMaxvCpus:
65+
default: High Priority Max vCPU
66+
S3NextflowPrefix:
67+
default: S3 Nextflow Prefix
68+
S3LogsDirPrefix:
69+
default: S3 Logs Dir Prefix
70+
S3WorkDirPrefix:
71+
default: S3 Work Dir Prefix
72+
NextflowVersion:
73+
default: Nextflow Version
74+
NextflowVersionSpecified:
75+
default: Nextflow Version Specified?
76+
TemplateRootUrl:
77+
default: Template Root URL
78+
79+
80+
Parameters:
81+
VpcId:
82+
Type: AWS::EC2::VPC::Id
83+
Description: 'The VPC to create security groups and deploy AWS Batch to. NOTE: Must be the same VPC as the provided subnet IDs.'
84+
SubnetIds:
85+
Type: List<AWS::EC2::Subnet::Id>
86+
Description: 'Subnets you want your batch compute environment to launch in. We recommend private subnets. NOTE: Must be from the VPC provided.'
87+
88+
S3DataBucketName:
89+
Description: >-
90+
A S3 bucket name for storing analysis results
91+
The bucket name must respect the S3 bucket naming conventions
92+
(can contain lowercase letters, numbers, periods and hyphens).
93+
If left blank a unique bucket name will be generated.
94+
95+
Type: String
96+
Default: ""
97+
AllowedPattern: "((?=^.{3,63}$)(?!^(\\d+\\.)+\\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])$)|(^.{0}$))"
98+
ConstraintDescription: "Must respect S3 bucket naming conventions"
99+
100+
ExistingDataBucket:
101+
Description: Does this data bucket already exist?
102+
Type: String
103+
AllowedValues:
104+
- "Yes"
105+
- "No"
106+
Default: "No"
107+
DefaultCEMinvCpus:
108+
Description: The minimum number of CPUs for the default Batch Compute Environment
109+
Type: Number
110+
Default: 0
111+
DefaultCEMaxvCpus:
112+
Description: The maximum number of CPUs for the default Batch Compute Environment
113+
Type: Number
114+
Default: 100
115+
PriorityCEMinvCpus:
116+
Description: The minimum number of CPUs for the high-priority Batch Compute Environment
117+
Type: Number
118+
Default: 0
119+
PriorityCEMaxvCpus:
120+
Description: The maximum number of CPUs for the high-priority Batch Compute Environment
121+
Type: Number
122+
Default: 100
123+
124+
S3NextflowPrefix:
125+
Type: String
126+
Description: >-
127+
(Optional) Parent folder in the GWFCore bucket for metadata folders.
128+
Default: _nextflow
129+
S3LogsDirPrefix:
130+
Type: String
131+
Description: >-
132+
(Optional) Folder in the GWFCore bucket under the {Nextflow Prefix}
133+
for session cache and logs.
134+
Default: logs
135+
S3WorkDirPrefix:
136+
Type: String
137+
Description: >-
138+
(Optional) Folder in the GWFCore bucket under the {Nextflow Prefix}
139+
that contains workflow intermediate results
140+
Default: runs
141+
NextflowVersion:
142+
Type: String
143+
Default: latest
144+
AllowedValues:
145+
- latest
146+
- specify ...
147+
Description: >-
148+
Version of Nextflow to use. Select "specify ..." to provide a specific version.
149+
NextflowVersionSpecified:
150+
Type: String
151+
Description: >-
152+
Specific version of Nextflow to use. Must match a released version number - e.g. "20.04.1".
153+
Default: ""
154+
155+
ArtifactBucketName:
156+
Type: String
157+
Default: aws-genomics-workflows
158+
Description: >-
159+
S3 Bucket where distrubution artifacts and additions scripts are stored
160+
ArtifactBucketPrefix:
161+
Type: String
162+
Default: artifacts # dist: pin_version
163+
Description: >-
164+
Prefix in ArtifactBucketName where distribution artifacts and additions scripts are stored
165+
166+
TemplateRootUrl:
167+
Type: String
168+
Description: >-
169+
Root URL for where nested templates are stored
170+
Default: https://aws-genomics-workflows.s3.amazonaws.com/templates
171+
ConstraintDescription: >-
172+
Must be a valid S3 URL
173+
AllowedPattern: "https://[a-z0-9-./]{0,}s3([a-z0-9-.]+)*\\.amazonaws\\.com/[a-z0-9-./]{3,}"
174+
175+
176+
Resources:
177+
GenomicsWorkflowStack:
178+
Type: AWS::CloudFormation::Stack
179+
Properties:
180+
TemplateURL: !Sub ${TemplateRootUrl}/gwfcore/gwfcore-root.template.yaml
181+
Parameters:
182+
Namespace: !Sub ${AWS::StackName}-gwfcore
183+
VpcId: !Ref VpcId
184+
SubnetIds: !Join [",", !Ref SubnetIds ]
185+
S3BucketName: !Ref S3DataBucketName
186+
ExistingBucket: !Ref ExistingDataBucket
187+
DefaultCEMinvCpus: !Ref DefaultCEMinvCpus
188+
DefaultCEMaxvCpus: !Ref DefaultCEMaxvCpus
189+
PriorityCEMinvCpus: !Ref PriorityCEMinvCpus
190+
PriorityCEMaxvCpus: !Ref PriorityCEMaxvCpus
191+
ArtifactBucketName: !Ref ArtifactBucketName
192+
ArtifactBucketPrefix: !Ref ArtifactBucketPrefix
193+
TemplateRootUrl: !Ref TemplateRootUrl
194+
Tags: !FindInMap ["TagMap", "default", "tags"]
195+
196+
NextflowStack:
197+
Type: AWS::CloudFormation::Stack
198+
DependsOn: GenomicsWorkflowStack
199+
Properties:
200+
TemplateURL: !Sub ${TemplateRootUrl}/nextflow/nextflow-resources.template.yaml
201+
Parameters:
202+
Namespace: !Sub ${AWS::StackName}-nextflow
203+
GWFCoreNamespace: !Sub "${AWS::StackName}-gwfcore"
204+
S3NextflowPrefix: !Ref S3NextflowPrefix
205+
S3LogsDirPrefix: !Ref S3LogsDirPrefix
206+
S3WorkDirPrefix: !Ref S3WorkDirPrefix
207+
NextflowVersion: !Ref NextflowVersion
208+
NextflowVersionSpecified: !Ref NextflowVersionSpecified
209+
TemplateRootUrl: !Ref TemplateRootUrl
210+
Tags: !FindInMap ["TagMap", "default", "tags"]
211+
212+
213+
Outputs:
214+
NextflowContainerImage:
215+
Value: !GetAtt NextflowStack.Outputs.NextflowContainerImage
216+
Export:
217+
Name: !Sub "${AWS::StackName}-NextflowContainerImage"
218+
219+
NextflowJobDefinition:
220+
Value: !GetAtt NextflowStack.Outputs.NextflowJobDefinition
221+
Export:
222+
Name: !Sub "${AWS::StackName}-NextflowJobDefinition"
223+
Description: >-
224+
Batch Job Definition that creates a nextflow head node for running workflows
225+
226+
S3NextFlowBucket:
227+
Value: !GetAtt NextflowStack.Outputs.NextflowBucket
228+
Export:
229+
Name: !Sub "${AWS::StackName}-NextflowBucket"
230+
Description: >-
231+
S3 Bucket used to store Nextflow metadata (session cache, logs, and intermediate results)
232+
S3NextflowLogsDir:
233+
Value: !GetAtt NextflowStack.Outputs.LogsDir
234+
Export:
235+
Name: !Sub "${AWS::StackName}-NextflowLogsDir"
236+
Description: >-
237+
S3 URI where nextflow session cache and logs are stored.
238+
S3NextflowWorkDir:
239+
Value: !GetAtt NextflowStack.Outputs.WorkDir
240+
Export:
241+
Name: !Sub "${AWS::StackName}-NextflowWorkDir"
242+
Description: >-
243+
S3 URI where workflow intermediate results are stored.
244+
245+
VpcId:
246+
Description: >-
247+
The VPC created for your Nextflow stack.
248+
Value: !Ref VpcId
249+
S3DataBucket:
250+
Value: !GetAtt 'GenomicsWorkflowStack.Outputs.S3BucketName'
251+
Export:
252+
Name: !Sub "${AWS::StackName}-DataBucket"
253+
Description: >-
254+
S3 bucket for storing genomics workflow input and output data
255+
BatchDefaultQueue:
256+
Value: !GetAtt 'GenomicsWorkflowStack.Outputs.DefaultJobQueueArn'
257+
Export:
258+
Name: !Sub "${AWS::StackName}-DefaultJobQueue"
259+
Description: >-
260+
The default AWS Batch job queue for workflow jobs, based on EC2 SPOT instances
261+
BatchPriorityQueue:
262+
Value: !GetAtt 'GenomicsWorkflowStack.Outputs.PriorityJobQueueArn'
263+
Export:
264+
Name: !Sub "${AWS::StackName}-PriorityJobQueue"
265+
Description: >-
266+
AWS Batch job queue for high priority workflow jobs, based on EC2 On-Demand
267+
instances
268+
...

0 commit comments

Comments
 (0)