Skip to content

Commit

Permalink
Remove snap support
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Mar 3, 2019
1 parent 9c3e7e4 commit cd4bccf
Show file tree
Hide file tree
Showing 25 changed files with 30 additions and 666 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ We maintain several testnets:

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).
Each testnet can be manually manipulated from buildkite as well. The `-perf`
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).
Each testnet can be manually manipulated from buildkite as well.

## How do I reset the testnet?
Manually trigger the [testnet-management](https://buildkite.com/solana-labs/testnet-management) pipeline
Expand Down
3 changes: 1 addition & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ the `master` branch as late as possible prior to the milestone release.

### v*X.Y.Z* release tag
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,
https://snapcraft.io/, and elsewhere.
branch, and cause that *X.Y.Z* release to be shipped to https://crates.io

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
Expand Down
92 changes: 0 additions & 92 deletions book/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

## 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.

3 changes: 0 additions & 3 deletions ci/buildkite-secondary.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
steps:
#- command: "ci/publish-snap.sh"
# timeout_in_minutes: 40
# name: "publish snap"
- command: "sdk/docker-solana/build.sh"
timeout_in_minutes: 20
name: "publish docker"
Expand Down
4 changes: 0 additions & 4 deletions ci/buildkite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ steps:
# timeout_in_minutes: 20
# agents:
# - "queue=large"
- command: "ci/pr-snap.sh"
timeout_in_minutes: 20
name: "snap"
branches: "pull/*"
- wait
- trigger: "solana-secondary"
branches: "!pull/*"
Expand Down
1 change: 0 additions & 1 deletion ci/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ ARGS+=(
--env CI
--env CODECOV_TOKEN
--env CRATES_IO_TOKEN
--env SNAPCRAFT_CREDENTIALS_KEY
)

if $INTERACTIVE; then
Expand Down
7 changes: 0 additions & 7 deletions ci/docker-snapcraft/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions ci/docker-snapcraft/build.sh

This file was deleted.

13 changes: 0 additions & 13 deletions ci/pr-snap.sh

This file was deleted.

65 changes: 0 additions & 65 deletions ci/publish-snap.sh

This file was deleted.

Binary file removed ci/snapcraft.credentials.enc
Binary file not shown.
25 changes: 2 additions & 23 deletions ci/testnet-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ clientNodeCount=0
additionalFullNodeCount=10
publicNetwork=false
skipSetup=false
snapChannel=edge
tarChannelOrTag=edge
delete=false
enableGpu=false
bootDiskType=""
leaderRotation=true
useTarReleaseChannel=false
blockstreamer=false

usage() {
Expand All @@ -36,8 +34,6 @@ Deploys a CD testnet
zone - cloud provider zone to deploy the network into
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
specified release channel (edge|beta|stable) or release tag
(vX.Y.Z)
Expand Down Expand Up @@ -69,7 +65,7 @@ zone=$3
[[ -n $zone ]] || usage "Zone not specified"
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
h | \?)
usage
Expand All @@ -83,21 +79,10 @@ while getopts "h?p:Pn:c:s:t:gG:a:Dbd:ru" opt; do
c)
clientNodeCount=$OPTARG
;;
s)
case $OPTARG in
edge|beta|stable)
snapChannel=$OPTARG
;;
*)
usage "Invalid snap channel: $OPTARG"
;;
esac
;;
t)
case $OPTARG in
edge|beta|stable|v*)
tarChannelOrTag=$OPTARG
useTarReleaseChannel=true
;;
*)
usage "Invalid release channel: $OPTARG"
Expand Down Expand Up @@ -242,14 +227,8 @@ ok=true
op=start
fi

if $useTarReleaseChannel; then
deploySource="-t $tarChannelOrTag"
else
deploySource="-s $snapChannel"
fi

# 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
) || ok=false

Expand Down
2 changes: 1 addition & 1 deletion ci/testnet-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ start() {
${maybeReuseLedger:+-r} \
${maybeDelete:+-D}
#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} \
# ${maybeDelete:+-D}
)
Expand Down
13 changes: 0 additions & 13 deletions multinode-demo/bootstrap-leader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 3 additions & 26 deletions multinode-demo/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Loading

0 comments on commit cd4bccf

Please sign in to comment.