This is an automated email from the git hooks/post-receive script.
bernie.ogden pushed a commit to branch bernie/benchmarking in repository toolchain/abe.
The following commit(s) were added to refs/heads/bernie/benchmarking by this push: new e8d103f Invent local sessions e8d103f is described below
commit e8d103f0e1623c33f975bfe047d45cf53f511207 Author: Bernard Ogden bernie.ogden@linaro.org Date: Thu Aug 13 16:59:32 2015 +0200
Invent local sessions
A local session is one where host and target are the same. Reduces kvm pressure in the case that the benchmark is prebuilt.
Change-Id: Ic51200afe4d57ce13895240ab9925228cb3d226d --- config/bench/lava/local-session | 126 +++++++++++++++++++++++++++++++++++ config/bench/lava/local-session.yaml | 42 ++++++++++++ 2 files changed, 168 insertions(+)
diff --git a/config/bench/lava/local-session b/config/bench/lava/local-session new file mode 100755 index 0000000..3571980 --- /dev/null +++ b/config/bench/lava/local-session @@ -0,0 +1,126 @@ +#!/bin/bash +set -u +set -o pipefail + +error=1 +if test x"${BENCH_DEBUG}" = x || test x"${BENCH_DEBUG}" = xNone; then + export BENCH_DEBUG= +fi + +function exitfunc { + if test ${error} -ne 0; then + if test x"${BENCH_DEBUG}" != x; then + echo "Trapped exit with error ${error}" + echo "Sleeping for debug" + echo "ssh -o ControlMaster=no -o ControlPath=/dev/null `hostname -I | tr -d [...] + sleep infinity + fi + fi + rm -rf ~/* + exit ${error} +} + +trap exitfunc EXIT + +abe_branch="$1" + +#these parameters used by Benchmark.job +export benchmark="${2:?Must set a benchmark}" +export toolchain="${3:?Must set a toolchain}" +if test x"$4" = xNone; then + export run_flags= +else + export run_flags="$4" +fi +if test x"$5" = xNone; then + export compiler_flags= +else + export compiler_flags="$5" +fi +if test x"$6" = xNone; then + export make_flags= +else + export make_flags="$6" +fi +if test x"$7" = xNone; then + export prebuilt= +else + export prebuilt="$7" +fi + +#Non-parameters that we need to pass to Benchmark.job +export ABE_DIR +export post_build_cmd="rm ${HOME}/data/socket" +export post_target_cmd="cat /root/sleeper | xargs kill" +export maindir="/${HOME}/bench" +mkdir "${maindir}" || exit 1 +chmod 700 "${maindir}" || exit 1 + +#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 + +#Generate one-time key +if ! ssh-keygen -P '' -f ~/.ssh/id_rsa > /dev/null < /dev/null; then + exit 1 +fi + +#Create directory for communication with other hosts +mkdir ~/data || exit 1 + +#Need to be able to ssh to dev-private +echo 'dev-private.git.linaro.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyN [...] +#Permit scping of toolchains/built benchmarks from this machine +echo '148.251.136.42 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzd [...] + +#Generate config file for each target in multinode job +ip_addr="`hostname -I`" +if test $? -ne 0; then exit 1; fi + +#Request agent just before we need it +#This would be two keys in one agent if we wanted one for source, one for job +echo "*** WAITING FOR AGENT: ${ip_addr}" +echo "ssh -o ControlMaster=no -o ControlPath=/dev/null -A ${ip_addr}.lab 'ln -sf \ [...] +while ! test -e ~/data/socket; do + inotifywait -e create ~/data +done +export SSH_AUTH_SOCK=~/data/socket + +target_ip="${ip_addr}" +lava_name="`hostname`" #TODO: hack - lava hostname doesn't have to match the Linux [...] + +#Check that target is accessible, add it to our known_hosts, +#add our one-time key to its authorized_keys +if ! cat ~/.ssh/id_rsa.pub | ssh -o StrictHostKeyChecking=no "${target_ip}" "cat - [...] +echo "Could not access target ${target_ip} (${lava_name})" >&2 +exit 1 +fi + +#Generate configuration files for target +target_type="$(echo ${lava_name} | sed 's/[[:digit:]]*$//')" #TODO: HACK +if test $? -ne 0; then echo "Failed to find target type from ${lava_name}"; exit 1; fi +sed "s/^ip=.*/ip=${target_ip}/" "${ABE_DIR}/config/bench/boards/${target_type}.con [...] +if test $? -ne 0; then echo "Failed to generate config file for target ${lava_name [...] + +cp "${ABE_DIR}/config/bench/boards/${target_type}.services" "${ABE_DIR}/config/ben [...] +if test $? -ne 0; then echo "Failed to generate services file for target ${lava_na [...] + +export targets="${lava_name}" + +echo "Running benchmark... I may be some time" +if ! "${ABE_DIR}"/scripts/Benchmark.job; then + echo "Benchmark run failed" >&2 + echo "ssh -o ControlMaster=no -o ControlPath=/dev/null ${ip_addr}.lab" + error=1 + exit +fi + +echo "*** RESULTS READY" +echo "ssh -o ControlMaster=no -o ControlPath=/dev/null ${ip_addr}.lab" +echo "ssh -o ControlMaster=no -o ControlPath=/dev/null ${ip_addr}.lab 'touch ~/dat [...] +while ! test -e ~/data/resultsgone; do + inotifywait -e create ~/data +done + +error=0 +exit diff --git a/config/bench/lava/local-session.yaml b/config/bench/lava/local-session.yaml new file mode 100644 index 0000000..07f1b66 --- /dev/null +++ b/config/bench/lava/local-session.yaml @@ -0,0 +1,42 @@ +metadata: + name: bench-session-debian + format: "Lava-Test-Shell Test Definition 1.0" + description: "Benchmarking Session" + version: 1.0 + +params: + PUB_KEY: None + BENCHMARK: fakebench + TOOLCHAIN: https://releases.linaro.org/14.11/components/toolchain/binaries/arm [...] + RUN_FLAGS: None + COMPILER_FLAGS: None + MAKE_FLAGS: None + PREBUILT: None + BENCH_DEBUG: None + +install: + deps: + - autogen + - binutils + - bison + - cpufrequtils + - dejagnu + - flex + - gawk + - gcc + - gcc-multilib + - g++-multilib + - git + - inotify-tools + - libgfortran3 + - libncurses5-dev + - make + - openssh-server + - rsync + - texinfo + - wget + - xz-utils +run: + steps: + - ./config/bench/lava/setup "$PUB_KEY" + - env ABE_DIR=`pwd` BENCH_DEBUG="$BENCH_DEBUG" ./config/bench/lava/local-s [...]