From db825788fa55c86fe15078c0e1067a585967b64f Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 7 Sep 2018 12:48:06 -0700 Subject: [PATCH] Document how to get ssh access into CD testnets --- net/README.md | 8 ++++++++ net/net.sh | 13 +++++++++++-- net/ssh.sh | 11 ++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/net/README.md b/net/README.md index 93c37a33cf..ddeebb21d6 100644 --- a/net/README.md +++ b/net/README.md @@ -56,3 +56,11 @@ ensure the `cuda` feature is specified at network start: $ ./net.sh start -f "cuda,erasure" ``` +### How to interact with a CD testnet deployed by ci/testnet-deploy.sh + +Taking **master-testnet-solana-com** as an example, configure your workspace for +the testnet using: +``` +$ ./gce.sh config -p master-testnet-solana-com +$ ./ssh.sh # <-- Details on how to ssh into any testnet node +``` diff --git a/net/net.sh b/net/net.sh index 3d733e424d..979bb7048e 100755 --- a/net/net.sh +++ b/net/net.sh @@ -116,7 +116,16 @@ build() { startCommon() { declare ipAddress=$1 test -d "$SOLANA_ROOT" - ssh "${sshOptions[@]}" "$ipAddress" "mkdir -p ~/solana ~/.cargo/bin" + ssh "${sshOptions[@]}" "$ipAddress" " + mkdir -p ~/solana ~/.cargo/bin + + # Help other users of the machine locate network logs + [[ -d /tmp/solana/ ]] || { + mkdir /tmp/solana/ + chmod go+w /tmp/solana/ + } + ln -sfT ~/solana /tmp/solana/= + " rsync -vPrc -e "ssh ${sshOptions[*]}" \ "$SOLANA_ROOT"/{fetch-perf-libs.sh,scripts,net,multinode-demo} \ "$ipAddress":~/solana/ @@ -290,7 +299,7 @@ start() { echo "Leader deployment took $leaderDeployTime seconds" echo "Validator deployment (${#validatorIpList[@]} instances) took $validatorDeployTime seconds" echo "Client deployment (${#clientIpList[@]} instances) took $clientDeployTime seconds" - echo "Logs in $netLogDir:" + echo "Network start logs in $netLogDir:" ls -l "$netLogDir" } diff --git a/net/ssh.sh b/net/ssh.sh index b4c9ac24e4..c9935a78ef 100755 --- a/net/ssh.sh +++ b/net/ssh.sh @@ -43,13 +43,18 @@ if [[ -n "$ipAddress" ]]; then exec ssh "${sshOptions[@]}" "$ipAddress" "$@" fi +printNode() { + declare nodeType=$1 + declare ip=$2 + printf " %-25s | For logs run: $0 $ip tail -f /tmp/solana/=/$nodeType.log\n" "$0 $ip" +} echo Leader: -echo -e " $0 $leaderIp\t| $0 $leaderIp tail -f solana/leader.log" +printNode leader "$leaderIp" echo echo Validators: for ipAddress in "${validatorIpList[@]}"; do - echo -e " $0 $ipAddress\t| $0 $ipAddress tail -f solana/validator.log" + printNode validator "$ipAddress" done echo echo Clients: @@ -57,7 +62,7 @@ if [[ ${#clientIpList[@]} -eq 0 ]]; then echo " None" else for ipAddress in "${clientIpList[@]}"; do - echo -e " $0 $ipAddress\t| $0 $ipAddress tail -f solana/client.log" + printNode client "$ipAddress" done fi