Skip to content

Deploy to AWS CloudFormation

Deprecated

This deployment option is deprecated, and will be removed in the future. We strongly recommend against using this option unless you are sufficiently experienced with CloudFormation to customize this template for your own infrastructure.

Tower can be deployed via AWS CloudFormation, using the included configuration.

This guide assumes that all prerequisites have been met.

Setup ECS cluster#

  1. Navigate to the ECS console in AWS

  2. Select Create cluster

  3. Select Amazon ECS -> Clusters -> EC2 Linux + Networking

ECS Cluster Configuration

  • Name: nf-tower

Instance Configuration

  • Provisioning Model: On-demand
  • EC2 instance type: c4.2xlarge
  • Number of instances: 1
  • EC2 AMI id: Amazon Linux 2
  • Root EBS Volume Size (GiB): none
  • Key pair: none

Networking Configuration

  • Create new VPC

Container instance IAM role

  • Create new role (if ecsInstance role doesn't exist)

Obtain Instance ServerURL

  • Record the Public IP of the instance in the ECS cluster e.g. 3.122.246.202

Deploy Tower#

Click to view aws-ecs-cloudformation.json
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
 {
     "AWSTemplateFormatVersion" : "2010-09-09",
     "Description" : "Nextflow Tower ECS template",
     "Parameters": {
         "ClusterName": {
             "Type": "String",
             "Description": "ECS cluster name"
         },
         "TowerSmtpHost": {
             "Type": "String",
             "Description": "SMTP server hostname"
         },
         "TowerSmtpPort": {
             "Type": "String",
             "Description": "SMTP server port"
         },
         "TowerSmtpUser": {
             "Type": "String",
             "Description": "SMTP server username",
             "NoEcho": "true"
         },
         "TowerSmtpPassword": {
             "Type": "String",
             "Description": "SMTP server password",
             "NoEcho": "true"
         },
         "TowerContactEmail": {
             "Type": "String",
             "Description": "Email for login emails"
         },
         "TowerServerUrl": {
             "Type": "String",
             "Description": "IP address of container instance"
         },
         "TowerJwtSecret": {
             "Type": "String",
             "Description": ">256 bit random string",
             "NoEcho": "true"
         },
         "TowerCryptoSecretkey": {
             "Type": "String",
             "Description": ">256 bit random string",
             "NoEcho": "true"
         },
         "TowerLicense": {
             "Type": "String",
             "Description": "The Tower License",
             "NoEcho": "true"
         },
         "TowerDbUrl": {
             "Type": "String",
             "Description": "MySQL DB connection URL"
         },
         "TowerDbUser": {
             "Type": "String",
             "Description": "MySQL DB username"
         },
         "TowerDbPassword": {
             "Type": "String",
             "Description": "MySQL DB password",
             "NoEcho": "true"
         }
     },
     "Resources" : {
         "TowerTask": {
             "Type": "AWS::ECS::TaskDefinition",
             "Properties": {
                 "NetworkMode": "bridge",
                 "ContainerDefinitions": [
                     {
                     "Name": "redis",
                     "Image": "public.ecr.aws/seqera-labs/redis:5.0.8",
                     "Memory": 2000,
                     "Cpu": 0,
                     "PortMappings": [{
                         "ContainerPort": 6379,
                         "HostPort": 6379
                     }],
                     "Command": ["--appendonly yes"]
                     },
                     {
                     "Name": "cron",
                     "Image": "195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/backend:v22.2.1",
                     "Memory": 2000,
                     "Cpu": 0,
                     "Links": [
                         "redis"
                     ],
                     "DependsOn": [
                         {
                             "ContainerName": "redis",
                             "Condition": "START"
                         }
                     ],
                     "WorkingDirectory": "/work",
                     "EntryPoint": [ "/bin/sh" ],
                     "Command": [ "-c", "/migrate-db.sh; /tower.sh" ],
                     "Environment": [
                         {
                             "Name": "TOWER_CONTACT_EMAIL",
                             "Value": {
                                 "Ref": "TowerContactEmail"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_HOST",
                             "Value": {
                                 "Ref": "TowerSmtpHost"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_PORT",
                             "Value": {
                                 "Ref": "TowerSmtpPort"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_USER",
                             "Value": {
                                 "Ref": "TowerSmtpUser"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_PASSWORD",
                             "Value": {
                                 "Ref": "TowerSmtpPassword"
                             }
                         },
                         {
                             "Name": "TOWER_DB_URL",
                             "Value": {
                                 "Ref": "TowerDbUrl"
                             }
                         },
                         {
                             "Name": "TOWER_DB_DRIVER",
                             "Value": "org.mariadb.jdbc.Driver"
                         },
                         {
                             "Name": "TOWER_DB_DIALECT",
                             "Value": "io.seqera.util.MySQL55DialectCollateBin"
                         },
                         {
                             "Name": "TOWER_DB_USER",
                             "Value": {
                                 "Ref": "TowerDbUser"
                             }
                         },
                         {
                             "Name": "TOWER_DB_PASSWORD",
                             "Value": {
                                 "Ref": "TowerDbPassword"
                             }
                         },
                         {
                             "Name": "TOWER_SERVER_URL",
                             "Value": {
                                 "Ref": "TowerServerUrl"
                             }
                         },
                         {
                             "Name": "MICRONAUT_ENVIRONMENTS",
                             "Value": "prod,redis,cron"
                         },
                         {
                             "Name": "TOWER_ENABLE_PLATFORMS",
                             "Value": "awsbatch-platform,azbatch-platform,gls-platform,slurm-platform"
                         },
                         {
                             "Name": "TOWER_JWT_SECRET",
                             "Value": {
                                 "Ref": "TowerJwtSecret"
                             }
                         },
                         {
                             "Name": "TOWER_CRYPTO_SECRETKEY",
                             "Value": {
                                 "Ref": "TowerCryptoSecretkey"
                             }
                         },
                         {
                             "Name": "TOWER_LICENSE",
                             "Value": {
                                 "Ref": "TowerLicense"
                             }
                         },
                         {
                             "Name": "FLYWAY_LOCATIONS",
                             "Value": "classpath:db-schema/mysql"
                         }
                     ]
                     },
                     {
                     "Name": "frontend",
                     "Image": "195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/frontend:v22.2.1",
                     "Memory": 2000,
                     "Cpu": 0,
                     "Essential": false,
                     "PortMappings": [{
                         "ContainerPort": 80,
                         "HostPort": 80
                     }],
                     "Links": [
                         "backend"
                     ],
                     "DependsOn": [
                         {
                             "ContainerName": "backend",
                             "Condition": "START"
                         }
                     ]
                     },
                     {
                     "Name": "backend",
                     "Hostname": "backend",
                     "Memory": 2000,
                     "Cpu": 0,
                     "Image": "195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/backend:v22.2.1",
                     "PortMappings": [{
                         "ContainerPort": 8080,
                         "HostPort": 8080
                     }],
                     "Essential": false,
                     "Links": [
                         "redis",
                         "cron"
                     ],
                     "WorkingDirectory": "/work",
                     "DependsOn": [
                             {
                                 "ContainerName": "cron",
                                 "Condition": "START"
                             },
                             {
                                 "ContainerName": "redis",
                                 "Condition": "START"
                             }
                     ],
                     "Environment": [
                         {
                             "Name": "TOWER_CONTACT_EMAIL",
                             "Value": {
                                 "Ref": "TowerContactEmail"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_HOST",
                             "Value": {
                                 "Ref": "TowerSmtpHost"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_PORT",
                             "Value": {
                                 "Ref": "TowerSmtpPort"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_USER",
                             "Value": {
                                 "Ref": "TowerSmtpUser"
                             }
                         },
                         {
                             "Name": "TOWER_SMTP_PASSWORD",
                             "Value": {
                                 "Ref": "TowerSmtpPassword"
                             }
                         },
                         {
                             "Name": "TOWER_DB_URL",
                             "Value": {
                                 "Ref": "TowerDbUrl"
                             }
                         },
                         {
                             "Name": "TOWER_DB_DRIVER",
                             "Value": "org.mariadb.jdbc.Driver"
                         },
                         {
                             "Name": "TOWER_DB_DIALECT",
                             "Value": "io.seqera.util.MySQL55DialectCollateBin"
                         },
                         {
                             "Name": "TOWER_DB_USER",
                             "Value": {
                                 "Ref": "TowerDbUser"
                             }
                         },
                         {
                             "Name": "TOWER_DB_PASSWORD",
                             "Value": {
                                 "Ref": "TowerDbPassword"
                             }
                         },
                         {
                             "Name": "TOWER_SERVER_URL",
                             "Value": {
                                 "Ref": "TowerServerUrl"
                             }
                         },
                         {
                             "Name": "MICRONAUT_ENVIRONMENTS",
                             "Value": "prod,redis,ha"
                         },
                         {
                             "Name": "TOWER_ENABLE_PLATFORMS",
                             "Value": "awsbatch-platform,azbatch-platform,gls-platform,slurm-platform"
                         },
                         {
                             "Name": "TOWER_JWT_SECRET",
                             "Value": {
                                 "Ref": "TowerJwtSecret"
                             }
                         },
                         {
                             "Name": "TOWER_CRYPTO_SECRETKEY",
                             "Value": {
                                 "Ref": "TowerCryptoSecretkey"
                             }
                         },
                         {
                             "Name": "TOWER_LICENSE",
                             "Value": {
                                 "Ref": "TowerLicense"
                             }
                         },
                         {
                             "Name": "FLYWAY_LOCATIONS",
                             "Value": "classpath:db-schema/mysql"
                         }
                     ],
                     "EntryPoint": [ "/bin/sh" ],
                     "Command": [ "-c", "/tower.sh" ]
                 }]
             }
         },
         "TowerService": {
             "Type" : "AWS::ECS::Service",
             "Properties" : {
                 "Cluster": {
                     "Ref": "ClusterName"
                 },
                 "DesiredCount" : 1,
                 "ServiceName" : "TowerService",
                 "TaskDefinition": {
                     "Ref": "TowerTask"
                 },
                 "LaunchType": "EC2"
             }
         }
     }
 }
Click to view params.json.template
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 [
     {
       "ParameterKey": "ClusterName",
       "ParameterValue": ""
     },
     {
       "ParameterKey": "TowerSmtpUser",
       "ParameterValue": ""
     },
     {
         "ParameterKey": "TowerSmtpPassword",
         "ParameterValue": ""
     },
     {
         "ParameterKey": "TowerContactEmail",
         "ParameterValue": ""
     },
     {
         "ParameterKey": "TowerServerUrl",
         "ParameterValue": ""
     },
     {
         "ParameterKey": "TowerJwtSecret",
         "ParameterValue": ""
     },
     {
         "ParameterKey": "TowerCryptoSecretkey",
         "ParameterValue": ""
     },
     {
         "ParameterKey": "TowerLicense",
         "ParameterValue": ""
     },
     {
         "ParameterKey": "TowerDbUrl",
         "ParameterValue": "tower"
     },
     {
         "ParameterKey": "TowerDbUser",
         "ParameterValue": "tower"
     },
     {
         "ParameterKey": "TowerDbPassword",
         "ParameterValue": "tower"
     },
     {
         "ParameterKey": "TowerSmtpHost",
         "ParameterValue": "email-smtp.eu-west-1.amazonaws.com"
     },
     {
         "ParameterKey": "TowerSmtpPort",
         "ParameterValue": "587"
     },
 ]
  1. Download aws-ecs-cloudformation.json and params.json.template.

  2. Rename params.template.json to params.json and configure for your environment.

    For more information on configuration, visit the Configuration section.

  3. Deploy the Tower stack to your ECS cluster:

    1
    2
    3
    4
    aws cloudformation create-stack \
        --stack-name Tower \
        --template-body file://aws-ecs-cloudformation.json \
        --parameters file://params.json
    

    You can delete the stack at any time, to uninstall Tower or update any parameters:

    1
    2
    aws cloudformation delete-stack \
        --stack-name Tower
    
Back to top