Perftest: All scripts works now - tested by ssh'ing to same machine (need to configure some variables to fit other machines)
This commit is contained in:
parent
ee2d467678
commit
7a0cdcbae5
3 changed files with 26 additions and 15 deletions
|
@ -3,7 +3,8 @@
|
||||||
set -e
|
set -e
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
CONF_DIR=$(dirname "${0}")
|
#> Note: this script lies within <conf-dir>/upload_hooks
|
||||||
|
CONF_DIR="$(dirname "${0}")"/..
|
||||||
|
|
||||||
prog_NAME=$(basename "${0}")
|
prog_NAME=$(basename "${0}")
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ BIN_SHA256=
|
||||||
CACHE_DIR=
|
CACHE_DIR=
|
||||||
DATA_DIR=
|
DATA_DIR=
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 1 ]; do
|
||||||
OPT="$1"
|
OPT="$1"
|
||||||
|
|
||||||
case "${OPT}" in
|
case "${OPT}" in
|
||||||
|
@ -119,10 +120,10 @@ if [ -d "$PERFDATA_DIR" ]; then
|
||||||
fi;
|
fi;
|
||||||
#< goto maybe add a 'force' param to rerun test + regenerate plot
|
#< 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 set test-server ip somewhere - environment variable, or manually set here?
|
||||||
#< goto currently 'run-test.sh' depends on this containing user + test-dir too
|
#< 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
|
#< goto choose a working-dir for running test
|
||||||
|
|
||||||
case "${JOB},${BIN_EXT}" in
|
case "${JOB},${BIN_EXT}" in
|
||||||
|
|
|
@ -17,7 +17,7 @@ DAT="${PERFJOB_DIR}/tmp.dat"
|
||||||
get_jobs_build-uuids () {
|
get_jobs_build-uuids () {
|
||||||
sqlite3 "$DB" "select b.uuid from build as b \
|
sqlite3 "$DB" "select b.uuid from build as b \
|
||||||
join job as j on j.id = b.job\
|
join job as j on j.id = b.job\
|
||||||
where j.name = 'albatross' \
|
where j.name = '$JOB' \
|
||||||
order by b.id asc"
|
order by b.id asc"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ N=0
|
||||||
while read UUID; do
|
while read UUID; do
|
||||||
|
|
||||||
BIN_SHA256=$(get_bin_hash "$UUID")
|
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
|
if [ ! -f "$CSV" ]; then
|
||||||
echo "Skipping build with uuid '$UUID'. Test-data doesn't exist: '$CSV'"
|
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_VERSION=1
|
||||||
PLOT_NAME=throughput
|
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 <<EOF
|
gnuplot >"$OUT_IMG" <<EOF
|
||||||
set terminal png size $DIMS
|
set terminal png size $DIMS
|
||||||
set output '$OUT_IMG'
|
set output '$OUT_IMG'
|
||||||
set title '$PLOT_NAME'
|
set title '$PLOT_NAME'
|
||||||
|
|
|
@ -37,31 +37,37 @@ SSH="ssh $SERVER"
|
||||||
scp "$BIN" "$SERVER_W_DIR"
|
scp "$BIN" "$SERVER_W_DIR"
|
||||||
scp -r "$PERFSCRIPT_DIR"/* "$SERVER_W_DIR"
|
scp -r "$PERFSCRIPT_DIR"/* "$SERVER_W_DIR"
|
||||||
|
|
||||||
|
#> goto problem: backgrounding a task make it not fail this script :/
|
||||||
info initializing context for unikernel
|
info initializing context for unikernel
|
||||||
"$SSH" "$PERFSCRIPT_DIR"/init.sh &
|
$SSH "cd $SERVER_DIR; ./init.sh" &
|
||||||
INIT_PID=$!
|
INIT_PID=$!
|
||||||
|
|
||||||
info running unikernel in background
|
info running unikernel in background
|
||||||
"$SSH" "$PERFSCRIPT_DIR"/run-unikernel.sh &
|
$SSH "cd $SERVER_DIR; ./run-unikernel.sh" &
|
||||||
UNIKERNEL_PID=$!
|
UNIKERNEL_PID=$!
|
||||||
|
|
||||||
info sleeping a bit before test
|
info sleeping a bit before test
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
info running test
|
info running test
|
||||||
"$SSH" "$PERFSCRIPT_DIR"/run-test.sh
|
$SSH "cd $SERVER_DIR; ./run-test.sh"
|
||||||
|
|
||||||
info killing unikernel
|
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
|
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"
|
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
|
info running cleanup
|
||||||
"$SSH" "$PERFSCRIPT_DIR"/cleanup.sh
|
$SSH "cd $SERVER_DIR; ./cleanup.sh"
|
||||||
|
|
||||||
info done
|
info done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue