mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
switch perf-able to using same node type we use for other spot instances, because otherwise it never finds any available capacity. we switch the perf-able script to use the standard get_value function instead of direct jq calls. we try to grab server logs if the restore fails in the hopes of finding out why the restore very occasionally fails.
73 lines
3 KiB
Bash
Executable file
73 lines
3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# get the first ingest host
|
|
must_get_value ./qa/tf/perf/able/outputs.json INGESTNODE0 .ingest_ips 0 '"value"' 0
|
|
echo "using INGESTNODE0 ${INGESTNODE0}"
|
|
|
|
# get the first data host
|
|
must_get_value ./qa/tf/perf/able/outputs.json DATANODE0 .data_node_ips 0 '"value"' 0
|
|
echo "using DATANODE0 ${DATANODE0}"
|
|
must_get_value ./qa/tf/perf/able/outputs.json DEPLOYED_DATA_IPS .data_node_ips 0 '"value"' ""
|
|
|
|
# leaving this here because K6 is timing out and need to work out why
|
|
# ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "wget https://github.com/grafana/k6/releases/download/v0.36.0/k6-v0.36.0-linux-arm64.tar.gz"
|
|
# ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "tar -xvf k6-v0.36.0-linux-arm64.tar.gz"
|
|
# ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "mkdir bin"
|
|
# ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "mv ./k6-v0.36.0-linux-arm64/k6 ./bin"
|
|
|
|
echo "Copying tests to remote"
|
|
scp -r -i ~/.ssh/gitlab-featurebase-ci.pem ./qa/scripts/perf/able/*.js ec2-user@${INGESTNODE0}:/data
|
|
if (( $? != 0 ))
|
|
then
|
|
echo "Copy failed"
|
|
exit 1
|
|
fi
|
|
|
|
# copy restore data to ingest node
|
|
echo "Copying restore data from S3"
|
|
ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "aws s3 cp s3://molecula-perf-storage/able/perf-able-seg.tar.xz /data/perf-able-seg.tar.xz --no-progress"
|
|
if (( $? != 0 ))
|
|
then
|
|
echo "Copy failed"
|
|
exit 1
|
|
fi
|
|
|
|
# untar data
|
|
echo "Untarring data"
|
|
ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "cd /data; tar -xf perf-able-seg.tar.xz"
|
|
if (( $? != 0 ))
|
|
then
|
|
echo "Untarring failed"
|
|
exit 1
|
|
fi
|
|
|
|
# restore data
|
|
echo "Restoring data"
|
|
ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "cd /data; featurebase restore --host http://${DATANODE0}:10101 -s /data/data/backup > restore.out"
|
|
if (( $? != 0 ))
|
|
then
|
|
echo "restoring failed. trying to dump server logs in case server crashed:"
|
|
for i in $DEPLOYED_DATA_IPS; do
|
|
echo "BEGIN LOGS $i:"
|
|
ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${i} "cat /var/log/molecula/featurebase.log"
|
|
echo "END LOGS $i"
|
|
|
|
done
|
|
exit 1
|
|
fi
|
|
|
|
# run test
|
|
echo "Running perf test"
|
|
# leaving this here because K6 is timing out and need to work out why
|
|
#ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "/home/ec2-user/bin/k6 run -e DATANODE0=test.k6.io /data/highcardinalitygroupby.js"
|
|
ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o "StrictHostKeyChecking no" ec2-user@${INGESTNODE0} "curl ${DATANODE0}:10101/index/seg/query -X POST -o /data/response.json -d 'GroupBy(Rows(education_level), Rows(gender), Rows(domain), aggregate=Sum(field=age))'"
|
|
ABLETESTRESULT=$?
|
|
|
|
if (( $ABLETESTRESULT != 0 ))
|
|
then
|
|
echo "able perf test complete with failures"
|
|
else
|
|
echo "able test complete"
|
|
fi
|
|
|
|
exit $ABLETESTRESULT
|