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

Commit 8277375

Browse files
authored
auto expanding docker data volume fixes (#72)
* explicitly stop ecs before starting ebs autoscale on /var/lib/docker * move nextflow additions to before start ecs * fix autoexpanding docker data volume * add steps missing that are documented here: https://docs.docker.com/storage/storagedriver/btrfs-driver/ * fix scratch mount point mapping
1 parent c20ca8c commit 8277375

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

src/templates/aws-genomics-launch-template.template.yaml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ Mappings:
2323
ECSAdditionsMap:
2424
step-functions:
2525
additions: |-
26+
- stop ecs
2627
- service docker stop
27-
- cp -au /var/lib/docker /var/lib/docker.bk
28+
- cp -au /var/lib/docker /var/lib/docker.bk
29+
- rm -rf /var/lib/docker/*
2830
- cd /opt && wget $artifactRootUrl/aws-ebs-autoscale.tgz && tar -xzf aws-ebs-autoscale.tgz
2931
- sh /opt/ebs-autoscale/bin/init-ebs-autoscale.sh $scratchPath /dev/sdc 2>&1 > /var/log/init-ebs-autoscale.log
3032
- sed -i 's+OPTIONS=.*+OPTIONS="--storage-driver btrfs"+g' /etc/sysconfig/docker-storage
33+
- cp -au /var/lib/docker.bk/* /var/lib/docker
3134
- service docker start
3235
- start ecs
3336
@@ -40,15 +43,18 @@ Mappings:
4043
4144
nextflow:
4245
additions: |-
46+
- stop ecs
4347
- service docker stop
44-
- cp -au /var/lib/docker /var/lib/docker.bk
48+
- cp -au /var/lib/docker /var/lib/docker.bk
49+
- rm -rf /var/lib/docker/*
4550
- cd /opt && wget $artifactRootUrl/aws-ebs-autoscale.tgz && tar -xzf aws-ebs-autoscale.tgz
4651
- sh /opt/ebs-autoscale/bin/init-ebs-autoscale.sh $scratchPath /dev/sdc 2>&1 > /var/log/init-ebs-autoscale.log
4752
- sed -i 's+OPTIONS=.*+OPTIONS="--storage-driver btrfs"+g' /etc/sysconfig/docker-storage
48-
- service docker start
49-
- start ecs
53+
- cp -au /var/lib/docker.bk/* /var/lib/docker
5054
- cd /opt && wget $artifactRootUrl/aws-ecs-additions.tgz && tar -xzf aws-ecs-additions.tgz
5155
- sh /opt/ecs-additions/ecs-additions-nextflow.sh
56+
- service docker start
57+
- start ecs
5258
5359
Parameters:
5460
LaunchTemplateNamePrefix:
@@ -71,18 +77,12 @@ Parameters:
7177
- step-functions
7278
- cromwell
7379
- nextflow
74-
ScratchMountPoint:
75-
Type: String
76-
Default: /scratch
77-
Description: >-
78-
Path for the scratch mount point in the instance. If your workflow
79-
orchestrator is "Cromwell" the value here is overridden with "/cromwell_root".
80-
If your workflow orcheistrator is "Nextflow" the value here is overriden with "/var/lib/docker".
8180
ArtifactRootUrl:
8281
Type: String
8382
Default: https://s3.amazonaws.com/aws-genomics-workflows/artifacts
8483
Description: >-
8584
Root URL for where artifacts / additions scripts are stored
85+
8686
Metadata:
8787
AWS::CloudFormation::Interface:
8888
ParameterGroups:
@@ -94,13 +94,9 @@ Metadata:
9494
- Label:
9595
default: "Optional"
9696
Parameters:
97-
- ScratchMountPoint
9897
- ScratchVolumeSize
9998
- DockerImageAndMetadataVolumeSize
100-
Conditions:
101-
UseCromwell: !Equals [!Ref WorkflowOrchestrator, cromwell]
102-
UseNextflow: !Equals [!Ref WorkflowOrchestrator, nextflow]
103-
ScratchOverride: !Or [Condition: UseCromwell, Condition: UseNextflow]
99+
104100
Resources:
105101
EC2LaunchTemplate:
106102
Type: AWS::EC2::LaunchTemplate
@@ -160,11 +156,11 @@ Resources:
160156
- ECSAdditionsMap
161157
- !Ref WorkflowOrchestrator
162158
- additions
163-
ScratchMountPoint:
164-
Fn::If:
165-
- ScratchOverride
166-
- !FindInMap [ ScratchMountPointMap, !Ref WorkflowOrchestrator, mountpoint ]
167-
- !Ref ScratchMountPoint
159+
ScratchMountPoint:
160+
Fn::FindInMap:
161+
- ScratchMountPointMap
162+
- !Ref WorkflowOrchestrator
163+
- mountpoint
168164

169165
Outputs:
170166
LaunchTemplateId:

0 commit comments

Comments
 (0)