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

Commit 97aeadd

Browse files
authored
Merge pull request #7 from aws-samples/develop
add cromwell version selection
2 parents e771ec4 + 74763bb commit 97aeadd

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

src/templates/cromwell/cromwell-aio.template.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Metadata:
3636
- Label:
3737
default: "Cromwell Server"
3838
Parameters:
39+
- CromwellVersion
3940
- InstanceType
4041
- InstanceName
4142
- SSHLocation
@@ -115,6 +116,16 @@ Parameters:
115116
Type: String
116117
Default: cromwell-server
117118
Description: The name of the EC2 instance that is created
119+
CromwellVersion:
120+
Type: String
121+
Description: >-
122+
Version of Cromwell to install. "latest" will retrieve the currently released
123+
version of Cromwell from Github.
124+
AllowedValues:
125+
- latest
126+
- 36.1
127+
- 36
128+
Default: 36.1
118129
SSHLocation:
119130
Description: "The IP address range that has SSH access to the EC2 instances"
120131
Type: String
@@ -171,6 +182,7 @@ Resources:
171182
VpcId: !GetAtt 'VpcStack.Outputs.VPCID'
172183
PublicSubnetID: !GetAtt 'VpcStack.Outputs.PublicSubnet1ID'
173184
InstanceName: !Join ["-", [!Ref 'InstanceName', !Select [2, !Split ["/", !Ref "AWS::StackId" ]]]]
185+
CromwellVersion: !Ref CromwellVersion
174186
KeyName: !Ref 'KeyPairName'
175187
SSHLocation: !Ref 'SSHLocation'
176188
HTTPLocation: !Ref 'HTTPLocation'
@@ -185,6 +197,10 @@ Outputs:
185197
Description: >-
186198
Cromwell server public DNS name. Use this URL in a web browser or via curl
187199
to access Cromwell and submit workflows.
200+
CromwellServerVersion:
201+
Description: >-
202+
Version of Cromwell installed.
203+
Value: !Ref CromwellVersion
188204
VpcId:
189205
Description: >-
190206
The VPC created for your Cromwell stack. Use this ID if you need to launch

src/templates/cromwell/cromwell-server.template.yaml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ Parameters:
4242
Default: /aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2
4343
AllowedValues:
4444
- /aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2
45+
46+
CromwellVersion:
47+
Type: String
48+
Description: >-
49+
Version of Cromwell to install. "latest" will retrieve the currently released
50+
version of Cromwell from Github.
51+
AllowedValues:
52+
- latest
53+
- 36.1
54+
- 36
55+
Default: 36.1
4556

4657
InstanceName:
4758
Type: String
@@ -79,6 +90,14 @@ Parameters:
7990
Description: ARN of the AWS Batch Job Queue this server will use by default
8091
Type: String
8192

93+
94+
Conditions:
95+
GetLatestCromwellVersion:
96+
Fn::Equals:
97+
- !Ref CromwellVersion
98+
- latest
99+
100+
82101
# Resources
83102
Resources:
84103
Ec2InstanceRole:
@@ -221,11 +240,17 @@ Resources:
221240
group: root
222241

223242
"/home/ec2-user/get_cromwell.sh":
224-
content: !Sub |
243+
content: !Sub
244+
- |
225245
#!/bin/bash
226-
url=$(curl --silent "https://api.github.com/repos/broadinstitute/cromwell/releases/latest" | jq -r .assets[0].browser_download_url)
246+
url=$(curl --silent "https://api.github.com/repos/broadinstitute/cromwell/releases/${CromwellVersionPath}" | jq -r .assets[0].browser_download_url)
227247
curl -LO $url
228-
ln -s $(find . | grep "cromwell.*\.jar") cromwell-latest.jar
248+
ln -s $(find . | grep "cromwell.*\.jar") cromwell.jar
249+
- CromwellVersionPath:
250+
Fn::If:
251+
- GetLatestCromwellVersion
252+
- !Ref CromwellVersion
253+
- !Join ["/", ["tags", !Ref CromwellVersion]]
229254

230255
mode: "000755"
231256
owner: "ec2-user"
@@ -281,7 +306,7 @@ Resources:
281306
"/home/ec2-user/run_cromwell_server.sh":
282307
content: !Sub |
283308
#!/bin/bash
284-
java -Dconfig.file=cromwell.conf -jar cromwell-latest.jar server
309+
java -Dconfig.file=cromwell.conf -jar cromwell.jar server
285310
286311
mode: "000755"
287312
owner: "ec2-user"
@@ -487,6 +512,7 @@ Metadata:
487512
- Label:
488513
default: "Cromwell Configuration"
489514
Parameters:
515+
- CromwellVersion
490516
- S3BucketName
491517
- BatchQueue
492518

@@ -509,6 +535,8 @@ Metadata:
509535
default: "S3 Bucket Name"
510536
BatchQueue:
511537
default: "Default Batch Queue"
538+
CromwellVersion:
539+
default: "Cromwell Version"
512540

513541
Outputs:
514542
EC2Instance:

0 commit comments

Comments
 (0)