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

Commit 2812fd2

Browse files
committed
refactor how ebs-autoscale is retrieved
* provide options for retreiving develop, latest, or disttribution release versions * add shims for backward compatibility * add distribution release build from upstream repo
1 parent a1a728e commit 2812fd2

File tree

6 files changed

+71
-23
lines changed

6 files changed

+71
-23
lines changed

_scripts/make-artifacts.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,32 @@ fi
2525

2626

2727
echo "repackaging:"
28+
29+
# package ebs-autoscale
30+
# combines the latest release of amazon-ebs-autoscale with compatibility shim
31+
# scripts in ./ebs-autoscale/
2832
cd ${SOURCE_PATH}
33+
EBS_AUTOSCALE_VERSION=$(curl --silent "https://api.github.com/repos/awslabs/amazon-ebs-autoscale/releases/latest" | jq -r .tag_name)
34+
curl --silent -L \
35+
"https://github.com/awslabs/amazon-ebs-autoscale/archive/${EBS_AUTOSCALE_VERSION}.tar.gz" \
36+
-o ./amazon-ebs-autoscale.tar.gz
37+
38+
tar -xzvf ./amazon-ebs-autoscale.tar.gz
39+
mv ./amazon-ebs-autoscale*/ ./amazon-ebs-autoscale
40+
echo $EBS_AUTOSCALE_VERSION > ./amazon-ebs-autoscale/VERSION
41+
cp -Rfv ./amazon-ebs-autoscale/* ./ebs-autoscale/
42+
2943
tar -czvf ${ARTIFACT_PATH}/aws-ebs-autoscale.tgz ./ebs-autoscale/
30-
tar -czvf ${ARTIFACT_PATH}/aws-ecs-additions.tgz ./ecs-additions/
3144

45+
# add a copy of the release tarball for naming consistency
46+
tar -czvf ${ARTIFACT_PATH}/amazon-ebs-autoscale.tgz ./amazon-ebs-autoscale
47+
48+
# add a retrieval script
49+
cp -vf ./ebs-autoscale/get-amazon-ebs-autoscale.sh ${ARTIFACT_PATH}
50+
51+
# package ecs-additions
52+
cd ${SOURCE_PATH}
53+
tar -czvf ${ARTIFACT_PATH}/aws-ecs-additions.tgz ./ecs-additions/
3254

3355
cd ${CWD}
3456

src/ebs-autoscale/amazon-ebs-autoscale.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# this is a shim for backwards compatibility for releases <2.6.0
4+
# old steps:
5+
# - cd /opt && wget $artifactRootUrl/aws-ebs-autoscale.tgz && tar -xzf aws-ebs-autoscale.tgz
6+
# - sh /opt/ebs-autoscale/bin/init-ebs-autoscale.sh $scratchPath /dev/sdc 2>&1 > /var/log/init-ebs-autoscale.log
7+
sh /opt/a*-ebs-autoscale/install.sh $@
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
VERSION=${1:-release}
4+
5+
function develop() {
6+
# retrieve the current development version of amazon-ebs-autoscale
7+
# WARNING may not be fully tested or stable
8+
git clone https://github.com/awslabs/amazon-ebs-autoscale.git
9+
cd /opt/amazon-ebs-autoscale
10+
git checkout master
11+
}
12+
13+
function latest() {
14+
# retrive the latest released version of amazon-ebs-autoscale
15+
# recommended if you want instances to stay up to date with upstream updates
16+
EBS_AUTOSCALE_VERSION=$(curl --silent "https://api.github.com/repos/awslabs/amazon-ebs-autoscale/releases/latest" | jq -r .tag_name)
17+
curl --silent -L \
18+
"https://github.com/awslabs/amazon-ebs-autoscale/archive/${EBS_AUTOSCALE_VERSION}.tar.gz" \
19+
-o ./amazon-ebs-autoscale.tar.gz
20+
21+
tar -xzvf ./amazon-ebs-autoscale.tar.gz
22+
mv ./amazon-ebs-autoscale*/ ./amazon-ebs-autoscale
23+
echo $EBS_AUTOSCALE_VERSION > ./amazon-ebs-autoscale/VERSION
24+
}
25+
26+
function release() {
27+
# retrieve the version of amazon-ebs-autoscale concordant with the latest
28+
# release of aws-genomics-workflows
29+
# recommended if you have no other way to get the amazon-ebs-autoscale code
30+
wget $artifactRootUrl/amazon-ebs-autoscale.tgz
31+
tar -xzf amazon-ebs-autoscale.tgz
32+
}
33+
34+
cd /opt
35+
VERSION

src/ebs-autoscale/init-ebs-autoscale.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ Mappings:
2727
- service docker stop
2828
- cp -au /var/lib/docker /var/lib/docker.bk
2929
- rm -rf /var/lib/docker/*
30-
- EBS_AUTOSCALE_VERSION=$(curl --silent "https://api.github.com/repos/awslabs/amazon-ebs-autoscale/releases/latest" | jq -r .tag_name)
31-
- cd /opt && git clone https://github.com/awslabs/amazon-ebs-autoscale.git
32-
- cd /opt/amazon-ebs-autoscale && git checkout $EBS_AUTOSCALE_VERSION
30+
- cd /opt && wget $artifactRootUrl/get-amazon-ebs-autoscale.sh
31+
- sh /opt/get-amazon-ebs-autoscale.sh
3332
- sh /opt/amazon-ebs-autoscale/install.sh $scratchPath /dev/sdc 2>&1 > /var/log/ebs-autoscale-install.log
3433
- sed -i 's+OPTIONS=.*+OPTIONS="--storage-driver btrfs"+g' /etc/sysconfig/docker-storage
3534
- cp -au /var/lib/docker.bk/* /var/lib/docker
@@ -40,9 +39,8 @@ Mappings:
4039
4140
cromwell:
4241
additions: |-
43-
- EBS_AUTOSCALE_VERSION=$(curl --silent "https://api.github.com/repos/awslabs/amazon-ebs-autoscale/releases/latest" | jq -r .tag_name)
44-
- cd /opt && git clone https://github.com/awslabs/amazon-ebs-autoscale.git
45-
- cd /opt/amazon-ebs-autoscale && git checkout $EBS_AUTOSCALE_VERSION
42+
- cd /opt && wget $artifactRootUrl/get-amazon-ebs-autoscale.sh
43+
- sh /opt/get-amazon-ebs-autoscale.sh
4644
- sh /opt/amazon-ebs-autoscale/install.sh $scratchPath /dev/sdc 2>&1 > /var/log/ebs-autoscale-install.log
4745
- cd /opt && wget $artifactRootUrl/aws-ecs-additions.tgz && tar -xzf aws-ecs-additions.tgz
4846
- sh /opt/ecs-additions/ecs-additions-cromwell.sh
@@ -53,9 +51,8 @@ Mappings:
5351
- service docker stop
5452
- cp -au /var/lib/docker /var/lib/docker.bk
5553
- rm -rf /var/lib/docker/*
56-
- EBS_AUTOSCALE_VERSION=$(curl --silent "https://api.github.com/repos/awslabs/amazon-ebs-autoscale/releases/latest" | jq -r .tag_name)
57-
- cd /opt && git clone https://github.com/awslabs/amazon-ebs-autoscale.git
58-
- cd /opt/amazon-ebs-autoscale && git checkout $EBS_AUTOSCALE_VERSION
54+
- cd /opt && wget $artifactRootUrl/get-amazon-ebs-autoscale.sh
55+
- sh /opt/get-amazon-ebs-autoscale.sh
5956
- sh /opt/amazon-ebs-autoscale/install.sh $scratchPath /dev/sdc 2>&1 > /var/log/ebs-autoscale-install.log
6057
- sed -i 's+OPTIONS=.*+OPTIONS="--storage-driver btrfs"+g' /etc/sysconfig/docker-storage
6158
- cp -au /var/lib/docker.bk/* /var/lib/docker

0 commit comments

Comments
 (0)