From 3fc3100497de6c8887e3a1d815cd2b8227207352 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Fri, 18 Jan 2019 16:16:57 +0000 Subject: tcwg-benchmark.sh: Add support for :parallelize parameter in ccprefix. We just need to keep this parameter if present, and pass it to run.sh unchanged. Just take care that the path component in a ssh:// toolchain is always the last one. Change-Id: I581af110e4df06adce5fcdfb3ae722ea74fc6451 --- tcwg-benchmark.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh index 0b1e125e..a544a5f0 100755 --- a/tcwg-benchmark.sh +++ b/tcwg-benchmark.sh @@ -46,7 +46,9 @@ case "$toolchain_url" in "ssh://"*) ccprefix="${toolchain_url##ssh://}" - # Extract host:port: specification from ccprefix. + # Extract host:port: specification from ccprefix, we don't + # need to care about :parallelize here, just pass it to run.sh + # if present. case ${ccprefix} in *:*:*) build=${ccprefix%:*} @@ -92,7 +94,8 @@ case "$toolchain_url" in echo "ERROR: Unsupported sysroot $sysroot for toolchain_url $toolchain_url" exit 1 fi - toolchaindir="$(dirname $(echo $ccprefix | cut -s -d: -f 3))" + # Last component of ccprefix is the path, keep it + toolchaindir="$(dirname ${ccprefix##*:})" ;; "http://"*".tar.xz"|"https://"*".tar.xz") toolchaindir=$(untar_url "$toolchain_url" "$WORKSPACE" "--strip-components 1") -- cgit v1.2.3 From 3323a972727c91c9df0ffc7328ab4eaedfe497e1 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Tue, 22 Jan 2019 11:16:11 +0000 Subject: tcwg_kernel-bisect.sh: Don't force $reproduce_bisect==true in the manifest Setting $reproduce_bisect to true has the effect of bisect being reproduced exactly as the original one, and expects manifests of all test builds to be present. While this is useful, the common case is to reproduce a bisect that went wrong, so the reproduction will diverge from the initial bisection. Therefore to reproduce the common case use (assuming original artifacts in archive directory) ./jenkins-scripts/tcwg_kernel-bisect.sh @@ archive/artifacts/manifests/bisect.sh -- @@ archive/artifacts/manifests/build-parameters.sh and to reproduce bisect exactly use ./jenkins-scripts/tcwg_kernel-bisect.sh @@ archive/artifacts/manifests/bisect.sh --reproduce_bisect true Change-Id: Ie6aa842d9949fad2298b1d56d74973e61541836a --- tcwg_kernel-bisect.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index 24a0917b..acfc20c2 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -60,12 +60,6 @@ ln -f -s "build-baseline" "$artifacts/build-$baseline_rev" ln -f -s "build-baseline.sh" "$artifacts/manifests/build-$baseline_rev.sh" echo "$baseline_rev" >> $artifacts/good_revs -cat < Date: Wed, 23 Jan 2019 14:01:09 +0000 Subject: tcwg_kernel-bisect.sh: Simplify checking first_bad's parents Add a quick exit path to the $artifacts/test.sh script, which simplifies checking of first_bad's parents. Remove list of skipped_revs since we are not using it. Change-Id: I3d8601bafcbf1501239fa5a097830181b327454c --- tcwg_kernel-bisect.sh | 86 +++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 48 deletions(-) diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index acfc20c2..2bde3c3f 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -84,9 +84,21 @@ echo "$baseline_rev" >> $artifacts/good_revs # skip revisions between rev_20 and rev_22. This might cause other edge # cases to be handled sub-optimally, though. cat > $artifacts/test.sh <> $rel_artifacts/bad_revs exit 1 -elif [ x"\$res" != x"0" ]; then - echo "\$rev" >> $rel_artifacts/skipped_revs - exit 125 else echo "\$rev" >> $rel_artifacts/good_revs exit 0 @@ -192,15 +202,8 @@ if [ x"$res" = x"0" ]; then first_bad=$(cat .git/BISECT_RUN | head -n 1 | grep "is the first bad commit" | cut -d" " -f 1) assert [ x"$first_bad" != x"" ] + res=0 for last_good in $(git rev-parse $first_bad^@); do - if grep -q $last_good "$artifacts/good_revs"; then - # One of immediate parrents of $first_bad tested good. - break - fi - last_good="" - done - if [ x"$last_good" = x"" ]; then - # None of immediate parents of $first_bad tested as good. # It seems that git-bisect assumes parent commit as "good" on # the basis of one of its children being "good". Therefore we # can have a situation when we have parent P with children C1 and C2, @@ -209,45 +212,32 @@ if [ x"$res" = x"0" ]; then # and it knows CB is "bad", so git-bisect returns C1 as the first bad # commit. # To simplify investigations we explicitly test parent of $first_bad. - res=0 - for last_good in $(git rev-parse $first_bad^@); do - if grep -q $last_good "$artifacts/bad_revs" "$artifacts/skipped_revs"; then - echo "First_bad's parent $last_good has tested bad or skipped" - last_good="" - continue - fi - if [ x"$(git merge-base $merge_base $last_good)" != x"$merge_base" ]; then - echo "First_bad's parent $last_good is outside of bisect scope" - last_good="" - continue - fi - echo "Testing first_bad's parent $last_good (hoping for success)" - git checkout --detach "$last_good" - $artifacts/test.sh & - res=0 && wait $! || res=$? - if [ x"$res" = x"0" ]; then - break - fi - done - if [ x"$res" != x"0" ]; then - # It seems $last_good was on a path that tested good, even though - # it itself is bad. We re-trigger the bisection job with updated - # parameters. - # We need to be careful to avoid re-trigger loops, so verify that - # last_good is an ancestor of bad_rev. - assert [ x"$(git rev-list $last_good ^$bad_rev)" = x"" ] - cat > $artifacts/trigger-0-bisect-again < $artifacts/trigger-0-bisect-again < $artifacts/jenkins/mail-recipients.txt - touch $artifacts/jenkins/build-name - sed -i -e "s/\$/-retry/" $artifacts/jenkins/build-name - trap "" EXIT - exit 0 - fi + # Don't send any emails. + echo > $artifacts/jenkins/mail-recipients.txt + touch $artifacts/jenkins/build-name + sed -i -e "s/\$/-last_good-bad/" $artifacts/jenkins/build-name + trap "" EXIT + exit 0 fi echo $first_bad > $artifacts/first-bad -- cgit v1.2.3 From a0698db2d98eb6e0fa186ce7964c5c813fae5e48 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 23 Jan 2019 14:08:32 +0000 Subject: tcwg_kernel-bisect.sh: Simplify linux-next rebase workaround Linux-next:master rebases almost every day on top of the Linus's tree (aka linux-next:stable), which creates problems for bisections. We have tried to workaround these rebases, but results are still not ideal. This patch reworks (and simplifies!) handling of linux-next. The goal of testing linux-next:master is to detect regressions before they reach Linus's tree (linux-next:stable). Therefore, we are really only interested in regressions between linux-next:stable and linux-next:master (regressions in Linus's tree will be bisected in another job anyway). So the new workaround is to force baseline_rev to linux-next:stable and be done with it! This also allows us to remove confusing distinction between baseline_rev and good_rev. Change-Id: I96002f1d21f68e353c0b62837c4968bf956ecbf2 --- tcwg_kernel-bisect.sh | 93 +++++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 59 deletions(-) diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index 2bde3c3f..196633a4 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -39,6 +39,24 @@ if $verbose; then set -x; fi trap "eval \"echo ERROR at \${FUNCNAME[0]}:\${BASH_LINENO[0]}\" > $artifacts/failures" EXIT +rebase_workaround=false + +if [ x"$ci_project" = x"tcwg_kernel" ] \ + && [ x"$current_project" = x"linux" -a x"${rr[linux_version]}" = x"next" ]; then + # Workaround linux-next/master rebasing on top of linux-next/stable. + # Search for regressions against linux-mainline:master (aka linux-next:stable). + clone_or_update_repo $current_project stable ${rr[linux_url]} + # Just in case linux-next:stable has advanced between the build and bisect jobs, + # use merge base between linux-next:stable and $bad_rev. + linux_next_stable="${linux_next_stable-$(git -C $current_project merge-base HEAD $bad_rev)}" + cat < /dev/null 2>&1 || true - git remote set-url mainline "$url" - clone_or_update_repo . refs/remotes/mainline/master "$url" - mainline_master="${mainline_master-$(git merge-base $bad_rev HEAD)}" - cat < $artifacts/trigger-2-build-master < $artifacts/trigger-2-build-master < $artifacts/jenkins/mail-recipients.txt trap "" EXIT exit 0 fi @@ -187,7 +162,7 @@ fi ln -f -s "build-$bad_rev" "$artifacts/build-bad" ln -f -s "build-$bad_rev.sh" "$artifacts/manifests/build-bad.sh" -git bisect start $bad_rev $good_rev 2>&1 | tee $artifacts/bisect.log +git bisect start $bad_rev $baseline_rev 2>&1 | tee $artifacts/bisect.log # "git bisect run" can fail (exit with non-zero) in a number of cases: # - on trivial bisects (e.g., between HEAD^ and HEAD), @@ -244,10 +219,10 @@ EOF else first_bad=$(git rev-parse HEAD) if ! [ -f .git/BISECT_LOG ]; then - # It seems this was a trivial bisect with $bad_rev^ == $good_rev. + # It seems this was a trivial bisect with $bad_rev^ == $baseline_rev. first_bad=$bad_rev last_good=$(git rev-parse $first_bad^) - assert [ x"$last_good" = x"$good_rev" ] + assert [ x"$last_good" = x"$baseline_rev" ] echo $first_bad > $artifacts/first-bad fi @@ -284,8 +259,8 @@ $(git -C $current_project log -n 1 $first_bad) EOF else - good_name="good_rev" - good_sha1="$good_rev" + good_name="baseline_rev" + good_sha1="$baseline_rev" bad_name="bad" bad_sha1="$bad_rev" cat >> $artifacts/jenkins/mail-body.txt < Date: Fri, 25 Jan 2019 09:28:05 +0000 Subject: tcwg_kernel/*: Remove unused configuration files. With improvements to manifest handling we haven't been using these configuration files for a few weeks now. Change-Id: I6815ad457119dee055e62b669958de058ac13e97 --- tcwg_kernel/gnu-master.sh | 9 --------- tcwg_kernel/gnu-release.sh | 9 --------- tcwg_kernel/linux-lts.sh | 7 ------- tcwg_kernel/linux-mainline.sh | 7 ------- tcwg_kernel/linux-next.sh | 7 ------- tcwg_kernel/linux-stable.sh | 7 ------- tcwg_kernel/llvm-master.sh | 7 ------- tcwg_kernel/llvm-release.sh | 7 ------- 8 files changed, 60 deletions(-) delete mode 100644 tcwg_kernel/gnu-master.sh delete mode 100644 tcwg_kernel/gnu-release.sh delete mode 100644 tcwg_kernel/linux-lts.sh delete mode 100644 tcwg_kernel/linux-mainline.sh delete mode 100644 tcwg_kernel/linux-next.sh delete mode 100644 tcwg_kernel/linux-stable.sh delete mode 100644 tcwg_kernel/llvm-master.sh delete mode 100644 tcwg_kernel/llvm-release.sh diff --git a/tcwg_kernel/gnu-master.sh b/tcwg_kernel/gnu-master.sh deleted file mode 100644 index 1621a04c..00000000 --- a/tcwg_kernel/gnu-master.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[gnu_version]=master -rr[binutils_url]=git://sourceware.org/git/binutils-gdb.git -rr[binutils_rev]=master -rr[gcc_url]=git://gcc.gnu.org/git/gcc.git -rr[gcc_rev]=master diff --git a/tcwg_kernel/gnu-release.sh b/tcwg_kernel/gnu-release.sh deleted file mode 100644 index 3c8728fa..00000000 --- a/tcwg_kernel/gnu-release.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[gnu_version]=release -rr[binutils_url]=git://sourceware.org/git/binutils-gdb.git -rr[binutils_rev]=binutils-2_31-branch -rr[gcc_url]=git://gcc.gnu.org/git/gcc.git -rr[gcc_rev]=gcc-8-branch diff --git a/tcwg_kernel/linux-lts.sh b/tcwg_kernel/linux-lts.sh deleted file mode 100644 index b849f02c..00000000 --- a/tcwg_kernel/linux-lts.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[linux_version]=lts -rr[linux_url]=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git -rr[linux_rev]=linux-4.14.y diff --git a/tcwg_kernel/linux-mainline.sh b/tcwg_kernel/linux-mainline.sh deleted file mode 100644 index 983d69e9..00000000 --- a/tcwg_kernel/linux-mainline.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[linux_version]=mainline -rr[linux_url]=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git -rr[linux_rev]=master diff --git a/tcwg_kernel/linux-next.sh b/tcwg_kernel/linux-next.sh deleted file mode 100644 index 585e9c1b..00000000 --- a/tcwg_kernel/linux-next.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[linux_version]=next -rr[linux_url]=git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git -rr[linux_rev]=master diff --git a/tcwg_kernel/linux-stable.sh b/tcwg_kernel/linux-stable.sh deleted file mode 100644 index 48cc61f7..00000000 --- a/tcwg_kernel/linux-stable.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[linux_version]=stable -rr[linux_url]=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git -rr[linux_rev]=linux-4.18.y diff --git a/tcwg_kernel/llvm-master.sh b/tcwg_kernel/llvm-master.sh deleted file mode 100644 index 70f1a0c4..00000000 --- a/tcwg_kernel/llvm-master.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[llvm_version]=master -rr[llvm_url]=https://github.com/llvm-project/llvm-project-20170507.git -rr[llvm_rev]=master diff --git a/tcwg_kernel/llvm-release.sh b/tcwg_kernel/llvm-release.sh deleted file mode 100644 index 8653e670..00000000 --- a/tcwg_kernel/llvm-release.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -declare -gA rr - -rr[llvm_version]=release -rr[llvm_url]=https://github.com/llvm-project/llvm-project-20170507.git -rr[llvm_rev]=release_70 -- cgit v1.2.3 From e69a96373768534eefb0b05244f1b61fbbc75ba3 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Mon, 28 Jan 2019 09:47:21 +0000 Subject: tcwg_kernel-bisect.sh: Add configuration details to the email body Add an excerpt from manifest listing git URLs and branches (and avoid entries like rr[gcc_url]="no_gcc_url"). E.g., === Configuration details: rr[llvm_url]="https://github.com/llvm/llvm-project.git" rr[llvm_branch]="master" rr[linux_url]="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" rr[linux_branch]="master" === Also, don't include bisection range in the email body, since it's not really useful. Change-Id: I3a2d54968708db0fbd98bbc724449c06694fa92f --- tcwg_kernel-bisect.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index 196633a4..b5d2a7b2 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -250,7 +250,7 @@ if [ -f $artifacts/first-bad ]; then ln -f -s "build-$last_good.sh" "$artifacts/manifests/build-last_good.sh" cat >> $artifacts/jenkins/mail-body.txt < @@ -264,12 +264,15 @@ else bad_name="bad" bad_sha1="$bad_rev" cat >> $artifacts/jenkins/mail-body.txt <> $artifacts/jenkins/mail-body.txt < $(cat $artifacts/build-$good_sha1/results) - to (for $bad_name == $bad_sha1) - - $(cat $artifacts/build-$bad_sha1/results) - + +First few errors in logs of $bad_name: +$(grep ": error:" $artifacts/build-$bad_sha1/console.log | head) Artifacts of $good_name build: ${BUILD_URL}artifact/$rel_artifacts/build-$good_sha1/ Artifacts of $bad_name build: ${BUILD_URL}artifact/$rel_artifacts/build-$bad_sha1/ -- cgit v1.2.3 From b24c8878502a14c12e1a0ee181111e1ec3920d4c Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Mon, 28 Jan 2019 16:30:26 +0000 Subject: tcwg_kernel-bisect.sh: Update email configuration Don't send regression emails for linux breakages with GNU toolchain to Maxim K. and Christophe L.. Change-Id: Iad009ab97e9acfd6b3d6fb89f26489aecb9b7c9f --- tcwg_kernel-bisect.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index 4e165002..bcd0909d 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -337,6 +337,7 @@ fi CI_MAIL_RECIPIENTS="tcwg-validation@linaro.org" if [ x"$ci_project" = x"tcwg_kernel" ]; then case "$toolchain:$current_project" in + gnu:linux) ;; gnu:*) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, christophe.lyon@linaro.org, maxim.kuvyrkov@linaro.org" ;; llvm:linux) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, arnd@linaro.org, mark.brown@linaro.org, ndesaulniers@google.com, trong@google.com" ;; llvm:llvm) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, adhemerval.zanella@linaro.org, maxim.kuvyrkov@linaro.org, ndesaulniers@google.com, trong@google.com, yvan.roux@linaro.org" ;; -- cgit v1.2.3 From fe0640744ecc8baec0e937c8f724bdece9f302fe Mon Sep 17 00:00:00 2001 From: Omair Javaid Date: Thu, 31 Jan 2019 17:22:53 +0500 Subject: Remove overriden old prebuilt qemu binaries We were overriding qemu with prebuilt binaries provided by Peter Maydell. Apparently we were doing so as those binaries show test improvements. As we have moved to docker containers we should update these binaries in docker files if needed. Change-Id: I2a95521d65682bffe2385fbc49aeb84058858f81 --- jenkins.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/jenkins.sh b/jenkins.sh index 9847a565..b2fab679 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -390,17 +390,6 @@ if test x"${debug}" = x"true"; then export CONFIG_SHELL="/bin/bash -x" fi -# Download QEMU provided by Peter Maydell. -# The tarball has README with version information. -if [ x"$(uname -m)" = x"x86_64" ]; then - wget --progress=dot:giga http://people.linaro.org/~maxim.kuvyrkov/qemu-20160707.tgz - tar xf qemu-20160707.tgz - export PATH="$(pwd)/qemu-wip:$PATH" - for i in aarch64 arm armeb; do - qemu-$i --version - done -fi - # Print some information about the build machine echo Running on $(hostname) uname -a -- cgit v1.2.3 From 20471672bdce1df18a7124e71f95b5575a102013 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 30 Jan 2019 08:22:15 +0000 Subject: jenkins-helpers.sh: Improve remote_exec Don't add "exec" to the remote command unless necessary. We need this to trigger jenkins jobs via === remote_exec "ci.linaro.org:2222::-l $USER@linaro.org" build ... === Note that "build" is a command of jenkins-cli, not an executable, so prepending "exec" breaks the invocation. Change-Id: If122869dadb76711666aa49690f508757e7ebce9 --- jenkins-helpers.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index 10b7081a..57e4b4f5 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -236,7 +236,10 @@ remote_exec () cmd=() # Add quotes to every parameter for i in "$@"; do cmd+=("$(printf '%q' "$i")"); done - ssh $opts ${port:+-p$port} $host "${dir:+cd "$(printf '%q' "$dir")" &&} exec ${cmd[@]}" + # Be careful to prepend statements before ${cmd[@]} only if necessary. + # E.g., when triggering jobs via jenkins-cli, the command is not a binary, + # so we can't "exec" it. + ssh $opts ${port:+-p$port} $host "${dir:+cd "$(printf '%q' "$dir")" && exec }${cmd[@]}" ) } -- cgit v1.2.3 From aaa033fb30a080d33af6adfc7eb5741a24a5286e Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 30 Jan 2019 08:36:00 +0000 Subject: round-robin.sh: Add support for handling new configurations Every configuration depends on baseline branches linaro-local/ci/$ci_project/$ci_config existing in all relevant repos, which is a pain to arrange by hand. We add new variable rr[init_configuration], which defaults to 'false'. For new configurations we set this parameter to true, which causes the build script to use relevant upstream branches for components and special "empty" branch for base-artifacts. The net result is that after leaving new configuration for a day or two with rr[init_configuration] set, the builds will initialize branches in all relevant repos themselves, at which point we can turn rr[init_configuration] back off. Change-Id: Id1c78772619626f1a3e98a213e26046266f838e7 --- round-robin.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/round-robin.sh b/round-robin.sh index a09ef49c..4c4b7883 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -12,9 +12,9 @@ # PROJECT's git SHA1 revision. These are mostly used in manifests. #rr[PROJECT_rev] -# Baseline branch name for current configuration. These branches are -# present in all above git repos. -#rr[baseline_branch]="linaro-local/ci/CONFIGURATION" +# Baseline branch name for current configuration. These branches should +# 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. @@ -36,6 +36,10 @@ # Top-level artifacts directory. #rr[top_artifacts]="$top_artifacts" +# Set rr[init_configuration] to 'true' for new projects/configurations +# to initialize baseline branches in git repos. +#rr[init_configuration]=false + # 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. @@ -60,6 +64,11 @@ reset_artifacts () # base-artifacts repo is big and changes all the time, so we # fetch only the $baseline_branch, instead of all branches. rr[base-artifacts_rev]="${rr[base-artifacts_rev]-${rr[baseline_branch]}}" + if ${rr[init_configuration]-false}; then + rr[base-artifacts_rev]=empty + single_branch=empty + fi + clone_or_update_repo base-artifacts ${rr[base-artifacts_rev]} https://git-us.linaro.org/toolchain/ci/base-artifacts.git auto $single_branch cat < Date: Wed, 30 Jan 2019 08:36:13 +0000 Subject: round-robin.sh: Fix typo Change-Id: Ia1382779ccd0a405d30b6fa6101cea987dbe2df0 --- round-robin.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/round-robin.sh b/round-robin.sh index 4c4b7883..b6196176 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -95,8 +95,9 @@ clone_repo () # ${rr[current_branch]} specifies branch for ${rr[current_project]}, # and everything else uses baseline branch. if [ x"$project" = x"${rr[current_project]}" ]; then + # Use the tip of the branch tracked in the current configuration. if [ x"${rr[current_branch]}" = x"default" ]; then - branch=${rr[${current_project}_branch]} + branch=${rr[${rr[current_project]}_branch]} elif [ x"${rr[current_branch]}" = x"baseline" ]; then branch="refs/remotes/baseline/${rr[baseline_branch]}" else -- cgit v1.2.3 From 9977e8017d9094b95daf46d5f7296e412685cad1 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 30 Jan 2019 08:39:14 +0000 Subject: round-robin.sh: Support using ABE's internal sources in build_abe Use ABE's internal linux sources for installation of kernel headers. This simplifies tcwg_bmk project where we don't need to track kernel sources. Change-Id: I2a8eb6978f7b8783fefb6278b601353941d06aa0 --- round-robin.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/round-robin.sh b/round-robin.sh index b6196176..e4ff41a0 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -208,16 +208,23 @@ build_abe () ;; esac - clone_repo $project - - # Don't use ABE's repo clone functions and setup abe/snapshots/ directory - # to have the right entries. - local git_dir git_path - git_dir="$(basename ${rr[${project}_url]})" - git_path="abe/snapshots/$git_dir" - rm -rf $git_path $git_path~master - ln -s $(pwd)/$project $git_path - ln -s $(pwd)/$project $git_path~master + # Use our custom sources for everything, but kernel headers. + local custom_abe_src_opt="" + local git_dir="$project" + if [ x"$component" != x"linux" ]; then + clone_repo $project + + # Don't use ABE's repo clone functions and setup abe/snapshots/ directory + # to have the right entries. + local git_dir git_path + git_dir="$(basename ${rr[${project}_url]})" + git_path="abe/snapshots/$git_dir" + rm -rf $git_path $git_path~master + ln -s $(pwd)/$project $git_path + ln -s $(pwd)/$project $git_path~master + + custom_abe_src_opt="$project=${rr[${project}_url]}~master --disable update" + fi cd abe @@ -226,7 +233,7 @@ build_abe () # Remove previous build directories and .stamp files. # We rely on ccache for fast rebuilds. - set +f; rm -rf builds/x86_64-unknown-linux-gnu/$gnu_target/$git_dir~master*; set -f + set +f; rm -rf builds/*/*/$git_dir*; set -f export PATH=$(pwd)/bin:$PATH @@ -245,8 +252,7 @@ build_abe () --build $project \ --target $gnu_target \ --extraconfigdir config/master \ - --disable update \ - $project=${rr[${project}_url]}~master \ + $custom_abe_src_opt \ $stage ccache -s ) -- cgit v1.2.3 From f85158eefc10f487fad6894c29d21be27fb3d98c Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 30 Jan 2019 08:41:43 +0000 Subject: tcwg-benchmark-results.sh: Rework and cleanup. Change-Id: I3af87f6a085ccdc781a67cf4462ebaf6abf393d7 --- tcwg-benchmark-results.sh | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tcwg-benchmark-results.sh b/tcwg-benchmark-results.sh index 245e492a..6cdd2810 100755 --- a/tcwg-benchmark-results.sh +++ b/tcwg-benchmark-results.sh @@ -2,31 +2,35 @@ # Clean: shellcheck -e 2001 ./tcwg-benchmark-results.sh -set -ex +set -ef -o pipefail -# Make shellcheck happy and workaround Jenkins not defining variables -# for empty arguments. -results_id="$results_id" -results_ref="$results_ref" +scripts=$(dirname $0) +. $scripts/jenkins-helpers.sh + +convert_args_to_variables "$@" + +obligatory_variables results_id results_ref + +top_artifacts="${top_artifacts-artifacts}" +verbose="${verbose-true}" # Jenkins doesn't define variables when parameter value is empty (like cflags), # so enable "set -u" only after above binding of variables. set -u -results_top="dev-01.tcwglab:/home/tcwg-benchmark/results" +if $verbose; then set -x; fi -rsync -az --delete "$results_top-$results_id/" results/ -rsync -az --delete "$results_top-$results_ref/" baseline/ +results_top="dev-01.tcwglab:/home/tcwg-benchmark/results" -for i in baseline results; do - bmk-scripts/perfdatadir2csv.sh --buildid-dir local -t --num 0 --format sample --sort-field sample --results-dir "$i/" > "time-$i.csv" - bmk-scripts/perfdatadir2csv.sh --buildid-dir local --format sample --sort-field sample --results-dir "$i/" > "sample-$i.csv" +num=0 +csvs="" +for i in $results_ref $results_id; do + rsync -az --delete "$results_top-$i/" results-$num/ + $scripts/../bmk-scripts/perfdatadir2csv.sh --buildid-dir local --format sample,size --sort-field sample --results-dir "results-$num/" > "results-$num.csv" + csvs="$csvs results-$num.csv" + num=$(($num+1)) done -mkdir -p artifacts - -bmk-scripts/csvs2table.py --relative time-baseline.csv time-results.csv > artifacts/time.csv - -bmk-scripts/csvs2table.py --relative sample-baseline.csv sample-results.csv > artifacts/sample.csv +mkdir -p $top_artifacts -exit 0 +$scripts/../bmk-scripts/csvs2table.py --relative $csvs > $top_artifacts/results.csv -- cgit v1.2.3 From 742e147d463a1f9cf95c01077336b36d24187247 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 30 Jan 2019 08:54:34 +0000 Subject: tcwg-benchmark.sh: Ssh directly to the benchmark board. We [ab]used build_container_exec to ssh the target board to get most recent ssh configuration. We have since started to require local ssh access to work as well (e.g., for reboot functionality), and implemented automatic updates of tcwg-buildslave and tcwg-benchmark /home files. Also, don't use ssh multiplexing (-Snone) to reliably forward ssh agent to the benchmarking board. We have seen strange ssh-agent failures over shared connections. Change-Id: Iab09821272aa91f8a80b0e1b8fc5a9dd1a6bd3fb --- tcwg-benchmark.sh | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh index a544a5f0..fbb49111 100755 --- a/tcwg-benchmark.sh +++ b/tcwg-benchmark.sh @@ -71,13 +71,6 @@ case "$toolchain_url" in echo "ERROR: ssh:// toolchain_url lacks a port: $toolchain_url." exit 1 fi - - # Create a helper function, like we have when we create a - # container. - build_container_exec () - { - remote_exec "${build}:$(pwd)" "$@" - } ;; *) # Make sure to cleanup build container if something goes @@ -246,21 +239,19 @@ case "$testmode" in benchmark) input_size="ref" ;; esac -build_container_exec ssh -t "$boardname" bmk-scripts/run.sh \ - --bench "$(printf '%q' "$bench_list")" \ - --config "${BUILD_NUMBER}-$run_profile" \ - --cflags "$(printf '%q' "$cflags")" \ - --ccprefix "$ccprefix" \ - --extension "$extension" \ - --ignore_errors "$ignore_errors" \ - --input_size "$input_size" \ - --iterations "$iterations" \ - --run_profile "$run_profile" \ - "${sysroot:+--sysroot "$sysroot"}" \ - --toolchain "$toolchain_type" \ - --resultsdest "dev-01.tcwglab:/home/tcwg-benchmark/results-${results_id}/${NODE_NAME}" \ - --nodename "${NODE_NAME}" \ - --forceinstall "${forceinstall}" \ - --verbose true - -exit 0 +ssh -t -Snone "$boardname" bmk-scripts/run.sh \ + --bench "$(printf '%q' "$bench_list")" \ + --config "${BUILD_NUMBER}-$run_profile" \ + --cflags "$(printf '%q' "$cflags")" \ + --ccprefix "$ccprefix" \ + --extension "$extension" \ + --ignore_errors "$ignore_errors" \ + --input_size "$input_size" \ + --iterations "$iterations" \ + --run_profile "$run_profile" \ + "${sysroot:+--sysroot "$sysroot"}" \ + --toolchain "$toolchain_type" \ + --resultsdest "dev-01.tcwglab:/home/tcwg-benchmark/results-${results_id}/${NODE_NAME}" \ + --nodename "${NODE_NAME}" \ + --forceinstall "${forceinstall}" \ + --verbose true -- cgit v1.2.3 From 34962065fb408fbd486d5765fe6a690c94ee4c8b Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Thu, 7 Feb 2019 16:33:53 +0000 Subject: tcwg_kernel-*.sh: Avoid proxy variables ... and use ${rr[X]} instead of $X. We make an exception for $current_project in tcwg_kernel-bisect.sh to do a mechanical change in a separate patch. Change-Id: Ib365552483d016e9096cc791f61a34015e50e32a --- tcwg_kernel-bisect.sh | 30 ++++++++++--------- tcwg_kernel-build.sh | 81 +++++++++++++++++---------------------------------- 2 files changed, 43 insertions(+), 68 deletions(-) diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index bcd0909d..45a6aaf0 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -16,7 +16,7 @@ fresh_dir $artifacts "$artifacts/manifests/*" "$artifacts/jenkins/*" convert_args_to_variables "$@" shift "$SHIFT_CONVERTED_ARGS" -obligatory_variables bad_rev baseline_rev build_script ci_project ci_config +obligatory_variables bad_rev baseline_rev build_script rr[ci_project] BUILD_URL="${BUILD_URL:-$(pwd)}" reproduce_bisect="${reproduce_bisect:-false}" @@ -25,9 +25,11 @@ reproduce_bisect="${reproduce_bisect:-false}" convert_args_to_variables ^^ $reproduce_bisect %% $artifacts/manifests/build-parameters.sh "$@" $reproduce_bisect || manifest_pop -obligatory_variables current_project +obligatory_variables rr[current_project] rr[ci_config] -if [ x"$ci_project" = x"tcwg_kernel" ]; then +current_project=${rr[current_project]} + +if [ x"${rr[ci_project]}" = x"tcwg_kernel" ]; then obligatory_variables toolchain fi @@ -41,7 +43,7 @@ trap "eval \"echo ERROR at \${FUNCNAME[0]}:\${BASH_LINENO[0]}\" > $artifacts/fai rebase_workaround=false -if [ x"$ci_project" = x"tcwg_kernel" ] \ +if [ x"${rr[ci_project]}" = x"tcwg_kernel" ] \ && [ x"$current_project" = x"linux" -a x"${rr[linux_version]}" = x"next" ]; then # Workaround linux-next/master rebasing on top of linux-next/stable. # Search for regressions against linux-mainline:master (aka linux-next:stable). @@ -64,10 +66,10 @@ $build_script \ ^^ $reproduce_bisect \ %% $rel_artifacts/manifests/build-baseline.sh \ @@ $rel_artifacts/manifests/build-parameters.sh \ - --mode "baseline" \ - --current_branch "$baseline_rev" \ - --reset_baseline true \ - --top_artifacts "$rel_artifacts/build-baseline" \ + ==rr[mode] "baseline" \ + ==rr[current_branch] "$baseline_rev" \ + ==rr[reset_baseline] true \ + ==rr[top_artifacts] "$rel_artifacts/build-baseline" \ --verbose "$verbose" assert ! [ -f $artifacts/failures ] @@ -121,8 +123,8 @@ $build_script \ ^^ $reproduce_bisect \ %% $rel_artifacts/manifests/build-\$rev.sh \ @@ $rel_artifacts/manifests/build-parameters.sh \ - --mode bisect \ - --top_artifacts $rel_artifacts/build-\$rev \ + ==rr[mode] bisect \ + ==rr[top_artifacts] $rel_artifacts/build-\$rev \ --verbose "$verbose" & res=0 && wait \$! || res=\$? @@ -250,7 +252,7 @@ if [ -f $artifacts/first-bad ]; then ln -f -s "build-$last_good.sh" "$artifacts/manifests/build-last_good.sh" cat >> $artifacts/jenkins/mail-body.txt < @@ -264,7 +266,7 @@ else bad_name="bad" bad_sha1="$bad_rev" cat >> $artifacts/jenkins/mail-body.txt < -History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/ci/$ci_project/$ci_config +History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/ci/${rr[ci_project]}/${rr[ci_config]} Bisect log: ${BUILD_URL}artifact/$rel_artifacts/bisect.log/*view*/ Artifacts: ${BUILD_URL}artifact/$rel_artifacts/ @@ -335,7 +337,7 @@ fi # Set mail recipients last to preserve catch-error value from .yaml file. # Email developers. CI_MAIL_RECIPIENTS="tcwg-validation@linaro.org" -if [ x"$ci_project" = x"tcwg_kernel" ]; then +if [ x"${rr[ci_project]}" = x"tcwg_kernel" ]; then case "$toolchain:$current_project" in gnu:linux) ;; gnu:*) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, christophe.lyon@linaro.org, maxim.kuvyrkov@linaro.org" ;; diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh index 6eda2248..ab169e5b 100755 --- a/tcwg_kernel-build.sh +++ b/tcwg_kernel-build.sh @@ -1,66 +1,59 @@ #!/bin/bash -set -ef -o pipefail +set -euf -o pipefail scripts=$(dirname $0) . $scripts/jenkins-helpers.sh convert_args_to_variables "$@" +obligatory_variables rr[ci_config] + # Execution mode: baseline, bisect, continue, jenkins-full -mode="${mode-baseline}" - -obligatory_variables toolchain \ - rr[linux_version] rr[linux_url] rr[linux_branch] - -# Toolchain to use: gnu or llvm -case "$toolchain" in - "gnu") obligatory_variables rr[gnu_version] \ - rr[binutils_url] rr[binutils_branch] \ - rr[gcc_url] rr[gcc_branch] ;; - "llvm") obligatory_variables rr[llvm_version] \ - rr[llvm_url] rr[llvm_branch] ;; -esac +rr[mode]="${rr[mode]-baseline}" -case "$mode" in +case "${rr[mode]}" in "jenkins-full") - obligatory_variables current_project current_branch + 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. -current_project="${current_project-none}" -current_branch="${current_branch-default}" +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}" + +# {toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config} +IFS=- read -a ci_config < $top_artifacts/failures" EXIT - -if [ x"$target" = x"native" ]; then - target=$(uname -m) -fi +trap "eval \"echo ERROR at \${FUNCNAME[0]}:\${BASH_LINENO[0]}\"" EXIT # Set start and finish steps for different modes. default_start_at="" default_finish_at="" -case "$mode" in +base_artifacts_opt="base-artifacts" +case "${rr[mode]}" in "baseline") default_finish_at="update_baseline" ;; "bisect") - case "$toolchain:$current_project" in + case "${rr[toolchain]}:${rr[current_project]}" 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" ;; @@ -71,14 +64,14 @@ case "$mode" in ;; "continue") # Developer mode. - case "$toolchain" in + case "${rr[toolchain]}" in "gnu") default_start_at="prepare_abe" ;; "llvm") default_start_at="build_llvm" ;; esac + base_artifacts_opt="" ;; "jenkins-full") ;; esac - if [ x"$start_at" = x"default" ]; then start_at="$default_start_at" fi @@ -86,27 +79,7 @@ if [ x"$finish_at" = x"default" ]; then finish_at="$default_finish_at" fi -if [ x"$mode" != x"continue" ]; then - base_artifacts_opt="base-artifacts" -else - base_artifacts_opt="" -fi - -run_step_init "$start_at" "$finish_at" "$top_artifacts" "$base_artifacts_opt" "$verbose" - -rr[baseline_branch]="linaro-local/ci/tcwg_kernel/$toolchain-${rr[${toolchain}_version]}-$target-${rr[linux_version]}-$linux_config" -rr[current_project]="$current_project" -rr[current_branch]="$current_branch" -rr[mode]="$mode" -rr[reset_baseline]="$reset_baseline" -rr[target]="$target" -rr[top_artifacts]="$top_artifacts" - -# Linux config to build in build_linux. -rr[linux_config]="$linux_config" - -# Toolchain to use: gnu or llvm. -rr[toolchain]="$toolchain" +run_step_init "$start_at" "$finish_at" "${rr[top_artifacts]}" "$base_artifacts_opt" "$verbose" . $scripts/round-robin.sh -- cgit v1.2.3 From 0b35f53a43aa7c712f350eecd503877502f3e0fc Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Fri, 8 Feb 2019 15:27:19 +0000 Subject: jenkins-helpers.sh: Support custom docker root dirs Several of our machines have docker root dir set to /home/docker instead of standard /var/lib/docker. The reason for using /home/docker is to allocate docker containers on the biggest disk partition. Change-Id: I6d16f561b5b8d303cb58d3a30f2847814eb55756 --- jenkins-helpers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index 57e4b4f5..487d9cff 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -672,7 +672,9 @@ print_docker_path () if [ -f "/.dockerenv" ] && mount | grep -q "/run/docker.sock "; then # If inside "host" container (with proxied docker and /home from host-home volume), # convert paths to refer to volume's path on bare-metal. - echo "$path" | sed -e "s#^/home/#/var/lib/docker/volumes/host-home/_data/#" + local docker_root + docker_root=$(docker info | grep "Docker Root Dir:" | cut -d: -f 2) + echo "$path" | sed -e "s#^/home/#$docker_root/volumes/host-home/_data/#" else echo "$path" fi -- cgit v1.2.3 From 99300555a21d0ef961d60042730afe5b79d3311a Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Fri, 8 Feb 2019 13:17:03 +0000 Subject: jenkins-helpers.sh: Workaround DNS issue We don't have DNS alias entries tcwg-x86_64-build-09.tcwglab and tcwg-x86_64-build-10.tcwglab -- for build-09.tcwglab and build-10.tcwglab machines. Change-Id: Ib32956b92098ac610be6f178c5d24c23ffa994f0 --- jenkins-helpers.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index 487d9cff..d6b1e9ae 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -152,6 +152,11 @@ print_host_for_node () # configured ssh local host="$1.tcwglab" + # Map tcwg-x86_64-build-* and tcwg-x86_64-dev-* to build-* and dev-* + case "$host" in + tcwg-x86_64-*) host=${host#tcwg-x86_64-} ;; + esac + if ! host "$host" >& /dev/null; then # No DNS entry, try to see if it is handled by our ssh config if ! ssh "$1" true >& /dev/null; then -- cgit v1.2.3