2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2018-10-05 16:32:05 -07:00
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2018-11-05 13:50:33 -08:00
|
|
|
if [[ -z $USE_PREBUILT_CHANNEL_TARBALL ]]; then
|
2018-11-13 13:33:15 -08:00
|
|
|
echo --- downloading tar from build artifacts
|
|
|
|
buildkite-agent artifact download "solana*.tar.bz2" .
|
2018-11-05 13:50:33 -08:00
|
|
|
fi
|
2018-10-05 16:32:05 -07:00
|
|
|
|
|
|
|
# shellcheck disable=SC1091
|
2018-12-13 21:44:50 -08:00
|
|
|
source ci/upload-ci-artifact.sh
|
2018-10-05 16:32:05 -07:00
|
|
|
|
|
|
|
[[ -n $ITERATION_WAIT ]] || ITERATION_WAIT=300
|
|
|
|
[[ -n $NUMBER_OF_NODES ]] || NUMBER_OF_NODES="10 25 50 100"
|
2018-10-09 11:50:56 -07:00
|
|
|
[[ -n $LEADER_CPU_MACHINE_TYPE ]] ||
|
2019-04-18 15:12:35 -07:00
|
|
|
LEADER_CPU_MACHINE_TYPE="--machine-type n1-standard-16 --accelerator count=2,type=nvidia-tesla-v100"
|
2018-10-09 11:50:56 -07:00
|
|
|
[[ -n $CLIENT_COUNT ]] || CLIENT_COUNT=2
|
|
|
|
[[ -n $TESTNET_TAG ]] || TESTNET_TAG=testnet-automation
|
2019-04-15 18:56:04 -07:00
|
|
|
[[ -n $TESTNET_ZONES ]] || TESTNET_ZONES="us-west1-b"
|
2018-11-05 13:50:33 -08:00
|
|
|
[[ -n $CHANNEL ]] || CHANNEL=beta
|
2019-04-15 18:56:04 -07:00
|
|
|
[[ -n $ADDITIONAL_FLAGS ]] || ADDITIONAL_FLAGS=""
|
|
|
|
|
|
|
|
TESTNET_CLOUD_ZONES=(); while read -r -d, ; do TESTNET_CLOUD_ZONES+=( "$REPLY" ); done <<< "${TESTNET_ZONES},"
|
2018-10-05 16:32:05 -07:00
|
|
|
|
|
|
|
launchTestnet() {
|
|
|
|
declare nodeCount=$1
|
|
|
|
echo --- setup "$nodeCount" node test
|
2019-04-15 18:56:04 -07:00
|
|
|
|
|
|
|
# shellcheck disable=SC2068
|
2018-10-05 16:32:05 -07:00
|
|
|
net/gce.sh create \
|
2018-12-20 20:13:56 -08:00
|
|
|
-d pd-ssd \
|
2018-10-09 11:50:56 -07:00
|
|
|
-n "$nodeCount" -c "$CLIENT_COUNT" \
|
|
|
|
-G "$LEADER_CPU_MACHINE_TYPE" \
|
2019-04-15 18:56:04 -07:00
|
|
|
-p "$TESTNET_TAG" ${TESTNET_CLOUD_ZONES[@]/#/-z } "$ADDITIONAL_FLAGS"
|
2018-10-05 16:32:05 -07:00
|
|
|
|
|
|
|
echo --- configure database
|
|
|
|
net/init-metrics.sh -e
|
|
|
|
|
|
|
|
echo --- start "$nodeCount" node test
|
2018-11-05 13:50:33 -08:00
|
|
|
if [[ -n $USE_PREBUILT_CHANNEL_TARBALL ]]; then
|
2018-12-21 04:27:31 -08:00
|
|
|
net/net.sh start -f "cuda" -o noValidatorSanity -t "$CHANNEL"
|
2018-11-05 13:50:33 -08:00
|
|
|
else
|
2018-12-21 04:27:31 -08:00
|
|
|
net/net.sh start -f "cuda" -o noValidatorSanity -T solana*.tar.bz2
|
2018-11-05 13:50:33 -08:00
|
|
|
fi
|
2018-10-05 16:32:05 -07:00
|
|
|
|
|
|
|
echo --- wait "$ITERATION_WAIT" seconds to complete test
|
|
|
|
sleep "$ITERATION_WAIT"
|
|
|
|
|
2019-04-15 18:56:04 -07:00
|
|
|
set -x
|
|
|
|
|
2018-10-05 16:32:05 -07:00
|
|
|
declare q_mean_tps='
|
2018-10-09 10:35:01 -07:00
|
|
|
SELECT round(mean("sum_count")) AS "mean_tps" FROM (
|
2018-10-05 16:32:05 -07:00
|
|
|
SELECT sum("count") AS "sum_count"
|
2019-04-17 15:37:01 -07:00
|
|
|
FROM "testnet-automation"."autogen"."counter-banking_stage-process_transactions"
|
2018-10-05 16:32:05 -07:00
|
|
|
WHERE time > now() - 300s GROUP BY time(1s)
|
|
|
|
)'
|
|
|
|
|
|
|
|
declare q_max_tps='
|
2018-10-09 10:35:01 -07:00
|
|
|
SELECT round(max("sum_count")) AS "max_tps" FROM (
|
2018-10-05 16:32:05 -07:00
|
|
|
SELECT sum("count") AS "sum_count"
|
2019-04-17 15:37:01 -07:00
|
|
|
FROM "testnet-automation"."autogen"."counter-banking_stage-process_transactions"
|
2018-10-05 16:32:05 -07:00
|
|
|
WHERE time > now() - 300s GROUP BY time(1s)
|
|
|
|
)'
|
|
|
|
|
2018-12-20 15:47:48 -08:00
|
|
|
declare q_mean_confirmation='
|
|
|
|
SELECT round(mean("duration_ms")) as "mean_confirmation"
|
2019-04-15 18:56:04 -07:00
|
|
|
FROM "testnet-automation"."autogen"."validator-confirmation"
|
2018-10-05 16:32:05 -07:00
|
|
|
WHERE time > now() - 300s'
|
|
|
|
|
2018-12-20 15:47:48 -08:00
|
|
|
declare q_max_confirmation='
|
|
|
|
SELECT round(max("duration_ms")) as "max_confirmation"
|
2019-04-15 18:56:04 -07:00
|
|
|
FROM "testnet-automation"."autogen"."validator-confirmation"
|
2018-10-05 16:32:05 -07:00
|
|
|
WHERE time > now() - 300s'
|
|
|
|
|
2018-12-20 15:47:48 -08:00
|
|
|
declare q_99th_confirmation='
|
|
|
|
SELECT round(percentile("duration_ms", 99)) as "99th_confirmation"
|
2019-04-15 18:56:04 -07:00
|
|
|
FROM "testnet-automation"."autogen"."validator-confirmation"
|
2018-10-05 16:32:05 -07:00
|
|
|
WHERE time > now() - 300s'
|
|
|
|
|
2019-04-15 18:56:04 -07:00
|
|
|
curl -G "${INFLUX_HOST}/query?u=ro&p=topsecret" \
|
|
|
|
--data-urlencode "db=testnet-automation" \
|
2018-12-20 15:47:48 -08:00
|
|
|
--data-urlencode "q=$q_mean_tps;$q_max_tps;$q_mean_confirmation;$q_max_confirmation;$q_99th_confirmation" |
|
2018-10-09 10:35:01 -07:00
|
|
|
python ci/testnet-automation-json-parser.py >>TPS"$nodeCount".log
|
2018-10-05 16:32:05 -07:00
|
|
|
|
2018-12-13 21:44:50 -08:00
|
|
|
upload-ci-artifact TPS"$nodeCount".log
|
2018-10-05 16:32:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# This is needed, because buildkite doesn't let us define an array of numbers.
|
|
|
|
# The array is defined as a space separated string of numbers
|
|
|
|
# shellcheck disable=SC2206
|
|
|
|
nodes_count_array=($NUMBER_OF_NODES)
|
|
|
|
|
|
|
|
for n in "${nodes_count_array[@]}"; do
|
|
|
|
launchTestnet "$n"
|
|
|
|
done
|