diff options
author | Laurent Alfonsi <laurent.alfonsi@linaro.org> | 2023-06-30 10:47:43 +0200 |
---|---|---|
committer | Laurent Alfonsi <laurent.alfonsi@linaro.org> | 2023-06-30 13:33:53 +0000 |
commit | b0681edc6ba05537ae6b2d0eb568be1864b84010 (patch) | |
tree | d31a8c936aa0ac4235087f77071ad85f25609d16 /tcwg_bmk-build.sh | |
parent | f0c6b92e22e24b8ecea986f9610ecbddb7171377 (diff) |
tcwg_bmk-build.sh: Fix place where to store the bmk results
- remove ssh:// from results_dest,
- use absolute path,
- create a dir in the workspace where tcwg-benchmark can write,
- sync it in artifacts/annex,
- and remove it afterwards.
Change-Id: I1831cd2a4d42ca001fa78f89805953dcd9c306b9
Diffstat (limited to 'tcwg_bmk-build.sh')
-rwxr-xr-x | tcwg_bmk-build.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh index 3309397c..67d69495 100755 --- a/tcwg_bmk-build.sh +++ b/tcwg_bmk-build.sh @@ -286,7 +286,10 @@ benchmark () *) echo "ERROR: Unknown hw_tag $hw_tag"; exit 1 ;; esac - local results_id="$hw_tag/${rr[ci_project]}/${rr[ci_config]}-${rr[mode]}/@build_num@" + # we create a tmpdir in /tmp + local results_dir + results_dir="$(mktemp -d -p /tmp)" + chmod g+w $results_dir # Trigger benchmarking job and capture its console output. # Ignore exit code of the trigger command to detect various failure @@ -304,7 +307,7 @@ benchmark () -p toolchain_url=$toolchain_proto://$ssh_host:$ssh_port:$cc \ -p toolchain_type=$toolchain \ -p sysroot="$sysroot" \ - -p results_dest="ssh://$ssh_host:$ssh_port:${rr[top_artifacts]}/annex/bmk-data" \ + -p results_dest="$ssh_host:$ssh_port:$results_dir" \ -p reboot="$reboot" \ -p run_profile="$run_profile" \ -p image_arch="$image_arch" \ @@ -312,6 +315,17 @@ benchmark () ${bmk_branch+-p bmk_branch="$bmk_branch"} \ | tee $run_step_artifacts/benchmark-build.log || true + # copy bmk results into artifacts/annex/bmk-data/ + rm -rf ${rr[top_artifacts]}/annex/bmk-data/ + mkdir -p ${rr[top_artifacts]}/annex/bmk-data/ + rsync -rv $results_dir/ ${rr[top_artifacts]}/annex/bmk-data/ + + # make sure we are deleting a /tmp/xxx directory before forcing with sudo, + # and ignore error if any + if [[ "$results_dir" =~ ^/tmp/ ]]; then + sudo -n rm -rf "$results_dir" || true + fi + local build_num build_num=$(head -n1 $run_step_artifacts/benchmark-build.log \ | sed -e "s/Started.*#\([0-9]\+\).*/\1/") @@ -356,7 +370,7 @@ benchmark () | tee $run_step_artifacts/benchmark.log done - echo "$results_id" | sed -e "s/@build_num@/$build_num/g" \ + echo "$hw_tag/${rr[ci_project]}/${rr[ci_config]}-${rr[mode]}/$build_num" \ > "$results_id_file" return $build_ret |