diff --git a/packaging/perftest.sh b/packaging/perftest.sh index e3403d8..52b34f6 100755 --- a/packaging/perftest.sh +++ b/packaging/perftest.sh @@ -3,7 +3,8 @@ set -e #set -x -CONF_DIR=$(dirname "${0}") +#> Note: this script lies within /upload_hooks +CONF_DIR="$(dirname "${0}")"/.. prog_NAME=$(basename "${0}") @@ -55,7 +56,7 @@ BIN_SHA256= CACHE_DIR= DATA_DIR= -while [ $# -gt 0 ]; do +while [ $# -gt 1 ]; do OPT="$1" case "${OPT}" in @@ -119,10 +120,10 @@ if [ -d "$PERFDATA_DIR" ]; then fi; #< goto maybe add a 'force' param to rerun test + regenerate plot -SERVER="undefined" +SERVER="starand" #< goto set test-server ip somewhere - environment variable, or manually set here? #< goto currently 'run-test.sh' depends on this containing user + test-dir too -SERVER_DIR="undefined" +SERVER_DIR="0tmp/robur_perftest" #< goto choose a working-dir for running test case "${JOB},${BIN_EXT}" in diff --git a/packaging/perftest/unipi/plot.sh b/packaging/perftest/unipi/plot.sh index 380f0a6..fd9821a 100755 --- a/packaging/perftest/unipi/plot.sh +++ b/packaging/perftest/unipi/plot.sh @@ -17,7 +17,7 @@ DAT="${PERFJOB_DIR}/tmp.dat" get_jobs_build-uuids () { sqlite3 "$DB" "select b.uuid from build as b \ join job as j on j.id = b.job\ - where j.name = 'albatross' \ + where j.name = '$JOB' \ order by b.id asc" } @@ -33,7 +33,7 @@ N=0 while read UUID; do BIN_SHA256=$(get_bin_hash "$UUID") - CSV="${PERFJOB_DIR}/${BIN_SHA256}/siege.csv" + CSV="${PERFJOB_DIR}/${BIN_SHA256}/siege_test01.csv" if [ ! -f "$CSV" ]; then echo "Skipping build with uuid '$UUID'. Test-data doesn't exist: '$CSV'" @@ -63,9 +63,13 @@ done < <(get_jobs_build-uuids) PLOT_VERSION=1 PLOT_NAME=throughput -OUT_IMG="${CACHE_DIR}/perf/${JOB}/${PLOT_NAME}_${PLOT_VERSION}/${LATEST_UUID}.png" +OUT_DIR="${CACHE_DIR}/perftest/${JOB}/${PLOT_NAME}_${PLOT_VERSION}" +if [ ! -e "$OUT_DIR" ]; then + mkdir -p "$OUT_DIR" +fi +OUT_IMG="${OUT_DIR}/${LATEST_UUID}.png" -gnuplot <"$OUT_IMG" < goto problem: backgrounding a task make it not fail this script :/ info initializing context for unikernel -"$SSH" "$PERFSCRIPT_DIR"/init.sh & +$SSH "cd $SERVER_DIR; ./init.sh" & INIT_PID=$! info running unikernel in background -"$SSH" "$PERFSCRIPT_DIR"/run-unikernel.sh & +$SSH "cd $SERVER_DIR; ./run-unikernel.sh" & UNIKERNEL_PID=$! info sleeping a bit before test sleep 5 info running test -"$SSH" "$PERFSCRIPT_DIR"/run-test.sh +$SSH "cd $SERVER_DIR; ./run-test.sh" info killing unikernel -kill "$UNIKERNEL_PID" +$SSH "cd $SERVER_DIR; kill "'$(cat run-unikernel.sh.PID)' || echo "couldn't kill: unikernel not running" +#kill "$UNIKERNEL_PID" info killing init-daemon -kill "$INIT_PID" +$SSH "cd $SERVER_DIR; kill "'$(cat init.sh.PID)' || echo "couldn't kill: git daemon not running" +#kill "$INIT_PID" info copying results to "$PERFDATA_DIR" -scp "${SERVER_W_DIR}/results/*" "$PERFDATA_DIR" +if [ ! -e "$PERFDATA_DIR" ]; then + mkdir -p "$PERFDATA_DIR" +fi +scp "${SERVER_W_DIR}/output/*" "$PERFDATA_DIR"/ info running cleanup -"$SSH" "$PERFSCRIPT_DIR"/cleanup.sh +$SSH "cd $SERVER_DIR; ./cleanup.sh" info done