Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#8578): update scalability suite aws image #8615

Merged
merged 6 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/scalability/launch-specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
}
],
"SecurityGroupIds": ["sg-0fa20cd785acec256"],
"ImageId": "ami-065ba2b6b298ed80f",
"ImageId": "ami-0a24ca1ef53e3d20f",
"InstanceType": "c5.2xlarge",
"KeyName": "qa-scalability",
"KeyName": "qa-scalability",
"UserData": "IyEvYmluL2Jhc2gKc3VkbyBta2ZzIC10IGV4dDQgL2Rldi9udm1lMG4xOwpzdWRvIG1vdW50IC9kZXYvbnZtZTBuMSAvc3J2OwpzdWRvIGNobW9kIDc3NyAvc3J2OwpjZCAvc3J2OwpnaXQgY2xvbmUgaHR0cHM6Ly9naXRodWIuY29tL21lZGljL2NodC1pbmZyYXN0cnVjdHVyZS5naXQ7CmNkIGNodC1pbmZyYXN0cnVjdHVyZS9zZWxmLWhvc3RpbmcvcHJlcGFyZS1zeXN0ZW0vdWJ1bnR1LzsKbWtkaXIgLXAgL2hvbWUvbWVkaWMvc2VsZi1ob3N0aW5nL21haW4vCmVjaG8gRE9DS0VSX0NPVUNIREJfQURNSU5fUEFTU1dPUkQ9bWVkaWNTY2FsYWJpbGl0eSA+PiAvaG9tZS9tZWRpYy9zZWxmLWhvc3RpbmcvLmVudgplY2hvIEhBX1BBU1NXT1JEPW1lZGljU2NhbGFiaWxpdHkgPj4gL2hvbWUvbWVkaWMvc2VsZi1ob3N0aW5nLy5lbnYKLi9wcmVwYXJlLnNo"
}
}
8 changes: 4 additions & 4 deletions tests/scalability/prepare-ec2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

shutdown -P +60
mkdir /cht
mkdir -p /cht
chmod 777 /cht;

# Install Docker CE
Expand All @@ -12,7 +12,7 @@ apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
lsb-release \

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
Expand All @@ -26,8 +26,8 @@ curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compo
-o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

mkdir /cht/upgrade-service
mkdir /cht/compose
mkdir -p /cht/upgrade-service
mkdir -p /cht/compose

curl -s https://raw.githubusercontent.com/medic/cht-upgrade-service/main/docker-compose.yml \
-o /cht/upgrade-service/docker-compose.yml
Expand Down
3 changes: 1 addition & 2 deletions tests/scalability/run_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

shutdown -P +60

mkdir /cht
mkdir -p /cht
chmod 777 /cht;
cd cht

Expand All @@ -21,7 +21,6 @@ apt-get install default-jre -y
echo installing node
apt-get install nodejs npm -y


cd cht-core
npm install patch-package
cd webapp && npm ci && cd ../
Expand Down
11 changes: 10 additions & 1 deletion tests/scalability/start-ec2-cht.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ sed -i '4s~^~'BUILD=$MARKET_URL_READ/$STAGING_SERVER/medic:medic:$TAG'\n\n~' pre

echo Triggering EC2 Run Instance Command and getting Instance ID

waitForBuildAvailable() {
until [ "$(curl -s -w '%{http_code}' -o /dev/null "$MARKET_URL_READ/$STAGING_SERVER/medic:medic:$TAG")" -eq 200 ]
do
echo Waiting for CHT build to be available. Sleeping for 30.
sleep 30
done
}

runInstance () {
# --profile CA \ # for local runs
echo $(aws ec2 run-instances \
--image-id ami-0c3d8c5445511bd1d \
--image-id ami-0a24ca1ef53e3d20f \
--instance-type c5.2xlarge \
--block-device-mappings file://block-device-mapping.json \
--user-data file://$1 \
Expand Down Expand Up @@ -96,6 +104,7 @@ getInstanceUrl () {
fi
}

waitForBuildAvailable
instanceResponse=$(runInstance "prepare-ec2.sh")
instanceID=$(getInstanceId "$instanceResponse")
echo Instance id is "$instanceID"
Expand Down
Loading