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
This commit is contained in:
Rob Walker 2018-09-04 14:31:54 +09:00 committed by GitHub
parent a99dbb2a0c
commit 61abee204f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -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); \

View File

@ -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)

View File

@ -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 "$*"