From 61abee204f8e6cee327b3d2afe91a6bb3b899aa7 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Tue, 4 Sep 2018 14:31:54 +0900 Subject: [PATCH] don't check for snap mode in common.sh, is only relevant to snap daemons (#1113) snap mode is for daemons, remove it from client (i.e. common.sh) supply leader info to client via snap --- ci/testnet-deploy.sh | 9 +++++++++ multinode-demo/common.sh | 3 --- multinode-demo/validator.sh | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ci/testnet-deploy.sh b/ci/testnet-deploy.sh index 68870a302a..62ead0b166 100755 --- a/ci/testnet-deploy.sh +++ b/ci/testnet-deploy.sh @@ -264,10 +264,19 @@ client_start() { declare vmPublicIp=$3 declare count=$4 + nodeConfig="\ + rust-log=$RUST_LOG \ + default-metrics-rate=$SOLANA_DEFAULT_METRICS_RATE \ + metrics-config=$SOLANA_METRICS_CONFIG \ + setup-args=$SOLANA_SETUP_ARGS \ + leader-ip=$publicIp \ + " + vm_exec "$vmName" "$vmZone" "$vmPublicIp" \ "Starting client $count:" \ "\ set -x; + sudo snap set solana $nodeConfig; \ snap info solana; \ sudo snap get solana; \ threadCount=\$(nproc); \ diff --git a/multinode-demo/common.sh b/multinode-demo/common.sh index bf2529bbc8..3e141332f9 100644 --- a/multinode-demo/common.sh +++ b/multinode-demo/common.sh @@ -166,9 +166,6 @@ find_leader() { declare shift=0 if [[ -d $SNAP ]]; then - # Exit if mode is not yet configured - # (typically the case after the Snap is first installed) - [[ -n $(snapctl get mode) ]] || exit 0 # Select leader from the Snap configuration leader_ip=$(snapctl get leader-ip) diff --git a/multinode-demo/validator.sh b/multinode-demo/validator.sh index 999c10f365..e041022612 100755 --- a/multinode-demo/validator.sh +++ b/multinode-demo/validator.sh @@ -9,6 +9,12 @@ source "$here"/common.sh # shellcheck source=scripts/oom-score-adj.sh source "$here"/../scripts/oom-score-adj.sh +if [[ -d "$SNAP" ]]; then + # Exit if mode is not yet configured + # (typically the case after the Snap is first installed) + [[ -n "$(snapctl get mode)" ]] || exit 0 +fi + usage() { if [[ -n $1 ]]; then echo "$*"