summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Ogden <bernie.ogden@linaro.org>2015-07-10 18:14:13 +0200
committerBernard Ogden <bernie.ogden@linaro.org>2015-07-10 18:14:13 +0200
commit70be38bf191dfadd247405824ab50c69e6bf0816 (patch)
tree4fdf44c4e5a6a99a7e953eec9a58dd56ea8964a2
parentc4cee23e1e573aeef47bc156e77ff2ff248be71d (diff)
Incorporate benchmark.sh into invoke_session_debian
invoke_session_debian now reuses Benchmark.job from the abe tree Change-Id: I5ace49cceff819cc2319add3b11658a8acf50a89
-rw-r--r--benchmark.sh46
-rwxr-xr-xinvoke_session_debian94
2 files changed, 43 insertions, 97 deletions
diff --git a/benchmark.sh b/benchmark.sh
deleted file mode 100644
index 05b99c2..0000000
--- a/benchmark.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-set -u
-set -o pipefail
-
-if ! ssh-add -l; then
- echo "No agent key - reconnect with agent forwarding" >&2
- exit 1
-fi
-
-rm -f /usr/local/bin/git-new-workdir
-ln /usr/share/doc/git/contrib/workdir/git-new-workdir /usr/local/bin
-chmod 755 /usr/local/bin/git-new-workdir
-
-if ! test -e ~/data; then
- mkdir ~/data || exit 1
- if ! ssh-keygen -P '' -f ~/data/onetime < /dev/null; then
- rm -rf ~/data
- exit 1
- fi
-fi
-
-if ! test -e ~/src; then
- mkdir ~/src || exit 1
- if ! git clone -b benchmarking http://git.linaro.org/toolchain/abe ~/src/abe; then
- rm -rf ~/src
- exit 1
- fi
-fi
-
-if ! test -e ~/work; then
- mkdir ~/work
- if ! (cd work; ~/src/abe/configure --with-fileserver=148.251.136.42 --with-remote-snapshots=/snapshots-ref); then
- rm -rf ~/work
- exit 1
- fi
-fi
-
-export LAVA_SSH_KEYFILE=${HOME}/data/onetime
-export LAVA_IN_LAB=1
-
-#Prepare to use source that has been sent in to target
-sed -i 's#ssh://git@dev-private\.git\.linaro\.org\#ssh://localhost/~/benchsrc/#' ~/src/abe/config/sources.conf || exit 1
-while ! -e /tmp/benchsrc_lock; do inotifywait -e create /tmp; done
-
-cd ~/work
-exec ~/src/abe/scripts/benchmark.sh "$@"
diff --git a/invoke_session_debian b/invoke_session_debian
index dadf65f..861fc5e 100755
--- a/invoke_session_debian
+++ b/invoke_session_debian
@@ -1,5 +1,13 @@
#!/bin/bash
# Usage ./invoke_session <gateway>
+set -u
+set -o pipefail
+
+error=1
+
+trap "rm -rf ~/*; exit \${error}" EXIT
+
+env
# Hack for now until lava-test-shell is smart enough to know it's dispatcher ip
gateway=$1
@@ -19,69 +27,53 @@ hostname=$(cat /etc/hostname)
# Set the PATH to use the LAVA api
echo "export PATH=/lava/bin/:$PATH" > ~/.bashrc
-if ! ssh -o StrictHostKeyChecking=no localhost true; then
- echo "Failed to ssh to self" >&2
- echo "<LAVA_TEST_RUNNER>: exiting"
+#Create directory to store src
+if ! (mkdir ~/benchsrc && chmod 700 ~/benchsrc); then
+ echo "Failed to create directory for source" >&2
+ exit 1
+fi
+
+#Initialize git-new-workdir - sadly not just an apt-get call
+ln /usr/share/doc/git/contrib/workdir/git-new-workdir /usr/local/bin
+chmod 755 /usr/local/bin/git-new-workdir
+
+#Get abe
+mkdir ~/src || exit 1
+ABE_DIR=~/src/abe
+if ! git clone -b ${ABE_BRANCH:-benchmarking} http://git.linaro.org/toolchain/abe ${ABE_DIR}; then
+ rm -rf ~/src
exit 1
fi
-if ! (mkdir /root/benchsrc && chmod 700 /root/benchsrc); then
+
+#Expect local sources
+sed -i 's#ssh://git@dev-private\.git\.linaro\.org#ssh://localhost/~/benchsrc/#' ~/src/abe/config/sources.conf || exit 1
+
+#Need to be able to ssh to self to get local sources
+if ! ssh -o StrictHostKeyChecking=no localhost true; then
echo "Failed to ssh to self" >&2
- echo "<LAVA_TEST_RUNNER>: exiting"
exit 1
fi
+#Generate one-time key
+mkdir ~/data || exit 1
+if ! ssh-keygen -P '' -f ~/data/onetime < /dev/null; then
+ rm -rf ~/data
+ exit 1
+fi
+export LAVA_SSH_KEYFILE=${HOME}/data/onetime
-echo ""
-echo ""
-echo ""
-echo ""
-echo ""
-echo ""
-echo ""
-echo ""
-echo ""
-echo ""
-echo "*********************************************************************************************"
-echo -n "Please connect to: "
-echo -n "ssh -A "
-echo -n "-o UserKnownHostsFile=/dev/null "
-echo -n "-o StrictHostKeyChecking=no "
-echo -n "root@"
-echo -n ${ip_addr}.lab
-echo ""
-echo "Then:"
-echo "1) Copy compiler into place on that target"
-echo "2) ssh git@dev-private.git.linaro.org #to update known_hosts"
-echo "3) export LAVA_SERVER=your_lava_username:your_lava_auth_token@validation.linaro.org/RPC2/"
-echo "4) benchmark.sh -b BENCHMARK -i COMPILER [OPTIONAL ARGS...] TARGET > stdout 2>stderr &"
-echo "5) disown %1 #or other number, if the above command wasn't job 1"
-echo "6) exit #or tail stdout/stderr, if you want to keep an eye on what's happening"
-echo "7) Once the benchmark has built, you should be able to see another LAVA job running."
-echo " When that LAVA job completes, you can ssh back into this target to collect results."
-echo " Results will be in /root/work."
-echo ""
-echo "For example:"
-echo "wget http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz"
-echo "tar xf gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz"
-echo "ssh git@dev-private.git.linaro.org"
-echo "export LAVA_SERVER=bogden:(my_lava_auth_token)@validation.linaro.org/RPC2/"
-echo "benchmark.sh -b fakebench -i ${HOME}/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -a int juno-a57 >stdout 2>stderr &"
-echo "disown %1"
-echo "*********************************************************************************************"
-echo ""
+echo "*** WAITING FOR SOURCE: ${ip_addr}"
+while ! -e /tmp/benchsrc_lock; do inotifywait -e create /tmp; done
echo ""
mkdir -p /run
mkdir -p /run/hacking
echo $$ > /run/hacking/hacking.pid
-#suspend in a way that is portable across shells and doesn't involve a busy-wait
-pid=
-trap 'kill $pid
- trap - SIGCONT' SIGCONT
-echo "Benchmarking session active..."
-sleep 999d& #timeout after 2 or 3 years... the job is likely to have a rather shorter timeout associated with it
-pid=$!
-wait
+echo "Running benchmark... I may be some time"
+cd ~/work
+export LAVA_IN_LAB=1
+~/src/abe/scripts/Benchmark.job
echo "Benchmarking session ended..."
echo "<LAVA_TEST_RUNNER>: exiting"
+error=0