Skip to content

Commit

Permalink
MX Performance and booster analysis script tweaks (#3822)
Browse files Browse the repository at this point in the history
  • Loading branch information
jberthold authored Apr 22, 2024
1 parent 2d3c935 commit 68bea10
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ hie.yaml
*~
dev-tools/*.cabal
booster/*.cabal
/booster/scripts/logs
/booster/scripts/bug-reports
/scripts/logs
/scripts/bug-reports
/booster/test/rpc-integration/resources/*.dylib
/booster/test/*/definition/*kompiled/

Expand Down
6 changes: 3 additions & 3 deletions scripts/booster-analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ nix_shell() {

nix_shell "cabal build kore-rpc-booster"

export SERVER=$(nix_shell "cabal exec which kore-rpc-booster")
export SERVER=$(nix_shell "cabal exec which kore-rpc-booster" | tail -1)

nix_shell "cabal build kore-rpc-client"

export CLIENT=$(nix_shell "cabal exec which kore-rpc-client")
export CLIENT=$(nix_shell "cabal exec which kore-rpc-client" | tail -1)

export LOG_DIR=${LOG_DIR:-"$BUG_REPORT_DIR-logs"}

Expand All @@ -37,7 +37,7 @@ export PLUGIN_DIR=$(nix build github:runtimeverification/blockchain-k-plugin/$PL

run_tarball(){
echo "######## $1 ########";
$SCRIPT_DIR/run-with-tarball.sh $1 -l Aborts --print-stats 2>&1 | tee $LOG_DIR/$(basename $1).out;
$SCRIPT_DIR/run-with-tarball.sh "$1" -l Aborts --print-stats 2>&1 | tee "$LOG_DIR/$(basename "$1").out";
}

export -f run_tarball
Expand Down
10 changes: 5 additions & 5 deletions scripts/performance-tests-mx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ git clone --depth 1 --branch $MX_VERSION https://github.com/runtimeverification/
cd mx-backend

if [[ $MX_VERSION == "master" ]]; then
MX_VERSION=$(git name-rev --tags --name-only $(git rev-parse HEAD))
MX_VERSION=$(git rev-parse --short HEAD)
else
MX_VERSION="${MX_VERSION//\//-}"
fi

git submodule update --init --recursive --depth 1 kmxwasm/k-src/mx-semantics/
git submodule update --init --recursive --depth 1

BUG_REPORT=''
POSITIONAL_ARGS=()
Expand All @@ -78,17 +78,17 @@ done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters


feature_shell "poetry -C kmxwasm install && make -C kmxwasm kbuild-haskell"
feature_shell "make kmxwasm && make build"


mkdir -p $SCRIPT_DIR/logs

feature_shell "make -C kmxwasm test-booster TEST_ARGS='$BUG_REPORT' && make -C kmxwasm test-integration TEST_ARGS='$BUG_REPORT' | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-$FEATURE_BRANCH_NAME.log"
feature_shell "(make -C kmxwasm test-booster TEST_ARGS='$BUG_REPORT' && make -C kmxwasm test-integration TEST_ARGS='$BUG_REPORT') | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-$FEATURE_BRANCH_NAME.log"
killall kore-rpc-booster || echo "No zombie processes found"

if [ -z "$BUG_REPORT" ]; then
if [ ! -e "$SCRIPT_DIR/logs/mx-$MX_VERSION-master-$MASTER_COMMIT_SHORT.log" ]; then
master_shell "make -C kmxwasm test-booster && make -C kmxwasm test-integration | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-master-$MASTER_COMMIT_SHORT.log"
master_shell "(make -C kmxwasm test-booster && make -C kmxwasm test-integration) | tee $SCRIPT_DIR/logs/mx-$MX_VERSION-master-$MASTER_COMMIT_SHORT.log"
killall kore-rpc-booster || echo "No zombie processes found"
fi

Expand Down
12 changes: 6 additions & 6 deletions scripts/run-with-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set -exo pipefail
tarball=${1?"Tarball argument missing"}
shift

tarname=$(basename $tarball)
tarname=$(basename "$tarball")

booster=${BOOSTER:-$(realpath $(dirname $0)/..)}
server=${SERVER:-$booster/.build/kore/bin/kore-rpc-booster}
Expand Down Expand Up @@ -49,7 +49,7 @@ trap 'rm -rf "$TEMPD"' EXIT

if [ -z "$DEFINITION" ]; then
# unpack definition file from tarball, into $TEMPD dir
tar xf $tarball -O definition.kore > $TEMPD/definition.kore
tar xf "$tarball" -O definition.kore > $TEMPD/definition.kore
kore=$TEMPD/definition.kore
else
kore=$DEFINITION
Expand All @@ -66,7 +66,7 @@ MODULE=$(grep -o -e "^module [A-Z0-9-]*" $kore | tail -1 | sed -e "s/module //")

# build llvm backend unless provided
if [ -z "${LLVM_LIB}" ]; then
tar xf $tarball -O llvm_definition/definition.kore > $TEMPD/llvm-definition.kore
tar xf "$tarball" -O llvm_definition/definition.kore > $TEMPD/llvm-definition.kore

LLVM_DEFINITION_SHA=$(sha1sum $TEMPD/llvm-definition.kore | awk '{ print $1 }')

Expand Down Expand Up @@ -135,7 +135,7 @@ server_port=$($LSOF -a -p${server_pid} -sTCP:LISTEN -iTCP | grep ${server_pid} |
echo "Server listening on port ${server_port}"


echo "Running requests from $tarball against the server: $client run-tarball $tarball --keep-going -p ${server_port} -h 127.0.0.1"
$client run-tarball $tarball --keep-going -p ${server_port} -h 127.0.0.1
echo "Running requests from $tarball against the server: $client run-tarball '$tarball' --keep-going -p ${server_port} -h 127.0.0.1"
$client run-tarball "$tarball" --keep-going -p ${server_port} -h 127.0.0.1

echo "Done with $tarball"
echo "Done with '$tarball'"

0 comments on commit 68bea10

Please sign in to comment.