2018-08-28 10:19:33 -07:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2018-09-04 09:21:03 -07:00
|
|
|
cd "$(dirname "$0")"/../..
|
|
|
|
|
2018-09-03 18:15:55 -10:00
|
|
|
deployMethod="$1"
|
2018-09-04 09:21:03 -07:00
|
|
|
leaderIp="$2"
|
2018-09-03 18:15:55 -10:00
|
|
|
numNodes="$3"
|
|
|
|
RUST_LOG="$4"
|
|
|
|
[[ -n $deployMethod ]] || exit
|
2018-09-04 09:21:03 -07:00
|
|
|
[[ -n $leaderIp ]] || exit
|
2018-09-03 18:15:55 -10:00
|
|
|
[[ -n $numNodes ]] || exit
|
2018-08-28 10:19:33 -07:00
|
|
|
|
|
|
|
source net/common.sh
|
|
|
|
loadConfigFile
|
|
|
|
|
2018-09-03 18:15:55 -10:00
|
|
|
threadCount=$(nproc)
|
|
|
|
if [[ $threadCount -gt 4 ]]; then
|
|
|
|
threadCount=4
|
|
|
|
fi
|
2018-08-28 10:19:33 -07:00
|
|
|
|
2018-09-04 09:21:03 -07:00
|
|
|
scripts/install-earlyoom.sh
|
2018-09-03 18:15:55 -10:00
|
|
|
|
|
|
|
case $deployMethod in
|
|
|
|
snap)
|
2018-09-04 09:21:03 -07:00
|
|
|
rsync -vPr "$leaderIp:~/solana/solana.snap" .
|
2018-09-03 18:15:55 -10:00
|
|
|
sudo snap install solana.snap --devmode --dangerous
|
|
|
|
rm solana.snap
|
|
|
|
|
2018-09-04 09:21:03 -07:00
|
|
|
sudo snap set solana "\
|
|
|
|
leader-ip=$leaderIp \
|
|
|
|
metrics-config=$SOLANA_METRICS_CONFIG \
|
|
|
|
rust-log=$RUST_LOG \
|
|
|
|
"
|
2018-09-03 18:15:55 -10:00
|
|
|
solana_bench_tps=/snap/bin/solana.bench-tps
|
|
|
|
;;
|
|
|
|
local)
|
|
|
|
PATH="$HOME"/.cargo/bin:"$PATH"
|
|
|
|
export USE_INSTALL=1
|
|
|
|
export RUST_LOG
|
|
|
|
|
2018-09-04 09:21:03 -07:00
|
|
|
rsync -vPr "$leaderIp:~/.cargo/bin/solana*" ~/.cargo/bin/
|
|
|
|
solana_bench_tps="multinode-demo/client.sh $leaderIp:~/solana"
|
2018-09-03 18:15:55 -10:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown deployment method: $deployMethod"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
2018-09-04 09:21:03 -07:00
|
|
|
scripts/oom-monitor.sh > oom-monitor.log 2>&1 &
|
2018-08-29 07:48:38 -07:00
|
|
|
|
2018-09-03 18:15:55 -10:00
|
|
|
while true; do
|
|
|
|
echo "=== Client start: $(date)" >> client.log
|
2018-09-04 09:21:03 -07:00
|
|
|
clientCommand="$solana_bench_tps --num-nodes $numNodes --loop -s 600 --sustained -t threadCount"
|
2018-09-03 18:15:55 -10:00
|
|
|
echo "$ $clientCommand" >> client.log
|
|
|
|
|
|
|
|
$clientCommand >> client.log 2>&1
|
|
|
|
|
|
|
|
$metricsWriteDatapoint "testnet-deploy,name=$netBasename clientexit=1"
|
|
|
|
echo Error: bench-tps should never exit | tee -a client.log
|
|
|
|
done
|
|
|
|
|