diff --git a/.buildkite/env/secrets.ejson b/.buildkite/env/secrets.ejson index f6930f3d8..8f0722aee 100644 --- a/.buildkite/env/secrets.ejson +++ b/.buildkite/env/secrets.ejson @@ -1,12 +1,14 @@ { "_public_key": "ae29f4f7ad2fc92de70d470e411c8426d5d48db8817c9e3dae574b122192335f", "environment": { - "CODECOV_TOKEN": "EJ[1:eSGdiZR0Qi0g7qnsI+qJ5H+/ik+H2qL3ned/cBdv/SY=:jA0WqO70coUtF0iokRdgtCR/lF/lETAI:d/Wl8Tdl6xVh/B39cTf1DaQkomR7I/2vMhvxd1msJ++BjI2l3p2dFoGsXqWT+/os8VgiPg==]", - "CRATES_IO_TOKEN": "EJ[1:eSGdiZR0Qi0g7qnsI+qJ5H+/ik+H2qL3ned/cBdv/SY=:2FaZ6k4RGH8luyNRaN6yeZUQDNAu2KwC:XeYe0tCAivYE0F9HEWM79mAI6kNbfYaqP7k7yY+SBDvs0341U9BdGZp7SErbHleS]", - "GITHUB_TOKEN": "EJ[1:eSGdiZR0Qi0g7qnsI+qJ5H+/ik+H2qL3ned/cBdv/SY=:9kh4DGPiGDcUU7ejSFWg3gTW8nrOM09Q:b+GE07Wu6/bEnkDZcUtf48vTKAFphrCSt3tNNER9h6A+wZ80k499edw4pbDdl9kEvxB30fFwrLQ=]", - "INFLUX_DATABASE": "EJ[1:eSGdiZR0Qi0g7qnsI+qJ5H+/ik+H2qL3ned/cBdv/SY=:rCHsYi0rc7dmvr1V3wEgNoaNIyr+9ClM:omjVcOqM7vwt44kJ+As4BjJL]", - "INFLUX_PASSWORD": "EJ[1:eSGdiZR0Qi0g7qnsI+qJ5H+/ik+H2qL3ned/cBdv/SY=:bP5Gw1Vy66viKFKO41o2Gho998XajH/5:khkCYz2LFvkJkk7R4xY1Hfz1yU3/NENjauiUkPhXA+dmg1qOIToxEagCgIkRwyeCiYaoCR6CZyw=]", - "INFLUX_USERNAME": "EJ[1:eSGdiZR0Qi0g7qnsI+qJ5H+/ik+H2qL3ned/cBd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/gayeuWCudWvmKNYr8KEHAWeTq34a5bdcKInBdKhjmjX+wLHqsEwQ5gcyhcxy4Ri2mbuN6AHazfZOZlubQkGlyUOAIYO5D5jkbyIh40DAtjVzo1MD/0HsW9zdGOzqUKp5xJJeDsbR4F153jbxa7fvwF90Q4UQjYFTKAtExEmHtDGSJG48ToVwTabTV/OnISMIggDZBviIv2QWHvXgK07b2mUj34rHJywEDGN1nj5rITTDdUeRcB1x4BAMOe94kTFPSTaj/OszvYlGECt8rkKFqbm092qL+XLfiBaImqe/WJHRCnAj6Don]", + "SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_pc_windows_msvc": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:wAh+dBuZopv6vruVOYegUcq/aBnbksT1:qIJfCfDvDWiqicMOkmbJs/0n7UJLKNmgMQaKzeQ8J7Q60YpXbtWzKVW3tS6lzlgf64m3MrPXyo1C+mWh6jkjsb18T/OfggZy1ZHM4AcsOC6/ldUkV5YtuxUQuAmd5jCuV/R7iuYY8Z66AcfAevlb+bnLpgIifdA8fh/IktOo58nZUQwZDdppAacmftsLc6Frn5Er6A6+EXpxK1nmnlmLJ4AJztqlh6X0r+JvE2O7qeoZUXrIegnkxo7Aay7I/dd8zdYpp7ICSiTEtfVN/xNIu/5QmTRU7gWoz7cPl9epq4aiEALzPOzb6KVOiRcsOg+TlFvLQ71Ik5o=]" } } diff --git a/book/src/testnet-participation.md b/book/src/testnet-participation.md index 8d41875ca..c17116351 100644 --- a/book/src/testnet-participation.md +++ b/book/src/testnet-participation.md @@ -64,11 +64,11 @@ for more detail on cluster activity. ##### Bootstrap with `solana-install` The `solana-install` tool can be used to easily install and upgrade the cluster -software on Linux x86_64 systems. +software on Linux x86_64 and mac OS systems. ```bash -$ export SOLANA_RELEASE=v0.14.2 # skip this line to install the latest release -$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.14.0/install/solana-install-init.sh | sh -s +$ export SOLANA_RELEASE=v0.16.0 # skip this line to install the latest release +$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.16.0/install/solana-install-init.sh | sh -s ``` Alternatively build the `solana-install` program from source and run the @@ -81,8 +81,9 @@ After a successful install, `solana-install update` may be used to easily update software to a newer version. ##### Download Prebuilt Binaries -Binaries are available for Linux x86_64 systems. +Binaries are available for Linux x86_64 and mac OS systems. +###### Linux Download the binaries by navigating to [https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest), download **solana-release-x86_64-unknown-linux-gnu.tar.bz2**, then extract the @@ -92,6 +93,17 @@ $ tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2 $ cd solana-release/ $ export PATH=$PWD/bin:$PATH ``` +###### mac OS +Download the binaries by navigating to +[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest), +download **solana-release-x86_64-apple-darwin.tar.bz2**, then extract the +archive: +```bash +$ tar jxf solana-release-x86_64-apple-darwin.tar.bz2 +$ cd solana-release/ +$ export PATH=$PWD/bin:$PATH +``` + ##### Build From Source If you are unable to use the prebuilt binaries or prefer to build it yourself from source, navigate to diff --git a/ci/testnet-deploy.sh b/ci/testnet-deploy.sh index dad95ccd5..08b24b496 100755 --- a/ci/testnet-deploy.sh +++ b/ci/testnet-deploy.sh @@ -327,10 +327,11 @@ if ! $skipStart; then args+=(-F) fi - # shellcheck disable=SC2154 # SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu comes from .buildkite/env/ - if $deployUpdateManifest && [[ -n $SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu ]]; then - echo "$SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu" > update_manifest_keypair.json - args+=(-i update_manifest_keypair.json) + if $deployUpdateManifest; then + rm -f update_manifest_keypair.json + args+=(--deploy-update linux) + args+=(--deploy-update osx) + #args+=(--deploy-update windows) fi # shellcheck disable=SC2086 # Don't want to double quote the $maybeXYZ variables diff --git a/install/src/defaults.rs b/install/src/defaults.rs index 6ae9600c4..65290cce9 100644 --- a/install/src/defaults.rs +++ b/install/src/defaults.rs @@ -23,8 +23,9 @@ lazy_static! { pub fn update_manifest_pubkey(target: &str) -> Option<&str> { match target { - "x86_64-apple-darwin" => None, + "x86_64-apple-darwin" => Some("GRUP8YUGASLdu2gBwHstFgeVH28qppfuCaTzq5Yo7wRo"), // SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_apple_darwin "x86_64-unknown-linux-gnu" => Some("FnKt2ES9iUJkjoprf2rL62xxBAxZLVgyA4SFexPGotFE"), // SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu + "x86_64-pc-windows-msvc" => Some("2Lrj5xDCHDmqwCgGwjVqAUUM84vLpj5dReYeoXL9vSXV"), // SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_pc_windows_msvc _ => None, } } diff --git a/install/testnet-deploy.sh b/install/testnet-deploy.sh deleted file mode 100755 index 00003bacd..000000000 --- a/install/testnet-deploy.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# -# Convenience script to easily deploy a software update to one of the testnets -# -# Prerequisites: -# 1) The default keypair should have some lamports (eg, `solana-wallet airdrop 123`) -# 2) The file update_manifest_keypair.json should exist if this script is not -# run from the CI environment -# -set -e - -CHANNEL=$1 -TAG=$2 - -if [[ -z $CHANNEL || -z $TAG ]]; then - echo "Usage: $0 [channel] [release tag]" - exit 0 -fi - -# Prefer possible `cargo build --all` binaries over PATH binaries -PATH=$(cd "$(dirname "$0")/.."; echo "$PWD")/target/debug:$PATH - -# shellcheck disable=2154 # is referenced but not assigned -if [[ -n $SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu ]]; then - echo "$SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu" > update_manifest_keypair.json -fi - -case $CHANNEL in -edge|beta) - URL=https://api.$CHANNEL.testnet.solana.com - ;; -stable) - URL=https://api.testnet.solana.com - ;; -localhost) - URL=http://localhost:8899 - ;; -*) - echo "Error: unknown channel: $CHANNEL" - exit 1 -esac - -set -x -solana-install deploy --url "$URL" \ - https://github.com/solana-labs/solana/releases/download/"$TAG"/solana-release-x86_64-unknown-linux-gnu.tar.bz2 \ - update_manifest_keypair.json diff --git a/net/net.sh b/net/net.sh index 62745b954..75e4913e6 100755 --- a/net/net.sh +++ b/net/net.sh @@ -30,7 +30,8 @@ Operate a configured testnet -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) - -i update_manifest_keypair - Deploy the tarball using 'solana-install deploy ...' + --deploy-update linux|osx|windows - Deploy the tarball using 'solana-install deploy ...' for the + given platform (multiple platforms may be specified) (-t option must be supplied as well) -f [cargoFeatures] - List of |cargo --feaures=| to activate (ignored if -s or -S is specified) @@ -80,8 +81,7 @@ cargoFeatures= skipSetup=false updateNodes=false customPrograms= -updateManifestKeypairFile= -updateDownloadUrl= +updatePlatforms= numBenchTpsClients=0 numBenchExchangeClients=0 benchTpsExtraArgs= @@ -100,6 +100,9 @@ while [[ -n $1 ]]; do if [[ $1 = --hashes-per-tick ]]; then genesisOptions="$genesisOptions $1 $2" shift 2 + elif [[ $1 = --deploy-update ]]; then + updatePlatforms="$updatePlatforms $2" + shift 2 else usage "Unknown long option: $1" fi @@ -109,7 +112,7 @@ while [[ -n $1 ]]; do fi done -while getopts "h?T:t:o:f:rD:i:c:Fn:" opt "${shortArgs[@]}"; do +while getopts "h?T:t:o:f:rD:c:Fn:" opt "${shortArgs[@]}"; do case $opt in h | \?) usage @@ -136,13 +139,6 @@ while getopts "h?T:t:o:f:rD:i:c:Fn:" opt "${shortArgs[@]}"; do n) numFullnodesRequested=$OPTARG ;; - i) - updateManifestKeypairFile=$OPTARG - if [[ ! -r $updateManifestKeypairFile ]]; then - echo "Error: unable to read the file $updateManifestKeypairFile" - exit 1 - fi - ;; r) skipSetup=true ;; @@ -413,26 +409,31 @@ sanity() { } deployUpdate() { - if [[ -z $updateManifestKeypairFile ]]; then + if [[ -z $updatePlatforms ]]; then return fi [[ $deployMethod = tar ]] || exit 1 - [[ -n $updateDownloadUrl ]] || exit 1 declare ok=true declare bootstrapLeader=${fullnodeIpList[0]} - echo "--- Deploying solana-install update: $updateDownloadUrl" - ( - set -x - timeout 30s scp "${sshOptions[@]}" \ - "$updateManifestKeypairFile" "$bootstrapLeader:solana/update_manifest_keypair.json" + for updatePlatform in $updatePlatforms; do + echo "--- Deploying solana-install update: $updatePlatform" + ( + set -x + + scripts/solana-install-update-manifest-keypair.sh "$updatePlatform" + + timeout 30s scp "${sshOptions[@]}" \ + update_manifest_keypair.json "$bootstrapLeader:solana/update_manifest_keypair.json" + + # shellcheck disable=SC2029 # remote-deploy-update.sh args are expanded on client side intentionally + ssh "${sshOptions[@]}" "$bootstrapLeader" \ + "./solana/net/remote/remote-deploy-update.sh $releaseChannel $updatePlatform" + ) || ok=false + $ok || exit 1 + done - # shellcheck disable=SC2029 # remote-deploy-update.sh args are expanded on client side intentionally - ssh "${sshOptions[@]}" "$bootstrapLeader" \ - "./solana/net/remote/remote-deploy-update.sh $updateDownloadUrl \"$RUST_LOG\"" - ) || ok=false - $ok || exit 1 } start() { @@ -440,15 +441,15 @@ start() { tar) if [[ -n $releaseChannel ]]; then rm -f "$SOLANA_ROOT"/solana-release.tar.bz2 - updateDownloadUrl=http://release.solana.com/"$releaseChannel"/solana-release-x86_64-unknown-linux-gnu.tar.bz2 + declare updateDownloadUrl=http://release.solana.com/"$releaseChannel"/solana-release-x86_64-unknown-linux-gnu.tar.bz2 ( set -x curl -o "$SOLANA_ROOT"/solana-release.tar.bz2 "$updateDownloadUrl" ) tarballFilename="$SOLANA_ROOT"/solana-release.tar.bz2 else - if [[ -n $updateManifestKeypairFile ]]; then - echo "Error: -i argument was provided but -t was not" + if [[ -n $updatePlatforms ]]; then + echo "Error: --deploy-update argument was provided but -t was not" exit 1 fi fi diff --git a/net/remote/remote-deploy-update.sh b/net/remote/remote-deploy-update.sh index ce8015322..b533226ae 100755 --- a/net/remote/remote-deploy-update.sh +++ b/net/remote/remote-deploy-update.sh @@ -6,7 +6,8 @@ set -e cd "$(dirname "$0")"/../.. -updateDownloadUrl=$1 +releaseChannel=$1 +updatePlatform=$2 [[ -r deployConfig ]] || { echo deployConfig missing @@ -20,7 +21,9 @@ missing() { exit 1 } -[[ -n $updateDownloadUrl ]] || missing updateDownloadUrl +[[ -n $releaseChannel ]] || missing releaseChannel +[[ -n $updatePlatform ]] || missing updatePlatform +[[ -f update_manifest_keypair.json ]] || missing update_manifest_keypair.json RUST_LOG="$2" export RUST_LOG=${RUST_LOG:-solana=info} # if RUST_LOG is unset, default to info @@ -31,6 +34,4 @@ loadConfigFile PATH="$HOME"/.cargo/bin:"$PATH" set -x -solana-wallet --url http://127.0.0.1:8899 airdrop 42 -solana-install deploy "$updateDownloadUrl" update_manifest_keypair.json \ - --url http://127.0.0.1:8899 +scripts/solana-install-deploy.sh localhost "$releaseChannel" "$updatePlatform" diff --git a/scripts/solana-install-deploy.sh b/scripts/solana-install-deploy.sh new file mode 100755 index 000000000..1d99ee53a --- /dev/null +++ b/scripts/solana-install-deploy.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# +# Convenience script to easily deploy a software update to a testnet +# +set -e +SOLANA_ROOT="$(cd "$(dirname "$0")"/..; pwd)" + +URL=$1 +TAG=$2 +OS=${3:-linux} + +if [[ -z $URL || -z $TAG ]]; then + echo "Usage: $0 [edge|beta|stable|localhost|RPC URL] [edge|beta|release tag] [linux|osx|windows]" + exit 0 +fi + +if [[ ! -f update_manifest_keypair.json ]]; then + "$SOLANA_ROOT"/scripts/solana-install-update-manifest-keypair.sh "$OS" +fi + +case $URL in +edge|beta) + URL=http://$URL.testnet.solana.com:8899 + ;; +stable) + URL=http://testnet.solana.com:8899 + ;; +localhost) + URL=http://localhost:8899 + ;; +*) + ;; +esac + +case $TAG in +edge|beta) + DOWNLOAD_URL=http://release.solana.com/"$TAG"/solana-release-$TARGET.tar.bz2 + ;; +*) + DOWNLOAD_URL=https://github.com/solana-labs/solana/releases/download/"$TAG"/solana-release-$TARGET.tar.bz2 + ;; +esac + +# Prefer possible `cargo build` binaries over PATH binaries +PATH="$SOLANA_ROOT"/target/debug:$PATH + +set -x +balance=$(solana-wallet --url "$URL" balance) +if [[ $balance = "0 lamports" ]]; then + solana-wallet --url "$URL" airdrop 42 +fi +solana-install deploy --url "$URL" "$DOWNLOAD_URL" update_manifest_keypair.json diff --git a/scripts/solana-install-update-manifest-keypair.sh b/scripts/solana-install-update-manifest-keypair.sh new file mode 100755 index 000000000..74b31c42a --- /dev/null +++ b/scripts/solana-install-update-manifest-keypair.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# +# Convenience script to easily deploy a software update to a testnet +# +# Prerequisites: +# 1) The default keypair should have some lamports (eg, `solana-wallet airdrop 123`) +# 2) The file update_manifest_keypair.json should exist if this script is not +# run from the CI environment +# +set -e + +OS=${1:-linux} + +case "$OS" in +osx) + TARGET=x86_64-apple-darwin + ;; +linux) + TARGET=x86_64-unknown-linux-gnu + ;; +windows) + TARGET=x86_64-pc-windows-msvc + ;; +*) + TARGET=unknown-unknown-unknown + ;; +esac + +SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR="SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_${TARGET//-/_}" + +# shellcheck disable=2154 # is referenced but not assigned +if [[ -z ${!SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR} ]]; then + echo "$SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR not defined" + exit 1 +fi + +echo "${!SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR}" > update_manifest_keypair.json +ls -l update_manifest_keypair.json