summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Ogden <bernie.ogden@linaro.org>2015-06-05 13:25:23 +0100
committerBernard Ogden <bernie.ogden@linaro.org>2015-06-05 13:34:39 +0100
commitcf3955df380dc8581269f20d15286ad139163d9e (patch)
tree4d004da1dc6fd0407b545643aebefbc400bf626f
First attempt at semi-automatic LAVA benchmarking
Change-Id: If22bc8d5fc01b41391cb072c010afc6777315482
-rw-r--r--bench-session-debian.yaml41
-rwxr-xr-xinvoke_session_debian57
-rw-r--r--run.sh41
-rwxr-xr-xsetup_session_debian16
-rwxr-xr-xstop_hacking_debian5
5 files changed, 160 insertions, 0 deletions
diff --git a/bench-session-debian.yaml b/bench-session-debian.yaml
new file mode 100644
index 0000000..1910124
--- /dev/null
+++ b/bench-session-debian.yaml
@@ -0,0 +1,41 @@
+metadata:
+ name: bench-session-debian
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Benchmarking Session"
+ version: 1.0
+
+params:
+ PUB_KEY: None
+ GATEWAY: 10.0.0.1
+ LISTENER_ADDR: NONE
+ LISTENER_PORT: NONE
+
+install:
+ sources:
+ - pps:linaro-maintainers/tools
+ deps:
+ - autogen
+ - binutils
+ - bison
+ - cpufrequtils
+ - dejagnu
+ - flex
+ - gawk
+ - gcc
+ - gcc-multilib
+ - g++-multilib
+ - git
+ - lava-tool
+ - libgfortran3
+ - libncurses5-dev
+ - make
+ - netcat.traditional
+ - openssh-server
+ - python-software-properties
+ - rsync
+ - texinfo
+ - wget
+run:
+ steps:
+ - ./setup_session_debian "$PUB_KEY"
+ - ./invoke_session_debian "$GATEWAY" "$LISTENER_ADDR" "$LISTENER_PORT"
diff --git a/invoke_session_debian b/invoke_session_debian
new file mode 100755
index 0000000..6c9362c
--- /dev/null
+++ b/invoke_session_debian
@@ -0,0 +1,57 @@
+#!/bin/bash
+# Usage ./invoke_session <gateway>
+
+# Hack for now until lava-test-shell is smart enough to know it's dispatcher ip
+gateway=$1
+listener_addr=$2
+listener_port=$3
+echo "Target's Gateway: $gateway"
+
+if ! grep 'invoke_session' /etc/rc.local
+then
+ sed -i '/bin/a invoke_session &' /etc/rc.local
+fi
+
+# Obtain target IP and Hostname
+ip_addr=$(ifconfig `ip route get $gateway | cut -d ' ' -f3` | grep 'inet addr' |awk -F: '{split($2,a," "); print a[1] }')
+hostname=$(cat /etc/hostname)
+
+# Set the PATH to use the LAVA api
+echo "export PATH=/lava/bin/:$PATH" > ~/.bashrc
+
+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 -n " "
+echo -n "Then:"
+echo -n "1) Copy compiler into place on that target"
+echo -n "2) Run run.sh <lava_user>:<lava_token> <benchmark> <compiler> <target>"
+echo -n ""
+echo -n "For example:"
+echo -n "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 -n "tar xf gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz"
+echo -n "run.sh bogden:foo fakebench ${HOME}/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc juno-a57"
+echo "*********************************************************************************************"
+echo ""
+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 "Benchmarking session ended..."
+echo "<LAVA_TEST_RUNNER>: exiting"
diff --git a/run.sh b/run.sh
new file mode 100644
index 0000000..ce4891a
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+set -u
+set -o pipefail
+
+if ! ssh-add -l; then
+ echo "No agent key - reconnect with agent forwarding" >&2
+ exit 1
+fi
+
+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 bernie/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}/onetime
+export LAVA_IN_LAB=1
+export LAVA_SERVER=${1}@validation.linaro.org
+
+~/work/abe/scripts/benchmark.sh -b $2 -i $3 kvm
+
+
+
diff --git a/setup_session_debian b/setup_session_debian
new file mode 100755
index 0000000..835e736
--- /dev/null
+++ b/setup_session_debian
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Usage ./setup_session <pub_key>
+
+chmod a+x stop_hacking_debian
+cp stop_hacking_debian /bin/stop_hacking
+chmod a+x invoke_session_debian
+cp invoke_session_debian /bin/invoke_session
+chmod a+x run.sh
+cp run.sh /bin/run.sh
+
+mkdir -p ~/.ssh/
+echo $1 >> ~/.ssh/authorized_keys
+echo "Public Key Installed: $1"
+
+/etc/init.d/ssh restart
+echo "sshd re-started"
diff --git a/stop_hacking_debian b/stop_hacking_debian
new file mode 100755
index 0000000..a872268
--- /dev/null
+++ b/stop_hacking_debian
@@ -0,0 +1,5 @@
+#!/bin/bash
+kill -CONT `cat /run/hacking/hacking.pid`
+rm -f /run/hacking/hacking.pid
+rm ~/.ssh/authorized_keys
+/etc/init.d/ssh stop