Skip to content

Commit

Permalink
Split the script to use nix shell to bring the node executable in s…
Browse files Browse the repository at this point in the history
…cope.
  • Loading branch information
paolino committed Jul 17, 2023
1 parent bf3b5de commit bdd5d1c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
24 changes: 2 additions & 22 deletions .buildkite/bench-memory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,12 @@
set -euo pipefail

artifact_name=memory
TMPDIR="${TMPDIR:-/tmp}"

export TMPDIR="/$TMPDIR/bench/memory"
mkdir -p $TMPDIR

echo "------------------------ Build ------------------------------------------"
nix build -o bench-wallet
# nix build # packages.x86_64-linux.cardano-node -o node
echo "------------------------Build done --------------------------------------"
echo "------------------------ Run --------------------------------------------"
wallet_exe="`pwd`/bench-wallet/bin/cardano-wallet"
echo "wallet_exe: $wallet_exe"
#node_exe="`pwd`/cardano-node/bin/cardano-node"
node_exe="`which cardano-node`"
echo "node_exe: $node_exe"
node_db="`pwd`/lib/wallet-benchmarks/data/membench-snapshot.tgz"
echo "node_db: $node_db"
work_dir=`pwd`
echo "work_dir: $work_dir"
bench="cabal bench cardano-wallet-benchmarks:bench:memory \
--benchmark-option=--snapshot=$node_db \
--benchmark-option=--wallet=$wallet_exe \
--benchmark-option=--node=$node_exe \
--benchmark-option=--work-dir=$work_dir "
echo "bench: $bench"
$bench
echo "------------------------ Run done ---------------------------------------"
nix develop -c "scripts/bench-memory.sh"

echo "------------------------ Results ----------------------------------------"

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ memory-time.txt
memory.log
memory
memory.svg
bench-restore
restore-time.txt
restore.log
23 changes: 23 additions & 0 deletions scripts/bench-memory.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/env bash

echo "------------------------ Build ------------------------------------------"
nix build -o bench-wallet
echo "------------------------Build done --------------------------------------"
echo "------------------------ Run --------------------------------------------"
wallet_exe="`pwd`/bench-wallet/bin/cardano-wallet"
echo "wallet_exe: $wallet_exe"
node_exe="`which cardano-node`"
# node_exe="`which cardano-node`"
echo "node_exe: $node_exe"
node_db="`pwd`/lib/wallet-benchmarks/data/membench-snapshot.tgz"
echo "node_db: $node_db"
work_dir=`pwd`
echo "work_dir: $work_dir"
bench="cabal bench cardano-wallet-benchmarks:bench:memory \
--benchmark-option=--snapshot=$node_db \
--benchmark-option=--wallet=$wallet_exe \
--benchmark-option=--node=$node_exe \
--benchmark-option=--work-dir=$work_dir "
echo "bench: $bench"
$bench
echo "------------------------ Run done ---------------------------------------"

0 comments on commit bdd5d1c

Please sign in to comment.