diff --git a/tests/scalability/launch-specification.json b/tests/scalability/launch-specification.json index 312f3f23057..1cfd768091d 100644 --- a/tests/scalability/launch-specification.json +++ b/tests/scalability/launch-specification.json @@ -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" -} \ No newline at end of file +} diff --git a/tests/scalability/prepare-ec2.sh b/tests/scalability/prepare-ec2.sh index 40adb642cf9..73462e968b2 100755 --- a/tests/scalability/prepare-ec2.sh +++ b/tests/scalability/prepare-ec2.sh @@ -2,7 +2,7 @@ set -e shutdown -P +60 -mkdir /cht +mkdir -p /cht chmod 777 /cht; # Install Docker CE @@ -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 \ @@ -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 diff --git a/tests/scalability/run_suite.sh b/tests/scalability/run_suite.sh index 3013b1c57fc..6e90cd9b986 100755 --- a/tests/scalability/run_suite.sh +++ b/tests/scalability/run_suite.sh @@ -4,7 +4,7 @@ set -e shutdown -P +60 -mkdir /cht +mkdir -p /cht chmod 777 /cht; cd cht @@ -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 ../ diff --git a/tests/scalability/start-ec2-cht.sh b/tests/scalability/start-ec2-cht.sh index 61e2f14f28c..3b3641b0f76 100755 --- a/tests/scalability/start-ec2-cht.sh +++ b/tests/scalability/start-ec2-cht.sh @@ -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 \ @@ -96,6 +104,7 @@ getInstanceUrl () { fi } +waitForBuildAvailable instanceResponse=$(runInstance "prepare-ec2.sh") instanceID=$(getInstanceId "$instanceResponse") echo Instance id is "$instanceID"