Remove snap support
This commit is contained in:
@ -10,12 +10,6 @@ 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
|
||||
|
||||
[[ -f "$SOLANA_CONFIG_DIR"/bootstrap-leader.json ]] || {
|
||||
echo "$SOLANA_CONFIG_DIR/bootstrap-leader.json not found, create it by running:"
|
||||
echo
|
||||
@ -49,13 +43,6 @@ while [[ -n $1 ]]; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [[ -d $SNAP ]]; then
|
||||
if [[ $(snapctl get leader-rotation) = false ]]; then
|
||||
maybe_no_leader_rotation="--no-leader-rotation"
|
||||
fi
|
||||
fi
|
||||
|
||||
tune_system
|
||||
|
||||
trap 'kill "$pid" && wait "$pid"' INT TERM
|
||||
|
@ -15,36 +15,13 @@ drone_logger="tee drone.log"
|
||||
if [[ $(uname) != Linux ]]; then
|
||||
# Protect against unsupported configurations to prevent non-obvious errors
|
||||
# later. Arguably these should be fatal errors but for now prefer tolerance.
|
||||
if [[ -n $USE_SNAP ]]; then
|
||||
echo "Warning: Snap is not supported on $(uname)"
|
||||
USE_SNAP=
|
||||
fi
|
||||
if [[ -n $SOLANA_CUDA ]]; then
|
||||
echo "Warning: CUDA is not supported on $(uname)"
|
||||
SOLANA_CUDA=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -d $SNAP ]]; then # Running inside a Linux Snap?
|
||||
solana_program() {
|
||||
declare program="$1"
|
||||
printf "%s/command-%s.wrapper" "$SNAP" "$program"
|
||||
}
|
||||
rsync="$SNAP"/bin/rsync
|
||||
multilog="$SNAP/bin/multilog t s16777215 n200"
|
||||
bootstrap_leader_logger="$multilog $SNAP_DATA/bootstrap-leader"
|
||||
fullnode_logger="$multilog t $SNAP_DATA/fullnode"
|
||||
drone_logger="$multilog $SNAP_DATA/drone"
|
||||
# Create log directories manually to prevent multilog from creating them as
|
||||
# 0700
|
||||
mkdir -p "$SNAP_DATA"/{drone,bootstrap-leader,fullnode}
|
||||
|
||||
elif [[ -n $USE_SNAP ]]; then # Use the Linux Snap binaries
|
||||
solana_program() {
|
||||
declare program="$1"
|
||||
printf "solana.%s" "$program"
|
||||
}
|
||||
elif [[ -n $USE_INSTALL ]]; then # Assume |./scripts/cargo-install-all.sh| was run
|
||||
if [[ -n $USE_INSTALL ]]; then # Assume |./scripts/cargo-install-all.sh| was run
|
||||
solana_program() {
|
||||
declare program="$1"
|
||||
printf "solana-%s" "$program"
|
||||
@ -136,7 +113,7 @@ tune_system() {
|
||||
|
||||
# The directory on the bootstrap leader that is rsynced by other full nodes as
|
||||
# they boot (TODO: Eventually this should go away)
|
||||
SOLANA_RSYNC_CONFIG_DIR=${SNAP_DATA:-$PWD}/config
|
||||
SOLANA_RSYNC_CONFIG_DIR=$PWD/config
|
||||
|
||||
# Configuration that remains local
|
||||
SOLANA_CONFIG_DIR=${SNAP_DATA:-$PWD}/config-local
|
||||
SOLANA_CONFIG_DIR=$PWD/config-local
|
||||
|
@ -9,12 +9,6 @@ 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 "$*"
|
||||
@ -79,12 +73,6 @@ while [[ ${1:0:1} = - ]]; do
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -d $SNAP ]]; then
|
||||
if [[ $(snapctl get leader-rotation) = false ]]; then
|
||||
maybe_no_leader_rotation="--no-leader-rotation"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n $3 ]]; then
|
||||
usage
|
||||
fi
|
||||
@ -92,47 +80,30 @@ fi
|
||||
find_leader() {
|
||||
declare leader leader_address
|
||||
declare shift=0
|
||||
if [[ -d $SNAP ]]; then
|
||||
if [[ -n $1 ]]; then
|
||||
usage "Error: unexpected parameter: $1"
|
||||
fi
|
||||
|
||||
# Select leader from the Snap configuration
|
||||
leader_ip=$(snapctl get entrypoint-ip)
|
||||
if [[ -z $leader_ip ]]; then
|
||||
leader=testnet.solana.com
|
||||
if [[ -z $1 ]]; then
|
||||
leader=${here}/.. # Default to local tree for rsync
|
||||
leader_address=127.0.0.1:8001 # Default to local leader
|
||||
elif [[ -z $2 ]]; then
|
||||
leader=$1
|
||||
|
||||
declare leader_ip
|
||||
if [[ $leader =~ ^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
|
||||
leader_ip=$leader
|
||||
else
|
||||
leader_ip=$(dig +short "${leader%:*}" | head -n1)
|
||||
|
||||
if [[ -z $leader_ip ]]; then
|
||||
usage "Error: unable to resolve IP address for $leader"
|
||||
fi
|
||||
fi
|
||||
leader=$leader_ip
|
||||
|
||||
leader_address=$leader_ip:8001
|
||||
shift=1
|
||||
else
|
||||
if [[ -z $1 ]]; then
|
||||
leader=${here}/.. # Default to local tree for rsync
|
||||
leader_address=127.0.0.1:8001 # Default to local leader
|
||||
elif [[ -z $2 ]]; then
|
||||
leader=$1
|
||||
|
||||
declare leader_ip
|
||||
if [[ $leader =~ ^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
|
||||
leader_ip=$leader
|
||||
else
|
||||
leader_ip=$(dig +short "${leader%:*}" | head -n1)
|
||||
|
||||
if [[ -z $leader_ip ]]; then
|
||||
usage "Error: unable to resolve IP address for $leader"
|
||||
fi
|
||||
fi
|
||||
|
||||
leader_address=$leader_ip:8001
|
||||
shift=1
|
||||
else
|
||||
leader=$1
|
||||
leader_address=$2
|
||||
shift=2
|
||||
fi
|
||||
leader=$1
|
||||
leader_address=$2
|
||||
shift=2
|
||||
fi
|
||||
|
||||
echo "$leader" "$leader_address" "$shift"
|
||||
|
Reference in New Issue
Block a user