summaryrefslogtreecommitdiff
path: root/tcwg_kernel-build.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-12 09:12:36 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-18 15:31:20 +0000
commit2689c8ee9739fd60d3fa184f1c666f7131d4e999 (patch)
tree3ac6efff2dde0f2317f5216acbde42f969635449 /tcwg_kernel-build.sh
parent5cbc7baf0af498c6b57789ebc9f41100e6a2c3eb (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 'tcwg_kernel-build.sh')
-rwxr-xr-xtcwg_kernel-build.sh29
1 files changed, 17 insertions, 12 deletions
diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh
index ab169e5b..dabc2995 100755
--- a/tcwg_kernel-build.sh
+++ b/tcwg_kernel-build.sh
@@ -4,6 +4,7 @@ set -euf -o pipefail
scripts=$(dirname $0)
. $scripts/jenkins-helpers.sh
+. $scripts/round-robin.sh
convert_args_to_variables "$@"
@@ -12,18 +13,10 @@ obligatory_variables rr[ci_config]
# Execution mode: baseline, bisect, continue, jenkins-full
rr[mode]="${rr[mode]-baseline}"
-case "${rr[mode]}" in
- "jenkins-full")
- obligatory_variables rr[current_project] rr[current_branch]
- ;;
-esac
-
# Set custom revision for one of the projects, and use baseline revisions
# for all other projects.
rr[ci_project]="${rr[ci_project]-tcwg_kernel}"
rr[baseline_branch]="${rr[baseline_branch]-linaro-local/ci/${rr[ci_project]}/${rr[ci_config]}}"
-rr[current_branch]="${rr[current_branch]-default}"
-rr[current_project]="${rr[current_project]-none}"
rr[reset_baseline]="${rr[reset_baseline]-false}"
rr[top_artifacts]="${rr[top_artifacts]-$(pwd)/artifacts}"
@@ -35,6 +28,18 @@ rr[toolchain]=${rr[toolchain]-${ci_config[0]}}
rr[target]=${rr[target]-${ci_config[2]}}
rr[linux_config]=${rr[linux_config]-${ci_config[4]}}
+case "${rr[toolchain]}" in
+ llvm) rr[components]="llvm linux" ;;
+ gnu) rr[components]="binutils gcc linux" ;;
+ *) assert false ;;
+esac
+
+# Use baseline branches by default.
+for c in ${rr[components]}; do
+ rr[${c}_branch]=${rr[${c}_branch]-baseline}
+ obligatory_variables rr[${c}_url]
+done
+
start_at="${start_at-default}"
finish_at="${finish_at-default}"
verbose="${verbose-true}"
@@ -53,12 +58,13 @@ case "${rr[mode]}" in
default_finish_at="update_baseline"
;;
"bisect")
- case "${rr[toolchain]}:${rr[current_project]}" in
+ case "${rr[toolchain]}:$(print_single_updated_component)" in
gnu:binutils) default_start_at="build_abe-binutils" ;;
gnu:gcc) default_start_at="build_abe-stage1" ;;
gnu:linux) default_start_at="count_linux_objs" ;;
llvm:llvm) default_start_at="build_llvm" ;;
llvm:linux) default_start_at="count_linux_objs" ;;
+ *) assert false ;;
esac
default_finish_at="check_regression"
;;
@@ -81,8 +87,6 @@ fi
run_step_init "$start_at" "$finish_at" "${rr[top_artifacts]}" "$base_artifacts_opt" "$verbose"
-. $scripts/round-robin.sh
-
# Build Linux kernel
build_linux ()
{
@@ -114,7 +118,8 @@ build_linux ()
# Otherwise the compiler is new in every build and we would
# only clobber ccache volume.
local ccache=""
- if [ x"${rr[mode]}" != x"jenkins-full" -a x"${rr[current_project]}" = x"linux" ]; then
+ if [ x"${rr[mode]}" != x"jenkins-full" \
+ -a x"$(print_single_updated_component)" = x"linux" ]; then
ccache="ccache"
fi
cat > $(pwd)/bin/${rr[target]}-cc <<EOF