* Speed up net.sh builds (#16360)
* Speed up net.sh builds
* feedback
* Update net/net.sh
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* feedback
* fix
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 6cd4bc5e60
)
# Conflicts:
# scripts/cargo-install-all.sh
* fix
Co-authored-by: Justin Starry <justin@solana.com>
This commit is contained in:
9
cargo
9
cargo
@ -3,25 +3,22 @@
|
|||||||
# shellcheck source=ci/rust-version.sh
|
# shellcheck source=ci/rust-version.sh
|
||||||
here=$(dirname "$0")
|
here=$(dirname "$0")
|
||||||
|
|
||||||
source "${here}"/ci/rust-version.sh all
|
|
||||||
|
|
||||||
toolchain=
|
toolchain=
|
||||||
case "$1" in
|
case "$1" in
|
||||||
stable)
|
stable)
|
||||||
|
source "${here}"/ci/rust-version.sh stable
|
||||||
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
||||||
toolchain="$rust_stable"
|
toolchain="$rust_stable"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
nightly)
|
nightly)
|
||||||
|
source "${here}"/ci/rust-version.sh nightly
|
||||||
# shellcheck disable=SC2054 # rust_nightly is sourced from rust-version.sh
|
# shellcheck disable=SC2054 # rust_nightly is sourced from rust-version.sh
|
||||||
toolchain="$rust_nightly"
|
toolchain="$rust_nightly"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
+*)
|
|
||||||
toolchain="${1#+}"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
|
source "${here}"/ci/rust-version.sh stable
|
||||||
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
|
||||||
toolchain="$rust_stable"
|
toolchain="$rust_stable"
|
||||||
;;
|
;;
|
||||||
|
@ -7,8 +7,6 @@ src_root="$(readlink -f "${here}/..")"
|
|||||||
|
|
||||||
cd "${src_root}"
|
cd "${src_root}"
|
||||||
|
|
||||||
source ci/rust-version.sh stable
|
|
||||||
|
|
||||||
cargo_audit_ignores=(
|
cargo_audit_ignores=(
|
||||||
# failure is officially deprecated/unmaintained
|
# failure is officially deprecated/unmaintained
|
||||||
#
|
#
|
||||||
@ -44,4 +42,4 @@ cargo_audit_ignores=(
|
|||||||
--ignore RUSTSEC-2020-0146
|
--ignore RUSTSEC-2020-0146
|
||||||
|
|
||||||
)
|
)
|
||||||
scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit "${cargo_audit_ignores[@]}"
|
scripts/cargo-for-all-lock-files.sh stable audit "${cargo_audit_ignores[@]}"
|
||||||
|
@ -45,7 +45,7 @@ export RUSTFLAGS="-D warnings -A incomplete_features"
|
|||||||
# Only force up-to-date lock files on edge
|
# Only force up-to-date lock files on edge
|
||||||
if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
|
if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
|
||||||
# Exclude --benches as it's not available in rust stable yet
|
# Exclude --benches as it's not available in rust stable yet
|
||||||
if _ scripts/cargo-for-all-lock-files.sh +"$rust_stable" check --locked --tests --bins --examples; then
|
if _ scripts/cargo-for-all-lock-files.sh stable check --locked --tests --bins --examples; then
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
check_status=$?
|
check_status=$?
|
||||||
@ -56,7 +56,7 @@ if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure nightly and --benches
|
# Ensure nightly and --benches
|
||||||
_ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets
|
_ scripts/cargo-for-all-lock-files.sh nightly check --locked --all-targets
|
||||||
else
|
else
|
||||||
echo "Note: cargo-for-all-lock-files.sh skipped because $CI_BASE_BRANCH != $EDGE_CHANNEL"
|
echo "Note: cargo-for-all-lock-files.sh skipped because $CI_BASE_BRANCH != $EDGE_CHANNEL"
|
||||||
fi
|
fi
|
||||||
|
@ -42,6 +42,7 @@ Operate a configured testnet
|
|||||||
startnode - Start an individual node (previously stopped with stopNode)
|
startnode - Start an individual node (previously stopped with stopNode)
|
||||||
stopnode - Stop an individual node
|
stopnode - Stop an individual node
|
||||||
startclients - Start client nodes only
|
startclients - Start client nodes only
|
||||||
|
prepare - Prepare software deployment. (Build/download the software release)
|
||||||
update - Deploy a new software update to the cluster
|
update - Deploy a new software update to the cluster
|
||||||
upgrade - Upgrade software on bootstrap validator. (Restart bootstrap validator manually to run it)
|
upgrade - Upgrade software on bootstrap validator. (Restart bootstrap validator manually to run it)
|
||||||
|
|
||||||
@ -185,12 +186,12 @@ build() {
|
|||||||
|
|
||||||
buildVariant=
|
buildVariant=
|
||||||
if $debugBuild; then
|
if $debugBuild; then
|
||||||
buildVariant=debug
|
buildVariant=--debug
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$MAYBE_DOCKER bash -c "
|
$MAYBE_DOCKER bash -c "
|
||||||
set -ex
|
set -ex
|
||||||
scripts/cargo-install-all.sh farf \"$buildVariant\"
|
scripts/cargo-install-all.sh farf $buildVariant --validator-only
|
||||||
"
|
"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1055,6 +1056,9 @@ start)
|
|||||||
prepareDeploy
|
prepareDeploy
|
||||||
deploy
|
deploy
|
||||||
;;
|
;;
|
||||||
|
prepare)
|
||||||
|
prepareDeploy
|
||||||
|
;;
|
||||||
sanity)
|
sanity)
|
||||||
sanity
|
sanity
|
||||||
;;
|
;;
|
||||||
|
@ -14,7 +14,7 @@ usage() {
|
|||||||
echo "Error: $*"
|
echo "Error: $*"
|
||||||
fi
|
fi
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
usage: $0 [+<cargo version>] [--debug] <install directory>
|
usage: $0 [+<cargo version>] [--debug] [--validator-only] <install directory>
|
||||||
EOF
|
EOF
|
||||||
exit $exitcode
|
exit $exitcode
|
||||||
}
|
}
|
||||||
@ -23,6 +23,7 @@ maybeRustVersion=
|
|||||||
installDir=
|
installDir=
|
||||||
buildVariant=release
|
buildVariant=release
|
||||||
maybeReleaseFlag=--release
|
maybeReleaseFlag=--release
|
||||||
|
validatorOnly=
|
||||||
|
|
||||||
while [[ -n $1 ]]; do
|
while [[ -n $1 ]]; do
|
||||||
if [[ ${1:0:1} = - ]]; then
|
if [[ ${1:0:1} = - ]]; then
|
||||||
@ -30,6 +31,9 @@ while [[ -n $1 ]]; do
|
|||||||
maybeReleaseFlag=
|
maybeReleaseFlag=
|
||||||
buildVariant=debug
|
buildVariant=debug
|
||||||
shift
|
shift
|
||||||
|
elif [[ $1 = --validator-only ]]; then
|
||||||
|
validatorOnly=true
|
||||||
|
shift
|
||||||
else
|
else
|
||||||
usage "Unknown option: $1"
|
usage "Unknown option: $1"
|
||||||
fi
|
fi
|
||||||
@ -69,37 +73,37 @@ if [[ $CI_OS_NAME = windows ]]; then
|
|||||||
)
|
)
|
||||||
else
|
else
|
||||||
./fetch-perf-libs.sh
|
./fetch-perf-libs.sh
|
||||||
(
|
|
||||||
set -x
|
|
||||||
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
|
|
||||||
$cargo $maybeRustVersion build $maybeReleaseFlag
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
BINS=(
|
BINS=(
|
||||||
cargo-build-bpf
|
|
||||||
cargo-test-bpf
|
|
||||||
solana
|
solana
|
||||||
solana-bench-exchange
|
solana-bench-exchange
|
||||||
solana-bench-tps
|
solana-bench-tps
|
||||||
solana-dos
|
|
||||||
solana-faucet
|
solana-faucet
|
||||||
solana-gossip
|
solana-gossip
|
||||||
solana-install
|
solana-install
|
||||||
solana-install-init
|
|
||||||
solana-keygen
|
solana-keygen
|
||||||
solana-ledger-tool
|
solana-ledger-tool
|
||||||
solana-log-analyzer
|
solana-log-analyzer
|
||||||
solana-net-shaper
|
solana-net-shaper
|
||||||
|
solana-sys-tuner
|
||||||
|
solana-validator
|
||||||
|
)
|
||||||
|
|
||||||
|
# Speed up net.sh deploys by excluding unused binaries
|
||||||
|
if [[ -z "$validatorOnly" ]]; then
|
||||||
|
BINS+=(
|
||||||
|
cargo-build-bpf
|
||||||
|
cargo-test-bpf
|
||||||
|
solana-dos
|
||||||
|
solana-install-init
|
||||||
solana-stake-accounts
|
solana-stake-accounts
|
||||||
solana-stake-monitor
|
solana-stake-monitor
|
||||||
solana-stake-o-matic
|
solana-stake-o-matic
|
||||||
solana-sys-tuner
|
|
||||||
solana-test-validator
|
solana-test-validator
|
||||||
solana-tokens
|
solana-tokens
|
||||||
solana-validator
|
|
||||||
solana-watchtower
|
solana-watchtower
|
||||||
)
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
#XXX: Ensure `solana-genesis` is built LAST!
|
#XXX: Ensure `solana-genesis` is built LAST!
|
||||||
# See https://github.com/solana-labs/solana/issues/5826
|
# See https://github.com/solana-labs/solana/issues/5826
|
||||||
@ -117,8 +121,12 @@ mkdir -p "$installDir/bin"
|
|||||||
set -x
|
set -x
|
||||||
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
|
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
|
||||||
"$cargo" $maybeRustVersion build $maybeReleaseFlag "${binArgs[@]}"
|
"$cargo" $maybeRustVersion build $maybeReleaseFlag "${binArgs[@]}"
|
||||||
|
|
||||||
|
# Exclude `spl-token` binary for net.sh builds
|
||||||
|
if [[ -z "$validatorOnly" ]]; then
|
||||||
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
|
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
|
||||||
"$cargo" $maybeRustVersion install spl-token-cli --root "$installDir"
|
"$cargo" $maybeRustVersion install spl-token-cli --root "$installDir"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
for bin in "${BINS[@]}"; do
|
for bin in "${BINS[@]}"; do
|
||||||
|
Reference in New Issue
Block a user