forked from pravega/pravega
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 2329: Update travis.yml to enable system test execution on AWS (p…
…ravega#2351) * Modifies travis.yml to include commands for executing system tests on AWS. * Collects the test logs and store them in Amazon S3 bucket. * Destroys EC2 cluster after the run. Signed-off-by: PrabhaVeerubhotla <[email protected]>
- Loading branch information
1 parent
dc75868
commit 613b999
Showing
11 changed files
with
153 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,43 @@ env: | |
global: | ||
- GRADLE_OPTS="-Xms128m" | ||
|
||
jobs: | ||
include: | ||
- stage: build | ||
if: type IN (push, pull_request) | ||
install: ./gradlew assemble | ||
script: ./gradlew check | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) -t ccceafaf-7c60-4a02-9165-480174b535a2 | ||
|
||
- stage: system tests | ||
if: repo != pravega/pravega | ||
env: | ||
- secure: xMd2acI6P4cIrVH1ha+CkwkHkomjjanKOWth8rqrLvLjSCA+K/zOqMp0VtDMyDFWSPLUnpa/D2oViGZD/q1rtLTs8O3aVQcQn9MiFL3VpwZKZ3PNEI9MhSgCMGh4oem4jIOu/A7xfTPFTOJsFyOFWi627MHW7EZmUsZOkzmMU04ms5i2Q63pboTd7W2ym9rzTWpGe3eb6IuqEbSyElWNDwKcVRT55YYvyahRL+lcOkObPXkiS2EcS098jfmofKDhkNFZ58m51ukOg7117pnQw0J8hXCtlcfJHfJC4+Mjao8IKeAzeoXkJL/lA1qSCAdkcg85+OeUjJ2HOTWsV+y+aS8VPe0bth2YMKn3/EfWVcrusbgVsbV1bUbje9C5OUOiBZ+0mgcBI2FMP9fk1lHOPJ/XXPfup6g1N67mB3kCK+YI3eTyhFaGnTaN+jz3qn86on8sXw9ionC3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ImH7MXHxjKw/FTN02tSba674ZaHVABxLGuqFtVVx2sORXkU64RCcwg4KSbSQlwUzUIInpkOyKkoI+RugcEHd8YItWiLrJUgvyBwU4IcBKvCgXDOWXlfii+/6eAZdw+2QiANtsWAkz0mxXejyyOAl4iUTMIuhuxjZ5eYcwyLoPXt14WXwuBh2wCZyzuU3h/sa6G+YR1gti4fMNjg2u1X+5uBD8TdHfCQ67D+1Pkx/7AzHYinrxEmx2o4XUs+6wkGcHGbzMUu/njeHSiVpedKAlIv+FuVeNJ73/CF1F2QCuEusUYnj7AXJFikYEWOK1FTI2ip3nQ5fAh/qFoHJNdWNHNhvF8XnRyCTdMK0GIUSXiHP7ciQtl8Sgl2N6Y0nvK9Hwk6T1nJBZr3rxdzPfwW0QBSFN4yyZkR6J4rq4mPi56xl72KV+zrcNsYWehcz8GWVspESn7EAXbwymHGdeJCel3JQ7Abxdf6mrDmTLP6POUtI3RjaIoQAulWBArNxe7e/wiVwWSPGRedE= | ||
before_install: | ||
- openssl aes-256-cbc -K $encrypted_7840d5b8aa7c_key -iv $encrypted_7840d5b8aa7c_iv -in aws-key-pair.pem.enc -out aws-key-pair.pem -d | ||
- sudo wget https://releases.hashicorp.com/terraform/0.11.3/terraform_0.11.3_linux_amd64.zip | ||
- unzip terraform_0.11.3_linux_amd64.zip | ||
- sudo mv terraform /usr/local/bin/ | ||
- chmod +x /usr/local/bin/terraform | ||
- sudo terraform --version | ||
install: | ||
- echo "Executing system tests on AWS" | ||
script: | ||
- ./gradlew startSystemTestsWithDocker -DskipServiceInstallation=false | ||
-Dlog.level=DEBUG -DexecType=DOCKER -PawsExecution=true -Paws_access_key="$AWS_ACCESS_KEY" | ||
-Paws_secret_key="$AWS_SECRET_KEY" -Paws_region=us-east-2 -Paws_key_name=aws-key-pair | ||
-Pconfig_path=/home/travis/build/pravega/pravega/test/system/aws -Pcred_path=/home/travis/build/pravega/pravega/aws-key-pair.pem | ||
-Ppravega_org="$TRAVIS_REPO_SLUG" -Ppravega_branch="$TRAVIS_BRANCH" -DimageVersion="$TRAVIS_BRANCH" | ||
-DawsExec=true | ||
- ./gradlew --info collectSystemTestLogsFromAws -Paws_access_key="$AWS_ACCESS_KEY" -Paws_secret_key="$AWS_SECRET_KEY" | ||
-Paws_region=us-east-2 -Paws_key_name=aws-key-pair | ||
-Pcred_path=/home/travis/build/pravega/pravega/aws-key-pair.pem -Pconfig_path=/home/travis/build/pravega/pravega/test/system/aws | ||
-Ppravega_org="$TRAVIS_REPO_SLUG" -Ppravega_branch="$TRAVIS_BRANCH" -Ptravis_commit="$TRAVIS_COMMIT" | ||
|
||
|
||
sudo: required | ||
|
||
services: | ||
|
@@ -36,10 +73,6 @@ notifications: | |
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) -t ccceafaf-7c60-4a02-9165-480174b535a2 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,4 @@ cred_path=/home/ubuntu | |
config_path=/home/ubuntu | ||
pravega_org=pravega | ||
pravega_branch=master | ||
travis_commit=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
ACCESSKEY=${1:-null} | ||
SECRETKEY=${2:-null} | ||
RUNNAME=${3:-null} | ||
COMMIT=${4:-null} | ||
host="$(hostname)" | ||
|
||
####copy all container logs in a given host. | ||
containersResult="$(docker ps -a -q|xargs)" | ||
echo "Containers in $host are ${containersResult}" | ||
containers=(${containersResult/%$'\r'/}) | ||
for container in "${containers[@]}" | ||
do | ||
echo "Executing commands for $container" | ||
mkdir -p logs/$container | ||
docker cp $container:/opt/pravega/logs/. logs/$container/ | ||
if [ $? -ne 0 ]; then | ||
echo "$container is not a controller/pravega node" | ||
continue | ||
fi | ||
tar -zcvf logs_$container.tar.gz ./logs/$container/ | ||
|
||
done | ||
index=1 | ||
find / -name logs |grep "/merged/opt/pravega/logs"| while read -r path ; do | ||
echo "Copying logs from $path $index" | ||
mkdir -p logs/$host-container-$index | ||
cp -r $path/. logs/$host-container-$index/ | ||
index=$((index+1)) | ||
done | ||
if [ -d logs ]; then | ||
tar -zcvf logs_$host.tar.gz logs/ | ||
else | ||
echo "No pravega containers running on $host" | ||
fi | ||
#### copy all test logs on the given mesos host. | ||
find / -name 'server.log' -print0 | tar -czvf testLogsIn-$host.tar.gz --null -T - | ||
|
||
echo "Uploading logs to s3 bucket:pravega-systemtests-logs" | ||
for file in ./*.tar.gz; do sudo AWS_ACCESS_KEY_ID=$ACCESSKEY AWS_SECRET_ACCESS_KEY=$SECRETKEY AWS_DEFAULT_REGION=us-east-2 aws s3 cp $file s3://pravega-systemtests-logs/$RUNNAME/$COMMIT/; done | ||
echo "Logs upload completed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
aws_access_key=${1:-null} | ||
aws_secret_key=${2:-null} | ||
aws_region=${3:-null} | ||
aws_key_name=${4:-aws-key-pair} | ||
cred_path=${5:-null} | ||
config_path=${6:-null} | ||
pravega_org=${7:-pravega/pravega} | ||
pravega_branch=${8:-master} | ||
travis_commit=${9:-null} | ||
cd aws/ | ||
sed -i 's/,/ /g' public_dns.txt | ||
var=`cat public_dns.txt` | ||
sudo chmod 400 $cred_path | ||
for i in $var; do | ||
ssh -o StrictHostKeyChecking=no -i $cred_path root@$i "bash -s" -- < ./logCollectionScript.sh $aws_access_key $aws_secret_key $pravega_branch $travis_commit | ||
done | ||
|
||
TF_LOG=INFO terraform destroy -force -var aws_access_key=$aws_access_key \ | ||
-var aws_secret_key=$aws_secret_key \ | ||
-var aws_region=$aws_region \ | ||
-var aws_key_name=$aws_key_name \ | ||
-var cred_path=$cred_path \ | ||
-var config_path=$config_path \ | ||
-var pravega_org=$pravega_org \ | ||
-var pravega_branch=$pravega_branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters