From 8eac199e8bbbd62b8cbee88ecc3b7ab8ff05d364 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 24 May 2019 09:28:52 -0700 Subject: [PATCH] Include perf-libs in release tarball (#4422) --- build-perf-libs.sh | 14 ++++--- ci/publish-tarball.sh | 5 ++- fetch-perf-libs.sh | 86 ++++++++++++++++++++++------------------ multinode-demo/common.sh | 8 ++-- 4 files changed, 65 insertions(+), 48 deletions(-) diff --git a/build-perf-libs.sh b/build-perf-libs.sh index 756ce510f1..aee74dc277 100755 --- a/build-perf-libs.sh +++ b/build-perf-libs.sh @@ -12,8 +12,12 @@ if [[ -d target/perf-libs ]]; then exit 1 fi -set -x -git clone git@github.com:solana-labs/solana-perf-libs.git target/perf-libs -cd target/perf-libs -make -j"$(nproc)" -make DESTDIR=. install +( + set -x + git clone git@github.com:solana-labs/solana-perf-libs.git target/perf-libs + cd target/perf-libs + make -j"$(nproc)" + make DESTDIR=. install +) + +./fetch-perf-libs.sh diff --git a/ci/publish-tarball.sh b/ci/publish-tarball.sh index fda53572cf..25df48ce43 100755 --- a/ci/publish-tarball.sh +++ b/ci/publish-tarball.sh @@ -48,7 +48,7 @@ echo --- Creating tarball COMMIT="$(git rev-parse HEAD)" ( - echo "channel: $CHANNEL" + echo "channel: $CHANNEL_OR_TAG" echo "commit: $COMMIT" echo "target: $TARGET" ) > solana-release/version.yml @@ -57,6 +57,9 @@ echo --- Creating tarball scripts/cargo-install-all.sh +"$rust_stable" solana-release ./fetch-perf-libs.sh + mkdir solana-release/target + cp -a target/perf-libs solana-release/target/ + # shellcheck source=/dev/null source ./target/perf-libs/env.sh ( diff --git a/fetch-perf-libs.sh b/fetch-perf-libs.sh index 262d3ea55f..ef87aab444 100755 --- a/fetch-perf-libs.sh +++ b/fetch-perf-libs.sh @@ -1,55 +1,63 @@ #!/usr/bin/env bash set -e +cd "$(dirname "$0")" -if [[ $(uname) != Linux ]]; then - echo Performance libraries are only available for Linux - exit 1 -fi +if [[ ! -d target/perf-libs ]]; then + if [[ $(uname) != Linux ]]; then + echo Performance libraries are only available for Linux + exit 1 + fi -if [[ $(uname -m) != x86_64 ]]; then - echo Performance libraries are only available for x86_64 architecture - exit 1 -fi + if [[ $(uname -m) != x86_64 ]]; then + echo Performance libraries are only available for x86_64 architecture + exit 1 + fi -mkdir -p target/perf-libs -( + mkdir -p target/perf-libs cd target/perf-libs ( set -x curl https://solana-perf.s3.amazonaws.com/v0.12.1/x86_64-unknown-linux-gnu/solana-perf.tgz | tar zxvf - ) - if [[ -r solana-perf-CUDA_HOME.txt ]]; then - CUDA_HOME=$(cat solana-perf-CUDA_HOME.txt) - else - CUDA_HOME=/usr/local/cuda - fi + echo "Downloaded solana-perf version: $(cat solana-perf-HEAD.txt)" +fi - echo CUDA_HOME="$CUDA_HOME" - if [[ -r "$CUDA_HOME"/version.txt && -r cuda-version.txt ]]; then - if ! diff "$CUDA_HOME"/version.txt cuda-version.txt > /dev/null; then - echo ============================================== - echo "Warning: possible CUDA version mismatch with $CUDA_HOME" - echo - echo "Expected version: $(cat cuda-version.txt)" - echo "Detected version: $(cat "$CUDA_HOME"/version.txt)" - echo ============================================== - fi - else - echo ============================================== - echo Warning: unable to validate CUDA version - echo ============================================== - fi +cat > env.sh <<'EOF' +SOLANA_PERF_LIBS="$(dirname "${BASH_SOURCE[0]}")" + +if [[ -r "$SOLANA_PERF_LIBS"/solana-perf-CUDA_HOME.txt ]]; then + CUDA_HOME=$(cat "$SOLANA_PERF_LIBS"/solana-perf-CUDA_HOME.txt) +else + CUDA_HOME=/usr/local/cuda +fi + +echo CUDA_HOME="$CUDA_HOME" +export CUDA_HOME="$CUDA_HOME" + +echo LD_LIBRARY_PATH="$SOLANA_PERF_LIBS:$CUDA_HOME/lib64:$LD_LIBRARY_PATH" +export LD_LIBRARY_PATH="$SOLANA_PERF_LIBS:$CUDA_HOME/lib64:$LD_LIBRARY_PATH" + +echo PATH="$SOLANA_PERF_LIBS:$CUDA_HOME/bin:$PATH" +export PATH="$SOLANA_PERF_LIBS:$CUDA_HOME/bin:$PATH" + +if [[ -r "$CUDA_HOME"/version.txt && -r $SOLANA_PERF_LIBS/cuda-version.txt ]]; then + if ! diff "$CUDA_HOME"/version.txt "$SOLANA_PERF_LIBS"/cuda-version.txt > /dev/null; then + echo ============================================== + echo "Warning: possible CUDA version mismatch with $CUDA_HOME" + echo + echo "Expected version: $(cat "$SOLANA_PERF_LIBS"/cuda-version.txt)" + echo "Detected version: $(cat "$CUDA_HOME"/version.txt)" + echo ============================================== + fi +else + echo ============================================== + echo Warning: unable to validate CUDA version + echo ============================================== +fi - cat > env.sh <