Include perf-libs in release tarball (#4422)

This commit is contained in:
Michael Vines 2019-05-24 09:28:52 -07:00 committed by GitHub
parent 2e251ccc5c
commit 8eac199e8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 48 deletions

View File

@ -12,8 +12,12 @@ if [[ -d target/perf-libs ]]; then
exit 1 exit 1
fi fi
set -x (
git clone git@github.com:solana-labs/solana-perf-libs.git target/perf-libs set -x
cd target/perf-libs git clone git@github.com:solana-labs/solana-perf-libs.git target/perf-libs
make -j"$(nproc)" cd target/perf-libs
make DESTDIR=. install make -j"$(nproc)"
make DESTDIR=. install
)
./fetch-perf-libs.sh

View File

@ -48,7 +48,7 @@ echo --- Creating tarball
COMMIT="$(git rev-parse HEAD)" COMMIT="$(git rev-parse HEAD)"
( (
echo "channel: $CHANNEL" echo "channel: $CHANNEL_OR_TAG"
echo "commit: $COMMIT" echo "commit: $COMMIT"
echo "target: $TARGET" echo "target: $TARGET"
) > solana-release/version.yml ) > solana-release/version.yml
@ -57,6 +57,9 @@ echo --- Creating tarball
scripts/cargo-install-all.sh +"$rust_stable" solana-release scripts/cargo-install-all.sh +"$rust_stable" solana-release
./fetch-perf-libs.sh ./fetch-perf-libs.sh
mkdir solana-release/target
cp -a target/perf-libs solana-release/target/
# shellcheck source=/dev/null # shellcheck source=/dev/null
source ./target/perf-libs/env.sh source ./target/perf-libs/env.sh
( (

View File

@ -1,55 +1,63 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
cd "$(dirname "$0")"
if [[ $(uname) != Linux ]]; then if [[ ! -d target/perf-libs ]]; then
echo Performance libraries are only available for Linux if [[ $(uname) != Linux ]]; then
exit 1 echo Performance libraries are only available for Linux
fi exit 1
fi
if [[ $(uname -m) != x86_64 ]]; then if [[ $(uname -m) != x86_64 ]]; then
echo Performance libraries are only available for x86_64 architecture echo Performance libraries are only available for x86_64 architecture
exit 1 exit 1
fi fi
mkdir -p target/perf-libs mkdir -p target/perf-libs
(
cd target/perf-libs cd target/perf-libs
( (
set -x set -x
curl https://solana-perf.s3.amazonaws.com/v0.12.1/x86_64-unknown-linux-gnu/solana-perf.tgz | tar zxvf - 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 echo "Downloaded solana-perf version: $(cat solana-perf-HEAD.txt)"
CUDA_HOME=$(cat solana-perf-CUDA_HOME.txt) fi
else
CUDA_HOME=/usr/local/cuda
fi
echo CUDA_HOME="$CUDA_HOME" cat > env.sh <<'EOF'
if [[ -r "$CUDA_HOME"/version.txt && -r cuda-version.txt ]]; then SOLANA_PERF_LIBS="$(dirname "${BASH_SOURCE[0]}")"
if ! diff "$CUDA_HOME"/version.txt cuda-version.txt > /dev/null; then
echo ============================================== if [[ -r "$SOLANA_PERF_LIBS"/solana-perf-CUDA_HOME.txt ]]; then
echo "Warning: possible CUDA version mismatch with $CUDA_HOME" CUDA_HOME=$(cat "$SOLANA_PERF_LIBS"/solana-perf-CUDA_HOME.txt)
echo else
echo "Expected version: $(cat cuda-version.txt)" CUDA_HOME=/usr/local/cuda
echo "Detected version: $(cat "$CUDA_HOME"/version.txt)" fi
echo ==============================================
fi echo CUDA_HOME="$CUDA_HOME"
else export CUDA_HOME="$CUDA_HOME"
echo ==============================================
echo Warning: unable to validate CUDA version echo LD_LIBRARY_PATH="$SOLANA_PERF_LIBS:$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
echo ============================================== export LD_LIBRARY_PATH="$SOLANA_PERF_LIBS:$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
fi
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 <<EOF
export CUDA_HOME=$CUDA_HOME
export LD_LIBRARY_PATH="$PWD:$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
export PATH="$PATH:$CUDA_HOME/bin"
EOF EOF
echo "Downloaded solana-perf version: $(cat solana-perf-HEAD.txt)" echo
echo echo "source ./target/perf-libs/env.sh to setup environment"
echo "source ./target/perf-libs/env.sh to setup compatible build environment"
)
exit 0 exit 0

View File

@ -20,6 +20,11 @@ if [[ $(uname) != Linux ]]; then
fi fi
fi fi
if [[ -f "$SOLANA_ROOT"/target/perf-libs/env.sh ]]; then
# shellcheck source=/dev/null
source "$SOLANA_ROOT"/target/perf-libs/env.sh
fi
if [[ -n $USE_INSTALL || ! -f "$SOLANA_ROOT"/Cargo.toml ]]; then if [[ -n $USE_INSTALL || ! -f "$SOLANA_ROOT"/Cargo.toml ]]; then
solana_program() { solana_program() {
declare program="$1" declare program="$1"
@ -46,9 +51,6 @@ else
declare manifest_path="--manifest-path=$SOLANA_ROOT/$program/Cargo.toml" declare manifest_path="--manifest-path=$SOLANA_ROOT/$program/Cargo.toml"
printf "cargo run $manifest_path $maybe_release $maybe_package --bin solana-%s %s -- " "$program" "$features" printf "cargo run $manifest_path $maybe_release $maybe_package --bin solana-%s %s -- " "$program" "$features"
} }
# shellcheck disable=2154 # 'here' is referenced but not assigned
LD_LIBRARY_PATH=$(cd "$SOLANA_ROOT/target/perf-libs" && pwd):$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
fi fi
solana_bench_tps=$(solana_program bench-tps) solana_bench_tps=$(solana_program bench-tps)