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

Migrate artefacts to another step #695

Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ steps:
artifact_paths:
- allure-reports.tar.gz
- fts_${BUILDKITE_BUILD_NUMBER}.log
- "./logs/*"

- wait

Expand All @@ -70,5 +71,5 @@ steps:
- "full_test_suite"
- "create_infrastructure"
allow_dependency_failure: true
artifact_paths:
- ".buildkite/steps/full_test_suite/logs/*"


45 changes: 43 additions & 2 deletions .buildkite/steps/full_test_suite/run_full_test_suite.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash
set -euo pipefail

handle_error() {
rozhkovdmitrii marked this conversation as resolved.
Show resolved Hide resolved
if [[ $? -ne 0 ]]
then
echo "Interrupt at step. $1"
rozhkovdmitrii marked this conversation as resolved.
Show resolved Hide resolved
exit 1
fi
}

# External addresses from previous step
PROXY_ADDR=`buildkite-agent meta-data get 'PROXY_IP'`
Expand All @@ -18,13 +25,47 @@ echo "External URL for solana: ${SOLANA_URL}"
# Start tests
echo Full test suite container name - ${FTS_CONTAINER_NAME}
docker-compose -f docker-compose/docker-compose-full-test-suite.yml pull
handle_error "Error while docker image pulling"
docker-compose -f docker-compose/docker-compose-full-test-suite.yml up
handle_error "Error while tests running"
FTS_RESULT=$(docker logs ${FTS_CONTAINER_NAME} | (grep -oP "(?<=Passing - )\d+" || echo 0))
# Retreive logs

# Retreive logs from local containers
docker cp ${FTS_CONTAINER_NAME}:/opt/allure-reports.tar.gz ./
rozhkovdmitrii marked this conversation as resolved.
Show resolved Hide resolved
docker logs ${FTS_CONTAINER_NAME} > ./${FTS_CONTAINER_NAME}.log
rozhkovdmitrii marked this conversation as resolved.
Show resolved Hide resolved

# Retreive logs from remote instances
export SSH_KEY="~/.ssh/ci-stands"
export ARTIFACTS_LOGS="./logs"
mkdir -p $ARTIFACTS_LOGS
handle_error "Failed to create artifacts dir at: '$ARTIFACTS_LOGS'"

# solana
export SOLANA_ADDR=`buildkite-agent meta-data get "SOLANA_IP"`
ssh-keyscan -H $SOLANA_ADDR >> ~/.ssh/known_hosts
echo "Upload logs for service: solana"
ssh -i ${SSH_KEY} ubuntu@${SOLANA_ADDR} 'sudo docker logs solana 2>&1 | pbzip2 > /tmp/solana.log.bz2'
handle_error "Can't scan host for fingerprint"
scp -i ${SSH_KEY} ubuntu@${SOLANA_ADDR}:/tmp/solana.log.bz2 ${ARTIFACTS_LOGS}
handle_error "Retrieve log file for atrifact"

# proxy
export PROXY_ADDR=`buildkite-agent meta-data get "PROXY_IP"`
ssh-keyscan -H $PROXY_ADDR >> ~/.ssh/known_hosts
rozhkovdmitrii marked this conversation as resolved.
Show resolved Hide resolved
declare -a services=("evm_loader" "postgres" "dbcreation" "indexer" "proxy" "faucet" "airdropper")

for service in "${services[@]}"
do
echo "Upload logs for service: $service"
ssh -i ${SSH_KEY} ubuntu@${PROXY_ADDR} "sudo docker logs $service 2>&1 | pbzip2 > /tmp/$service.log.bz2"
handle_error "Dump $service log to the file"
scp -i ${SSH_KEY} ubuntu@${PROXY_ADDR}:/tmp/$service.log.bz2 ${ARTIFACTS_LOGS}
handle_error "Retrieve log file from service $service"
done

# Clean resources
docker-compose -f docker-compose/docker-compose-full-test-suite.yml rm -f
handle_error "Error while tests cleanup"

# Results
echo Full test passing - ${FTS_RESULT}
Expand Down
32 changes: 0 additions & 32 deletions .buildkite/steps/full_test_suite/terraform-destroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,6 @@ handle_error() {

cd .buildkite/steps/full_test_suite


### Receive artefacts
export SSH_KEY="~/.ssh/ci-stands"
export ARTIFACTS_LOGS="./logs"
mkdir -p $ARTIFACTS_LOGS
handle_error "Failed to create artifacts dir at: '$ARTIFACTS_LOGS'"


# solana
export SOLANA_HOST=`buildkite-agent meta-data get "SOLANA_IP"`
ssh-keyscan -H $SOLANA_HOST >> ~/.ssh/known_hosts
echo "Upload logs for service: solana"
ssh -i ${SSH_KEY} ubuntu@${SOLANA_HOST} 'sudo docker logs solana 2>&1 | pbzip2 > /tmp/solana.log.bz2'
handle_error "Can't scan host for fingerprint"
scp -i ${SSH_KEY} ubuntu@${SOLANA_HOST}:/tmp/solana.log.bz2 ${ARTIFACTS_LOGS}
handle_error "Retrieve log file for atrifact"


# proxy
export PROXY_HOST=`buildkite-agent meta-data get "PROXY_IP"`
ssh-keyscan -H $PROXY_HOST >> ~/.ssh/known_hosts
declare -a services=("evm_loader" "postgres" "dbcreation" "indexer" "proxy" "faucet" "airdropper")

for service in "${services[@]}"
do
echo "Upload logs for service: $service"
ssh -i ${SSH_KEY} ubuntu@${PROXY_HOST} "sudo docker logs $service 2>&1 | pbzip2 > /tmp/$service.log.bz2"
handle_error "Dump $service log to the file"
scp -i ${SSH_KEY} ubuntu@${PROXY_HOST}:/tmp/$service.log.bz2 ${ARTIFACTS_LOGS}
handle_error "Retrieve log file from service $service"
done

export NEON_EVM_COMMIT=${NEON_EVM_COMMIT:-latest}
export PROXY_MODEL_COMMIT=${BUILDKITE_COMMIT}

Expand Down