diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-02-12 09:12:36 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-02-18 15:31:20 +0000 |
commit | 2689c8ee9739fd60d3fa184f1c666f7131d4e999 (patch) | |
tree | 3ac6efff2dde0f2317f5216acbde42f969635449 /round-robin.sh | |
parent | 5cbc7baf0af498c6b57789ebc9f41100e6a2c3eb (diff) |
[rr-many 1/N]: Support testing multiple projects in the same build
This patch series is both a major cleanup and an optimization of
round-robin jobs. We switch from testing each component
(binutils, gcc, linux) in separate builds in round-robin fashion
to testing all components in the same build, and, if there's
a failure, re-triggering builds for individual components like
we are doing now. Then if individual build fails, it triggers
bisect on that one component.
The cleanup part is that jenkins triggers are greatly simplified
and we can remove all trigger jobs (of which we had hundreds).
The optimization part is that successful builds (which is
the majority) now consume N times less resources, where N is
the number of components -- 3 in case of binutils, gcc, linux, --
because all components are updated and tested in the same build.
This patch is the first in the series, and it replaces uses of
$current_project and $current_branch with "baseline" keyword
of components' branches. I.e., for testing LLVM in LLVM+Kernel
jobs we currently use
==rr[llvm_branch] master ==rr[linux_branch] master \
==rr[current_project] llvm ==rr[current_branch] SHA1
and it will change to
==rr[llvm_branch] SHA1 ==rr[linux_branch] baseline
. IMO, the latter is significantly more intuitive.
Change-Id: Ib47dcac1571381f870150e4872ec37be5d900a07
Diffstat (limited to 'round-robin.sh')
-rw-r--r-- | round-robin.sh | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/round-robin.sh b/round-robin.sh index e4ff41a0..1fdd27de 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -7,6 +7,11 @@ #rr[PROJECT_url] # PROJECT's git branch or SHA1 revision parsable by git rev-parse. +# A special value "baseline" means that PROJECT is not being updated +# in this build, and its baseline branch should be used. +# In a successful build "update_baseline" step will update baseline +# branches of all PROJECTs to the current values, thus setting +# a baseline for the next build. #rr[PROJECT_branch] # PROJECT's git SHA1 revision. These are mostly used in manifests. @@ -16,13 +21,6 @@ # be present in all above git repos (if ${rr[init_configuration]} is false). #rr[baseline_branch]="${rr[ci_project]}/${rr[ci_config]}" -# PROJECT that we are testing in this build. Use ${rr[current_branch]} for -# this project, and ${rr[baseline_branch]} for all other projects. -#rr[current_project]="$current_project" - -# Git branch or SHA1 revision of ${rr[current_project]} to test. -#rr[current_branch]="$current_branch" - # Run mode: bisect or non-bisect. In bisect mode we do a couple things # slightly differently (e.g., don't touch repo in clone_repo() ). #rr[mode]="$mode" @@ -40,6 +38,40 @@ # to initialize baseline branches in git repos. #rr[init_configuration]=false +# Print round-robin components that are being updated in this build +# (the ones using non-baseline branches). +print_updated_components () +{ + ( + set -euf -o pipefail + + local delim="" + local c + for c in ${rr[components]}; do + if [ x"${rr[${c}_branch]}" != x"baseline" ]; then + printf "%s%s" "$delim" "$c" + delim=${1- } + fi + done + ) +} + +# Print the single round-robin component being updated in this build. +# Print nothing if multiple components are being updated. +print_single_updated_component () +{ + ( + set -euf -o pipefail + + local -a updated_components + updated_components=($(print_updated_components)) + + if [ ${#updated_components[@]} = 1 ]; then + echo "${updated_components[0]}" + fi + ) +} + # Reset artifacts to an empty state. ${rr[top_artifacts]}/results is the most # important artifact, since it records the metric of how successful the build # is. |