Remove snap support

This commit is contained in:
Michael Vines 2019-03-02 17:08:46 -08:00
parent 9c3e7e40cf
commit cd4bccfd12
25 changed files with 30 additions and 666 deletions

View File

@ -110,10 +110,7 @@ We maintain several testnets:
They are deployed with the `ci/testnet-manager.sh` script through a list of [scheduled They are deployed with the `ci/testnet-manager.sh` script through a list of [scheduled
buildkite jobs](https://buildkite.com/solana-labs/testnet-management/settings/schedules). buildkite jobs](https://buildkite.com/solana-labs/testnet-management/settings/schedules).
Each testnet can be manually manipulated from buildkite as well. The `-perf` Each testnet can be manually manipulated from buildkite as well.
testnets use a release tarball while the non`-perf` builds use the snap build
(we've observed that the snap build runs slower than a tarball but this has yet
to be root caused).
## How do I reset the testnet? ## How do I reset the testnet?
Manually trigger the [testnet-management](https://buildkite.com/solana-labs/testnet-management) pipeline Manually trigger the [testnet-management](https://buildkite.com/solana-labs/testnet-management) pipeline

View File

@ -43,8 +43,7 @@ the `master` branch as late as possible prior to the milestone release.
### v*X.Y.Z* release tag ### v*X.Y.Z* release tag
The release tags are created as desired by the owner of the given stabilization The release tags are created as desired by the owner of the given stabilization
branch, and cause that *X.Y.Z* release to be shipped to https://crates.io, branch, and cause that *X.Y.Z* release to be shipped to https://crates.io
https://snapcraft.io/, and elsewhere.
Immediately after a new v*X.Y.Z* branch tag has been created, the `Cargo.toml` Immediately after a new v*X.Y.Z* branch tag has been created, the `Cargo.toml`
patch version number (*Z*) of the stabilization branch is incremented by the patch version number (*Z*) of the stabilization branch is incremented by the

View File

@ -166,95 +166,3 @@ $ ./multinode-demo/client.sh --network $(dig +short testnet.solana.com):8001 --d
You can observe the effects of your client's transactions on our [dashboard](https://metrics.solana.com:3000/d/testnet/testnet-hud?orgId=2&from=now-30m&to=now&refresh=5s&var-testnet=testnet) You can observe the effects of your client's transactions on our [dashboard](https://metrics.solana.com:3000/d/testnet/testnet-hud?orgId=2&from=now-30m&to=now&refresh=5s&var-testnet=testnet)
## Linux Snap
A Linux [Snap](https://snapcraft.io/) is available, which can be used to easily
get Solana running on supported Linux systems without building anything from
source for evaluation. Note that CUDA is not supported by the Snap so
performance will be limited.
The `edge` Snap channel is updated daily with the latest
development from the `master` branch. To install:
```bash
$ sudo snap install solana --edge --devmode
```
Once installed the usual Solana programs will be available as `solona.*` instead
of `solana-*`. For example, `solana.fullnode` instead of `solana-fullnode`.
Update to the latest version at any time with:
```bash
$ snap info solana
$ sudo snap refresh solana --devmode
```
### Daemon Support
The snap supports running fullnodes and a drone as system daemons.
Run `sudo snap get solana` to view the current daemon configuration. To view
daemon logs:
1. Run `sudo snap logs -n=all solana` to view the daemon initialization log
2. Runtime logging can be found under `/var/snap/solana/current/bootstrap-leader/`,
`/var/snap/solana/current/fullnode/`, or `/var/snap/solana/current/drone/` depending
on which `mode=` was selected. Within each log directory the file `current`
contains the latest log, and the files `*.s` (if present) contain older rotated
logs.
Disable the daemon at any time by running:
```bash
$ sudo snap set solana mode=
```
Runtime configuration files for the daemon can be found in
`/var/snap/solana/current/config`.
#### Leader Daemon
```bash
$ sudo snap set solana mode=bootstrap-leader
```
`rsync` must be configured and running on the leader.
1. Ensure rsync is installed with `sudo apt-get -y install rsync`
2. Edit `/etc/rsyncd.conf` to include the following
```ini
[config]
path = /var/snap/solana/current/config
hosts allow = *
read only = true
```
3. Run `sudo systemctl enable rsync; sudo systemctl start rsync`
4. Test by running `rsync -Pzravv rsync://<ip-address-of-leader>/config
solana-config` from another machine. **If the leader is running on a cloud
provider it may be necessary to configure the Firewall rules to permit ingress
to port tcp:873, tcp:9900 and the port range udp:8000-udp:10000**
To run both the Leader and Drone:
```bash
$ sudo snap set solana mode=bootstrap-leader+drone
```
#### Validator daemon
```bash
$ sudo snap set solana mode=fullnode
```
By default the node will attempt to connect to **testnet.solana.com**, override the
cluster entrypoint IP address by running:
```bash
$ sudo snap set solana mode=fullnode entrypoint-ip=127.0.0.1 #<-- change IP address
```
It's assumed that the node at the entrypoint IP will be running `rsync`
configured as described in the previous **Leader daemon** section.

View File

@ -1,7 +1,4 @@
steps: steps:
#- command: "ci/publish-snap.sh"
# timeout_in_minutes: 40
# name: "publish snap"
- command: "sdk/docker-solana/build.sh" - command: "sdk/docker-solana/build.sh"
timeout_in_minutes: 20 timeout_in_minutes: 20
name: "publish docker" name: "publish docker"

View File

@ -26,10 +26,6 @@ steps:
# timeout_in_minutes: 20 # timeout_in_minutes: 20
# agents: # agents:
# - "queue=large" # - "queue=large"
- command: "ci/pr-snap.sh"
timeout_in_minutes: 20
name: "snap"
branches: "pull/*"
- wait - wait
- trigger: "solana-secondary" - trigger: "solana-secondary"
branches: "!pull/*" branches: "!pull/*"

View File

@ -71,7 +71,6 @@ ARGS+=(
--env CI --env CI
--env CODECOV_TOKEN --env CODECOV_TOKEN
--env CRATES_IO_TOKEN --env CRATES_IO_TOKEN
--env SNAPCRAFT_CREDENTIALS_KEY
) )
if $INTERACTIVE; then if $INTERACTIVE; then

View File

@ -1,7 +0,0 @@
FROM snapcraft/xenial-amd64
# Update snapcraft to latest version
RUN apt-get update -qq \
&& apt-get install -y snapcraft daemontools \
&& rm -rf /var/lib/apt/lists/* \
&& snapcraft --version

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -ex
cd "$(dirname "$0")"
docker build -t solanalabs/snapcraft .
docker push solanalabs/snapcraft

View File

@ -1,13 +0,0 @@
#!/usr/bin/env bash
#
# Only run publish-snap.sh for pull requests that modify files under /snap
#
set -e
cd "$(dirname "$0")"/..
ci/affects-files.sh ^snap/ || {
echo "Skipping snap build as no files under /snap were modified"
exit 0
}
exec ci/publish-snap.sh

View File

@ -1,65 +0,0 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/.."
# This job doesn't run within a container, try once to upgrade tooling on a
# version check failure
ci/version-check-with-upgrade.sh stable
DRYRUN=
if [[ -z $BUILDKITE_BRANCH ]]; then
DRYRUN="echo"
fi
if ./ci/is-pr.sh; then
DRYRUN="echo"
CHANNEL="none (pullrequest)"
fi
eval "$(ci/channel-info.sh)"
if [[ -z $CHANNEL ]]; then
echo Unable to determine channel to publish into, exiting.
exit 1
fi
if [[ -z $DRYRUN ]]; then
[[ -n $SNAPCRAFT_CREDENTIALS_KEY ]] || {
echo SNAPCRAFT_CREDENTIALS_KEY not defined
exit 1;
}
(
openssl aes-256-cbc -d \
-in ci/snapcraft.credentials.enc \
-out ci/snapcraft.credentials \
-k "$SNAPCRAFT_CREDENTIALS_KEY"
snapcraft login --with ci/snapcraft.credentials
) || {
rm -f ci/snapcraft.credentials;
exit 1
}
fi
set -x
echo --- checking for multilog
if [[ ! -x /usr/bin/multilog ]]; then
if [[ -z $CI ]]; then
echo "multilog not found, install with: sudo apt-get install -y daemontools"
exit 1
fi
sudo apt-get install -y daemontools
fi
echo "--- build: $CHANNEL channel"
snapcraft
source ci/upload-ci-artifact.sh
upload-ci-artifact solana_*.snap
if [[ -z $DO_NOT_PUBLISH_SNAP ]]; then
echo "--- publish: $CHANNEL channel"
$DRYRUN snapcraft push solana_*.snap --release "$CHANNEL"
fi

Binary file not shown.

View File

@ -11,13 +11,11 @@ clientNodeCount=0
additionalFullNodeCount=10 additionalFullNodeCount=10
publicNetwork=false publicNetwork=false
skipSetup=false skipSetup=false
snapChannel=edge
tarChannelOrTag=edge tarChannelOrTag=edge
delete=false delete=false
enableGpu=false enableGpu=false
bootDiskType="" bootDiskType=""
leaderRotation=true leaderRotation=true
useTarReleaseChannel=false
blockstreamer=false blockstreamer=false
usage() { usage() {
@ -36,8 +34,6 @@ Deploys a CD testnet
zone - cloud provider zone to deploy the network into zone - cloud provider zone to deploy the network into
options: options:
-s edge|beta|stable - Deploy the specified Snap release channel
(default: $snapChannel)
-t edge|beta|stable|vX.Y.Z - Deploy the latest tarball release for the -t edge|beta|stable|vX.Y.Z - Deploy the latest tarball release for the
specified release channel (edge|beta|stable) or release tag specified release channel (edge|beta|stable) or release tag
(vX.Y.Z) (vX.Y.Z)
@ -69,7 +65,7 @@ zone=$3
[[ -n $zone ]] || usage "Zone not specified" [[ -n $zone ]] || usage "Zone not specified"
shift 3 shift 3
while getopts "h?p:Pn:c:s:t:gG:a:Dbd:ru" opt; do while getopts "h?p:Pn:c:t:gG:a:Dbd:ru" opt; do
case $opt in case $opt in
h | \?) h | \?)
usage usage
@ -83,21 +79,10 @@ while getopts "h?p:Pn:c:s:t:gG:a:Dbd:ru" opt; do
c) c)
clientNodeCount=$OPTARG clientNodeCount=$OPTARG
;; ;;
s)
case $OPTARG in
edge|beta|stable)
snapChannel=$OPTARG
;;
*)
usage "Invalid snap channel: $OPTARG"
;;
esac
;;
t) t)
case $OPTARG in case $OPTARG in
edge|beta|stable|v*) edge|beta|stable|v*)
tarChannelOrTag=$OPTARG tarChannelOrTag=$OPTARG
useTarReleaseChannel=true
;; ;;
*) *)
usage "Invalid release channel: $OPTARG" usage "Invalid release channel: $OPTARG"
@ -242,14 +227,8 @@ ok=true
op=start op=start
fi fi
if $useTarReleaseChannel; then
deploySource="-t $tarChannelOrTag"
else
deploySource="-s $snapChannel"
fi
# shellcheck disable=SC2086 # Don't want to double quote maybeRejectExtraNodes # shellcheck disable=SC2086 # Don't want to double quote maybeRejectExtraNodes
time net/net.sh $op $deploySource \ time net/net.sh $op -t "$tarChannelOrTag" \
$maybeSkipSetup $maybeRejectExtraNodes $maybeNoValidatorSanity $maybeNoLedgerVerify $maybeSkipSetup $maybeRejectExtraNodes $maybeNoValidatorSanity $maybeNoLedgerVerify
) || ok=false ) || ok=false

View File

@ -239,7 +239,7 @@ start() {
${maybeReuseLedger:+-r} \ ${maybeReuseLedger:+-r} \
${maybeDelete:+-D} ${maybeDelete:+-D}
#ci/testnet-deploy.sh testnet-solana-com gce us-east1-c \ #ci/testnet-deploy.sh testnet-solana-com gce us-east1-c \
# -s "$CHANNEL_OR_TAG" -n 3 -c 0 -P -a testnet-solana-com \ # -t "$CHANNEL_OR_TAG" -n 3 -c 0 -P -a testnet-solana-com \
# ${maybeReuseLedger:+-r} \ # ${maybeReuseLedger:+-r} \
# ${maybeDelete:+-D} # ${maybeDelete:+-D}
) )

View File

@ -10,12 +10,6 @@ source "$here"/common.sh
# shellcheck source=scripts/oom-score-adj.sh # shellcheck source=scripts/oom-score-adj.sh
source "$here"/../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 ]] || { [[ -f "$SOLANA_CONFIG_DIR"/bootstrap-leader.json ]] || {
echo "$SOLANA_CONFIG_DIR/bootstrap-leader.json not found, create it by running:" echo "$SOLANA_CONFIG_DIR/bootstrap-leader.json not found, create it by running:"
echo echo
@ -49,13 +43,6 @@ while [[ -n $1 ]]; do
fi fi
done done
if [[ -d $SNAP ]]; then
if [[ $(snapctl get leader-rotation) = false ]]; then
maybe_no_leader_rotation="--no-leader-rotation"
fi
fi
tune_system tune_system
trap 'kill "$pid" && wait "$pid"' INT TERM trap 'kill "$pid" && wait "$pid"' INT TERM

View File

@ -15,36 +15,13 @@ drone_logger="tee drone.log"
if [[ $(uname) != Linux ]]; then if [[ $(uname) != Linux ]]; then
# Protect against unsupported configurations to prevent non-obvious errors # Protect against unsupported configurations to prevent non-obvious errors
# later. Arguably these should be fatal errors but for now prefer tolerance. # 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 if [[ -n $SOLANA_CUDA ]]; then
echo "Warning: CUDA is not supported on $(uname)" echo "Warning: CUDA is not supported on $(uname)"
SOLANA_CUDA= SOLANA_CUDA=
fi fi
fi fi
if [[ -d $SNAP ]]; then # Running inside a Linux Snap? if [[ -n $USE_INSTALL ]]; then # Assume |./scripts/cargo-install-all.sh| was run
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
solana_program() { solana_program() {
declare program="$1" declare program="$1"
printf "solana-%s" "$program" printf "solana-%s" "$program"
@ -136,7 +113,7 @@ tune_system() {
# The directory on the bootstrap leader that is rsynced by other full nodes as # The directory on the bootstrap leader that is rsynced by other full nodes as
# they boot (TODO: Eventually this should go away) # 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 # Configuration that remains local
SOLANA_CONFIG_DIR=${SNAP_DATA:-$PWD}/config-local SOLANA_CONFIG_DIR=$PWD/config-local

View File

@ -9,12 +9,6 @@ source "$here"/common.sh
# shellcheck source=scripts/oom-score-adj.sh # shellcheck source=scripts/oom-score-adj.sh
source "$here"/../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() { usage() {
if [[ -n $1 ]]; then if [[ -n $1 ]]; then
echo "$*" echo "$*"
@ -79,12 +73,6 @@ while [[ ${1:0:1} = - ]]; do
fi fi
done 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 if [[ -n $3 ]]; then
usage usage
fi fi
@ -92,47 +80,30 @@ fi
find_leader() { find_leader() {
declare leader leader_address declare leader leader_address
declare shift=0 declare shift=0
if [[ -d $SNAP ]]; then
if [[ -n $1 ]]; then
usage "Error: unexpected parameter: $1"
fi
# Select leader from the Snap configuration if [[ -z $1 ]]; then
leader_ip=$(snapctl get entrypoint-ip) leader=${here}/.. # Default to local tree for rsync
if [[ -z $leader_ip ]]; then leader_address=127.0.0.1:8001 # Default to local leader
leader=testnet.solana.com 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) leader_ip=$(dig +short "${leader%:*}" | head -n1)
if [[ -z $leader_ip ]]; then if [[ -z $leader_ip ]]; then
usage "Error: unable to resolve IP address for $leader" usage "Error: unable to resolve IP address for $leader"
fi fi
fi fi
leader=$leader_ip
leader_address=$leader_ip:8001 leader_address=$leader_ip:8001
shift=1
else else
if [[ -z $1 ]]; then leader=$1
leader=${here}/.. # Default to local tree for rsync leader_address=$2
leader_address=127.0.0.1:8001 # Default to local leader shift=2
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
fi fi
echo "$leader" "$leader_address" "$shift" echo "$leader" "$leader_address" "$shift"

View File

@ -52,12 +52,12 @@ or
$ ./ec2.sh create -P ... $ ./ec2.sh create -P ...
``` ```
### Deploying a Snap-based network ### Deploying a tarball-based network
To deploy the latest pre-built `edge` channel Snap (ie, latest from the `master` To deploy the latest pre-built `edge` channel tarball (ie, latest from the `master`
branch), once the testnet has been created run: branch), once the testnet has been created run:
```bash ```bash
$ ./net.sh start -s edge $ ./net.sh start -t edge
``` ```
### Enabling CUDA ### Enabling CUDA
@ -70,7 +70,7 @@ or
$ ./ec2.sh create -g ... $ ./ec2.sh create -g ...
``` ```
If deploying a Snap-based network nothing further is required, as GPU presence If deploying a tarball-based network nothing further is required, as GPU presence
is detected at runtime and the CUDA build is auto selected. is detected at runtime and the CUDA build is auto selected.
If deploying a locally-built network, first run `./fetch-perf-libs.sh` then If deploying a locally-built network, first run `./fetch-perf-libs.sh` then

View File

@ -26,8 +26,6 @@ Operate a configured testnet
logs - Fetch remote logs from each network node logs - Fetch remote logs from each network node
start/update-specific options: start/update-specific options:
-S [snapFilename] - Deploy the specified Snap file
-s edge|beta|stable - Deploy the latest Snap on the specified Snap release channel
-T [tarFilename] - Deploy the specified release tarball -T [tarFilename] - Deploy the specified release tarball
-t edge|beta|stable|vX.Y.Z - Deploy the latest tarball release for the -t edge|beta|stable|vX.Y.Z - Deploy the latest tarball release for the
specified release channel (edge|beta|stable) or release tag specified release channel (edge|beta|stable) or release tag
@ -55,9 +53,7 @@ EOF
exit $exitcode exit $exitcode
} }
snapChannel=
releaseChannel= releaseChannel=
snapFilename=
deployMethod=local deployMethod=local
sanityExtraArgs= sanityExtraArgs=
cargoFeatures= cargoFeatures=
@ -69,30 +65,14 @@ command=$1
[[ -n $command ]] || usage [[ -n $command ]] || usage
shift shift
while getopts "h?S:s:T:t:o:f:r:D:" opt; do while getopts "h?T:t:o:f:r:D:" opt; do
case $opt in case $opt in
h | \?) h | \?)
usage usage
;; ;;
S)
snapFilename=$OPTARG
[[ -f $snapFilename ]] || usage "Snap not readable: $snapFilename"
deployMethod=snap
;;
s)
case $OPTARG in
edge|beta|stable)
snapChannel=$OPTARG
deployMethod=snap
;;
*)
usage "Invalid snap channel: $OPTARG"
;;
esac
;;
T) T)
tarballFilename=$OPTARG tarballFilename=$OPTARG
[[ -f $tarballFilename ]] || usage "Snap not readable: $tarballFilename" [[ -r $tarballFilename ]] || usage "File not readable: $tarballFilename"
deployMethod=tar deployMethod=tar
;; ;;
t) t)
@ -199,9 +179,6 @@ startBootstrapLeader() {
set -x set -x
startCommon "$ipAddress" || exit 1 startCommon "$ipAddress" || exit 1
case $deployMethod in case $deployMethod in
snap)
rsync -vPrc -e "ssh ${sshOptions[*]}" "$snapFilename" "$ipAddress:~/solana/solana.snap"
;;
tar) tar)
rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/solana-release/bin/* "$ipAddress:~/.cargo/bin/" rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/solana-release/bin/* "$ipAddress:~/.cargo/bin/"
;; ;;
@ -295,36 +272,6 @@ sanity() {
start() { start() {
case $deployMethod in case $deployMethod in
snap)
if [[ -n $snapChannel ]]; then
rm -f "$SOLANA_ROOT"/solana_*.snap
if [[ $(uname) != Linux ]]; then
(
set -x
SOLANA_DOCKER_RUN_NOSETUID=1 "$SOLANA_ROOT"/ci/docker-run.sh ubuntu:18.04 bash -c "
set -ex;
apt-get -qq update;
apt-get -qq -y install snapd;
until snap download --channel=$snapChannel solana; do
sleep 1;
done
"
)
else
(
cd "$SOLANA_ROOT"
until snap download --channel="$snapChannel" solana; do
sleep 1
done
)
fi
snapFilename="$(echo "$SOLANA_ROOT"/solana_*.snap)"
[[ -r $snapFilename ]] || {
echo "Error: Snap not readable: $snapFilename"
exit 1
}
fi
;;
tar) tar)
if [[ -n $releaseChannel ]]; then if [[ -n $releaseChannel ]]; then
rm -f "$SOLANA_ROOT"/solana-release.tar.bz2 rm -f "$SOLANA_ROOT"/solana-release.tar.bz2
@ -421,13 +368,6 @@ start() {
declare networkVersion=unknown declare networkVersion=unknown
case $deployMethod in case $deployMethod in
snap)
IFS=\ read -r _ networkVersion _ < <(
ssh "${sshOptions[@]}" "${fullnodeIpList[0]}" \
"snap info solana | grep \"^installed:\""
)
networkVersion=${networkVersion/0+git./}
;;
tar) tar)
networkVersion="$( networkVersion="$(
tail -n1 "$SOLANA_ROOT"/solana-release/version.txt || echo "tar-unknown" tail -n1 "$SOLANA_ROOT"/solana-release/version.txt || echo "tar-unknown"
@ -461,9 +401,6 @@ stopNode() {
ssh "${sshOptions[@]}" "$ipAddress" " ssh "${sshOptions[@]}" "$ipAddress" "
PS4=\"$PS4\" PS4=\"$PS4\"
set -x set -x
if snap list solana; then
sudo snap set solana mode=
fi
! tmux list-sessions || tmux kill-session ! tmux list-sessions || tmux kill-session
for pid in solana/{net-stats,oom-monitor}.pid; do for pid in solana/{net-stats,oom-monitor}.pid; do
pgid=\$(ps opgid= \$(cat \$pid) | tr -d '[:space:]') pgid=\$(ps opgid= \$(cat \$pid) | tr -d '[:space:]')

View File

@ -27,12 +27,6 @@ if [[ $threadCount -gt 4 ]]; then
fi fi
case $deployMethod in case $deployMethod in
snap)
net/scripts/rsync-retry.sh -vPrc "$entrypointIp:~/solana/solana.snap" .
sudo snap install solana.snap --devmode --dangerous
solana_bench_tps=/snap/bin/solana.bench-tps
;;
local|tar) local|tar)
PATH="$HOME"/.cargo/bin:"$PATH" PATH="$HOME"/.cargo/bin:"$PATH"
export USE_INSTALL=1 export USE_INSTALL=1

View File

@ -45,88 +45,6 @@ else
fi fi
case $deployMethod in case $deployMethod in
snap)
SECONDS=0
if [[ $skipSetup = true ]]; then
for configDir in /var/snap/solana/current/config{,-local}; do
if [[ ! -d $configDir ]]; then
echo Error: not a directory: $configDir
exit 1
fi
done
(
set -x
sudo rm -rf /saved-node-config
sudo mkdir /saved-node-config
sudo mv /var/snap/solana/current/config{,-local} /saved-node-config
)
fi
[[ $nodeType = bootstrap-leader ]] ||
net/scripts/rsync-retry.sh -vPrc "$entrypointIp:~/solana/solana.snap" .
if snap list solana; then
sudo snap remove solana
fi
sudo snap install solana.snap --devmode --dangerous
if [[ $skipSetup = true ]]; then
(
set -x
sudo rm -rf /var/snap/solana/current/config{,-local}
sudo mv /saved-node-config/* /var/snap/solana/current/
sudo rm -rf /saved-node-config
)
fi
# shellcheck disable=SC2089
commonNodeConfig="\
entrypoint-ip=\"$entrypointIp\" \
metrics-config=\"$SOLANA_METRICS_CONFIG\" \
rust-log=\"$RUST_LOG\" \
setup-args=\"$setupArgs\" \
skip-setup=$skipSetup \
leader-rotation=\"$leaderRotation\" \
"
if [[ -e /dev/nvidia0 ]]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo
echo "WARNING: GPU detected by snap builds to not support CUDA."
echo " Consider using instances with a GPU to reduce cost."
echo
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
fi
case $nodeType in
bootstrap-leader)
nodeConfig="mode=bootstrap-leader+drone $commonNodeConfig"
ln -sf -T /var/snap/solana/current/bootstrap-leader/current fullnode.log
ln -sf -T /var/snap/solana/current/drone/current drone.log
;;
fullnode)
nodeConfig="mode=fullnode $commonNodeConfig"
ln -sf -T /var/snap/solana/current/fullnode/current fullnode.log
;;
*)
echo "Error: unknown node type: $nodeType"
exit 1
;;
esac
logmarker="solana deploy $(date)/$RANDOM"
logger "$logmarker"
# shellcheck disable=SC2086,SC2090 # Don't want to double quote "$nodeConfig"
sudo snap set solana $nodeConfig
snap info solana
sudo snap get solana
echo Slight delay to get more syslog output
sleep 2
sudo grep -Pzo "$logmarker(.|\\n)*" /var/log/syslog
echo "Succeeded in ${SECONDS} seconds"
;;
local|tar) local|tar)
PATH="$HOME"/.cargo/bin:"$PATH" PATH="$HOME"/.cargo/bin:"$PATH"
export USE_INSTALL=1 export USE_INSTALL=1

View File

@ -57,19 +57,6 @@ source net/common.sh
loadConfigFile loadConfigFile
case $deployMethod in case $deployMethod in
snap)
PATH="/snap/bin:$PATH"
export USE_SNAP=1
entrypointRsyncUrl="$entrypointIp"
solana_bench_tps=solana.bench-tps
solana_ledger_tool=solana.ledger-tool
solana_keygen=solana.keygen
ledger=/var/snap/solana/current/config-local/bootstrap-leader-ledger
client_id=~/snap/solana/current/config/client-id.json
;;
local|tar) local|tar)
PATH="$HOME"/.cargo/bin:"$PATH" PATH="$HOME"/.cargo/bin:"$PATH"
export USE_INSTALL=1 export USE_INSTALL=1

View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
#
# Snap daemons have no access to the environment so |snap set solana ...| is
# used to set runtime configuration.
#
# This script exports the snap runtime configuration options back as
# environment variables before invoking the specified program
#
if [[ -d $SNAP ]]; then # Running inside a Linux Snap?
RUST_LOG="$(snapctl get rust-log)"
SOLANA_METRICS_CONFIG="$(snapctl get metrics-config)"
export RUST_LOG
export SOLANA_METRICS_CONFIG
fi
exec "$@"

View File

@ -1,17 +0,0 @@
## Development
If you're running Ubuntu 16.04 and already have `snapcraft` installed, simply
run:
```
$ snapcraft
```
For other systems we provide a docker image that can be used for snap
development:
```
$ ./ci/docker-run.sh solanalabs/snapcraft snapcraft -d
```
## Reference
* https://docs.snapcraft.io/

44
snap/hooks/configure vendored
View File

@ -1,44 +0,0 @@
#!/bin/bash -e
echo Stopping daemons
snapctl stop --disable solana.daemon-drone
snapctl stop --disable solana.daemon-bootstrap-leader
snapctl stop --disable solana.daemon-fullnode
snapctl stop --disable solana.daemon-oom-monitor
snapctl stop --disable solana.daemon-net-stats
mode="$(snapctl get mode)"
if [[ -z "$mode" ]]; then
exit 0
fi
skipSetup="$(snapctl get skip-setup)"
if [[ "$skipSetup" != true ]]; then
numTokens="$(snapctl get num-tokens)"
numTokens="${numTokens:+-n $numTokens}"
setupArgs="$(snapctl get setup-args)"
"$SNAP"/multinode-demo/setup.sh $numTokens -p $setupArgs
else
echo Setup skipped
fi
case $mode in
bootstrap-leader+drone)
snapctl start --enable solana.daemon-drone
snapctl start --enable solana.daemon-bootstrap-leader
;;
bootstrap-leader)
snapctl start --enable solana.daemon-bootstrap-leader
;;
fullnode)
snapctl start --enable solana.daemon-fullnode
;;
*)
echo "Error: Unknown mode: $mode"
exit 1
;;
esac
snapctl start --enable solana.daemon-oom-monitor
snapctl start --enable solana.daemon-net-stats

View File

@ -1,111 +0,0 @@
name: solana
version: git
summary: Blockchain, Rebuilt for Scale
description: |
710,000 tx/s with off-the-shelf hardware and no sharding.
Scales with Moore's Law.
grade: devel
# TODO: solana-perf-fullnode does not yet run with 'strict' confinement due to the
# CUDA dependency, so use 'devmode' confinement for now
confinement: devmode
hooks:
configure:
plugs: [network]
apps:
drone:
command: solana-drone
plugs:
- network
- network-bind
fullnode:
command: solana-fullnode
plugs:
- network
- network-bind
- home
fullnode-config:
command: solana-fullnode-config
plugs:
- network
- network-bind
- home
genesis:
command: solana-genesis
keygen:
command: solana-keygen
plugs:
- home
ledger-tool:
command: solana-ledger-tool
plugs:
- home
bench-tps:
command: solana-bench-tps
plugs:
- network
- network-bind
- home
wallet:
command: solana-wallet
plugs:
- network
- home
daemon-fullnode:
daemon: simple
command: scripts/snap-config-to-env.sh $SNAP/multinode-demo/fullnode.sh
plugs:
- network
- network-bind
daemon-bootstrap-leader:
daemon: simple
command: scripts/snap-config-to-env.sh $SNAP/multinode-demo/bootstrap-leader.sh
plugs:
- network
- network-bind
daemon-drone:
daemon: simple
command: scripts/snap-config-to-env.sh $SNAP/multinode-demo/drone.sh
plugs:
- network
- network-bind
daemon-oom-monitor:
daemon: simple
command: scripts/snap-config-to-env.sh $SNAP/scripts/oom-monitor.sh
plugs:
- network
daemon-net-stats:
daemon: simple
command: scripts/snap-config-to-env.sh $SNAP/scripts/net-stats.sh
plugs:
- network
parts:
solana:
plugin: nil
prime:
- bin
- multinode-demo
- scripts
override-build: |
# Build/install all programs
scripts/cargo-install-all.sh $SNAPCRAFT_PART_INSTALL
# Install multinode-demo/
mkdir -p $SNAPCRAFT_PART_INSTALL/multinode-demo/
cp -av multinode-demo/* $SNAPCRAFT_PART_INSTALL/multinode-demo/
# Install scripts/
mkdir -p $SNAPCRAFT_PART_INSTALL/scripts/
cp -av scripts/* $SNAPCRAFT_PART_INSTALL/scripts/
# TODO: build curl,dig,rsync/multilog from source instead of sneaking it
# in from the host system...
set -x
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cp -av /usr/bin/curl $SNAPCRAFT_PART_INSTALL/bin/
cp -av /usr/bin/dig $SNAPCRAFT_PART_INSTALL/bin/
cp -av /usr/bin/multilog $SNAPCRAFT_PART_INSTALL/bin/
cp -av /usr/bin/rsync $SNAPCRAFT_PART_INSTALL/bin/