diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-15 08:40:35 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-02-10 07:32:45 +0000 |
commit | a0f9261b99ab947fc997d32d2397734f18b10471 (patch) | |
tree | 558d7e0ff3162222d12d341c16349fb6ce0a01cd /tcwg-benchmark-bare.sh | |
parent | 4fef6c7e04e891b0222854d7fee726168c807d32 (diff) |
tcwg-benchmark-bare.sh: Fix environment setup for coremark.sh
Change-Id: Ice790451e133767663ec93f8cbe73983ea70e70b
Diffstat (limited to 'tcwg-benchmark-bare.sh')
-rwxr-xr-x | tcwg-benchmark-bare.sh | 74 |
1 files changed, 16 insertions, 58 deletions
diff --git a/tcwg-benchmark-bare.sh b/tcwg-benchmark-bare.sh index c90528b3..75e9f753 100755 --- a/tcwg-benchmark-bare.sh +++ b/tcwg-benchmark-bare.sh @@ -12,9 +12,9 @@ toolchain_type="${toolchain_type-auto}" bench_list="$bench_list" cflags="$cflags" ldflags="$ldflags" -sysroot="$sysroot" +fileserver="$fileserver" forceinstall="$forceinstall" -builder="$builder" +results_id="$results_id" BUILD_NUMBER="$BUILD_NUMBER" NODE_NAME="$NODE_NAME" WORKSPACE="$WORKSPACE" @@ -23,26 +23,8 @@ WORKSPACE="$WORKSPACE" # so enable "set -u" only after above binding of variables. set -u -if echo "$builder" | grep -q ".*-[0-9]\+"; then - docker_host_opt="--arch amd64 --node $builder" -else - docker_host_opt="--label $builder" -fi - . jenkins-helpers.sh -# Start a container to run the benchmarks in. -# The board is connected to the slave via USB, the container needs -# special rights to access it. -./start-container-docker.sh \ - $docker_host_opt \ - --distro "$bench_container_tag" \ - --task bench \ - --docker_opts "--privileged -v /dev/bus/usb:/dev/bus/usb" \ - --prefix run_ > run-container.sh -trap "cleanup_all_containers" EXIT -. ./run-container.sh - # If $toolchain_url is of ssh:// type, don't create a remote build # container, just use the ssh command as provided. build_container_host= @@ -87,10 +69,6 @@ esac case "$toolchain_url" in "ssh://"*) - if [ x"$sysroot" = x"tarball" ]; then - echo "ERROR: Unsupported sysroot $sysroot for toolchain_url $toolchain_url" - exit 1 - fi # Last component of ccprefix is the path, keep it toolchaindir="$(dirname ${ccprefix##*:})" ;; @@ -178,38 +156,6 @@ case "$toolchain_url" in ;; esac -case "$sysroot" in - "tarball") - sysroot="$build_container_host:$build_container_port:$(find "$toolchaindir" -name "libc")" - ;; - "http://"*|"https://"*) - sysrootdir=$(untar_url "$sysroot" "$WORKSPACE" "--strip-components 1") - # Copy toolchain to the build container. - rsync -a --delete -e "ssh -p$build_container_port" "$sysrootdir/" "$build_container_host:$sysrootdir/" - #sysroot="$build_container_host:$build_container_port:$sysrootdir" - ;; - "ssh://"*) - sysroot="${sysroot##ssh://}" - - # Check host:port specification from sysroot. - case ${sysroot} in - *:*) ;; - *) - echo "ERROR: ssh:// sysroot lacks a host: $sysroot" - exit 1 - ;; - esac - ;; - - "") - # Use system sysroot. - ;; - *) - echo "ERROR: Cannot handle sysroot: $sysroot" - exit 1 - ;; -esac - results_id=$(echo "$results_id" \ | sed -e "s/<build_num>/$BUILD_NUMBER/g" \ -e "s/@build_num@/$BUILD_NUMBER/g") @@ -219,19 +165,31 @@ if echo "$results_id" | grep -q "\.\."; then exit 1 fi case "$hw_tag" in - STM32*) ;; + stm32*) ;; *) echo "ERROR: results_id does not start with a valid hw_tag" exit 1 ;; esac +# Start a container to run the benchmarks in. +# The board is connected to the slave via USB, the container needs +# special rights to access it. +./start-container-docker.sh \ + --newuser $USER \ + --distro "$bench_container_tag" \ + --task bench \ + --docker_opts "--privileged -v /dev/bus/usb:/dev/bus/usb" \ + --prefix run_ > run-container.sh +trap "cleanup_all_containers" EXIT +. ./run-container.sh + # vars are from run-container.sh sourced above # shellcheck disable=SC2154 case "$bench_list" in *coremark*) remote_exec "$run_container_host:$run_container_port:$WORKSPACE/bmk-scripts:-t -Snone" \ - "$(pwd)/bmk-scripts/coremark.sh" \ + "./coremark.sh" \ --ccprefix "$ccprefix" \ --cflags "$cflags" \ --ldflags "$ldflags" \ |