summaryrefslogtreecommitdiff
path: root/tcwg_bmk-build.sh
diff options
context:
space:
mode:
authorLaurent Alfonsi <laurent.alfonsi@linaro.org>2023-06-23 07:23:22 +0000
committerLaurent Alfonsi <laurent.alfonsi@linaro.org>2023-06-23 07:23:40 +0000
commit34aa41215869b4eb5ed21b1208af9972db958253 (patch)
tree292bfa45cded0614836ec09ab1fc551d5043ae96 /tcwg_bmk-build.sh
parent6c89b83cbf8fd40f3bc7ce7157a18181aeda1339 (diff)
Revert "round-robin.sh,tcwg_bmk-build.sh,tcwg-benchmark-results.sh: Store bare bmk results in artifacts"
This reverts commit 4b36216d70e60de56e321d0b403020d27c2d44fe. Reason for revert: pb with ci job deployment make it bancal Change-Id: I89f94a89a0267780c7e119d03a0ab17908625310
Diffstat (limited to 'tcwg_bmk-build.sh')
-rwxr-xr-xtcwg_bmk-build.sh64
1 files changed, 28 insertions, 36 deletions
diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh
index 291abea2..d2214994 100755
--- a/tcwg_bmk-build.sh
+++ b/tcwg_bmk-build.sh
@@ -304,7 +304,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_id="$results_id" \
-p reboot="$reboot" \
-p run_profile="$run_profile" \
-p image_arch="$image_arch" \
@@ -371,7 +371,14 @@ compare_results ()
set -euf -o pipefail
local metric_id="$1"
- local cmp_options="$2"
+ local ref_results_id="$2"
+ local new_results_id="$3"
+ local cmp_options="$4"
+
+ assert_with_msg "ERROR: No $new_results_id file" [ -f $new_results_id ]
+
+ local results_ref results_new
+ results_new=$(cat $new_results_id)
case "${rr[target]}" in
"arm_eabi")
@@ -387,37 +394,13 @@ compare_results ()
sudo /usr/lib/linux-tools/install-armhf-perf-workaround.sh
fi
- local results_ref results_new
- results_new="${rr[top_artifacts]}/annex/bmk-data"
-
- local ref_results_id=${rr[base_artifacts]}/results_id
- if ! [ -f $ref_results_id ] && ! [ -d "${rr[base_artifacts]}/annex/bmk-data" ]; then
- # base-artifacts has no reference results, neither in results_id nor in annex
- # This can happen on initialization of base-artifacts (update_baseline=init)
- # or in corner-cases like forced build failing during toolchain build.
- # In such cases we compare results to themselves just as an exercise.
- results_ref=$results_new
- elif [ -d "${rr[base_artifacts]}/annex/bmk-data" ]; then
- # Results are part of the annex of the base-artifacts
- results_ref="${rr[base_artifacts]}/annex/bmk-data"
- # Import this annex locally
- git -C base-artifacts annex init
- git_set_remote base-artifacts "bkp-01" \
- "ssh://bkp-01.tcwglab/home/tcwg-benchmark/base-artifacts"
- git -C base-artifacts annex get annex
- else
- # FIXME :
- # Otherwise, getting it from bkp-01:/home/tcwg-benchmark/results-.
- # Probably a builds not using bmk results in annex dir.
- # This may be useless at some point, once all results are part of base-artifacts annex.
- results_ref="${rr[base_artifacts]}/annex/bmk-data"
- mkdir -p $results_ref
- rsync -az --delete "bkp-01.tcwglab:/home/tcwg-benchmark/results-$(cat $ref_results_id)/" \
- $results_ref/
+ if ! [ -f $ref_results_id ]; then
+ # There's no ref metrics, only a new metrics. We don't try to
+ # generate results.csv, and we consider it as a non-regression.
+ return 0
fi
- assert_with_msg "ERROR: No result dir $results_new" [ -d $results_new ]
- assert_with_msg "ERROR: No reference dir $results_ref" [ -d $results_ref ]
+ results_ref=$(cat $ref_results_id)
# Compare vs previous run
mkdir -p ${rr[top_artifacts]}/results-vs-prev
@@ -425,8 +408,7 @@ compare_results ()
$scripts/tcwg-benchmark-results.sh \
--results_ref $results_ref ++results $results_new \
--top_artifacts "${rr[top_artifacts]}/results-vs-prev" \
- --verbose $verbose --hw_tag "$(tcwg_bmk_hw)" \
- $cmp_options \
+ --verbose $verbose $cmp_options \
> ${rr[top_artifacts]}/results-vs-prev/tcwg-benchmark-results.log 2>&1 &
local res
@@ -488,9 +470,6 @@ compare_results ()
cp $resfile ${rr[top_artifacts]}/notify/
fi
done
-
- assert_with_msg "Found a regression while comparing the build against itself" \
- [ "$results_new" != "$results_ref" ]
)
}
@@ -516,6 +495,16 @@ no_regression_p ()
assert_with_msg "Benchmarking succeeded, but results_id is missing" \
[ -f $run_step_top_artifacts/results_id ]
+ local ref_results_id=base-artifacts/results_id
+ if ! [ -f $ref_results_id ]; then
+ # Absent reference results can happen on initialization of
+ # base-artifacts state or in corner-cases like forced build
+ # failing during toolchain build.
+ # In such cases we compare results to themselves just as
+ # an exercise.
+ ref_results_id=$run_step_top_artifacts/results_id
+ fi
+
# Make sure there is no stray results.regression file, which we use
# as failure marker.
assert ! [ -f $run_step_artifacts/results.regressions ]
@@ -530,9 +519,12 @@ no_regression_p ()
# - ref/results_id might not exist, (ex: baseline score<0)
# we call compare_results to generate the csv, and check metric regressions.
compare_results "$metric_id" \
+ "$ref_results_id" "$run_step_top_artifacts/results_id" \
"$compare_opts"
if [ -f $run_step_artifacts/results.regressions ]; then
+ assert_with_msg "Found a regression while comparing the build against itself" \
+ [ "$ref_results_id" != "$run_step_top_artifacts/results_id" ]
return 1
fi
return 0