aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtcwg-base/tcwg-llvmbot/build.sh5
-rwxr-xr-xtcwg-base/tcwg-llvmbot/run.sh.tmpl43
-rwxr-xr-xtcwg-base/tcwg-llvmbot/start.sh.tmpl50
3 files changed, 74 insertions, 24 deletions
diff --git a/tcwg-base/tcwg-llvmbot/build.sh b/tcwg-base/tcwg-llvmbot/build.sh
index bbc64dd..7b03cb2 100755
--- a/tcwg-base/tcwg-llvmbot/build.sh
+++ b/tcwg-base/tcwg-llvmbot/build.sh
@@ -16,10 +16,7 @@ name=$(basename ${PWD} | cut -f3- -d '-')
image=linaro/ci-${arch}-${name}-ubuntu:${distro}
top=$(git rev-parse --show-toplevel)
-cat $top/tcwg-base/$name/start.sh.tmpl \
- | sed -e "s#@IMAGE@#$image#g" \
- -e "s#@DISTRO@#$distro#g" > start.sh
-chmod +x start.sh
+cp $top/tcwg-base/$name/start.sh.tmpl start.sh
cp $top/tcwg-base/$name/run.sh.tmpl run.sh
# llvm-config repo is hosted on [secure] dev-private-git.l.o, so we
diff --git a/tcwg-base/tcwg-llvmbot/run.sh.tmpl b/tcwg-base/tcwg-llvmbot/run.sh.tmpl
index 2afc30a..b9b6154 100755
--- a/tcwg-base/tcwg-llvmbot/run.sh.tmpl
+++ b/tcwg-base/tcwg-llvmbot/run.sh.tmpl
@@ -2,7 +2,7 @@
set -e
-if [ x"$@" = x"start.sh" ]; then
+if [ x"$1" = x"start.sh" ]; then
cat /start.sh
exit 0
fi
@@ -13,15 +13,54 @@ if ! [ -f ~buildslave/buildslave/buildbot.tac ]; then
sudo -i -u buildslave buildslave create-slave --umask=022 ~buildslave/buildslave "$@"
fi
+case "$2" in
+ *-libcxx*|*-lld|*-arm-quick|*-arm-full|*-arm-full-selfhost)
+ # Libcxx and LLD bots need to be compiled with clang.
+ # Some of AArch32 bots need clang as well.
+ # We override cc and c++ in /usr/local/bin to achieve this.
+ # ??? Adding testStage1=False to LLD bot might enable it to not depend on clang.
+ # ??? *-arm-full-selfhost bot doesn't look like it depends on clang.
+ # ??? For now we preserve host compiler configuration from non-docker bots.
+ cc=clang
+ cxx=clang++
+ ;;
+ *)
+ cc=gcc
+ cxx=g++
+ ;;
+esac
+
+# With default PATH /usr/local/bin/cc and /usr/local/bin/c++ are detected as
+# system compilers. No danger in ccaching results of system compiler since
+# we always start with a clean cache in a new container.
+cat > /usr/local/bin/cc <<EOF
+#!/bin/sh
+exec ccache $cc "\$@"
+EOF
+chmod +x /usr/local/bin/cc
+cat > /usr/local/bin/c++ <<EOF
+#!/bin/sh
+exec ccache $cxx "\$@"
+EOF
+chmod +x /usr/local/bin/c++
+
+case "$2" in
+ *-lld)
+ # LLD buildbot needs to find ld.lld for stage1 build.
+ ln -f -s /usr/bin/ld.bfd /usr/local/bin/ld.lld
+ ;;
+esac
+
cat <<EOF | sudo -i -u buildslave tee ~buildslave/buildslave/info/admin
Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
EOF
case "$2" in
linaro-apm-*) hw="APM XGene 1" ;;
+ linaro-armv8-*) hw="64-core Cortex-A72" ;;
linaro-tk1-*) hw="NVIDIA TK1" ;;
esac
cat <<EOF | sudo -i -u buildslave tee ~buildslave/buildslave/info/host
-$hw $(($(free -g | awk '/^Mem/ { print $2 }') + 1))GB
+$hw $(($(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) / (1024*1024*1024)))GB
OS: $(lsb_release -ds)
Kernel: $(uname -rv)
diff --git a/tcwg-base/tcwg-llvmbot/start.sh.tmpl b/tcwg-base/tcwg-llvmbot/start.sh.tmpl
index 968dbe8..eca9451 100755
--- a/tcwg-base/tcwg-llvmbot/start.sh.tmpl
+++ b/tcwg-base/tcwg-llvmbot/start.sh.tmpl
@@ -2,8 +2,10 @@
set -ex
-buildmaster="$1"
-slavename="$2"
+image="$1"
+buildmaster="$2"
+slavename="$3"
+password="$4"
usage ()
{
@@ -23,31 +25,25 @@ else
DOCKER="sudo docker"
fi
-image=@IMAGE@
-# Use at most 15G or 90% of all RAM.
-memlimit=$(($(free -g | awk '/^Mem/ { print $2 }') * 9 / 10))
-if [ "$memlimit" -gt "15" ]; then
- memlimit="15"
-fi
-# IPC_LOCK is required for some implementations of ssh-agent (e.g., MATE's).
-# SYS_PTRACE is required for debugger work.
-# seccomp:unconfined is required to disable ASLR for sanitizer tests.
-caps="--cap-add=IPC_LOCK --cap-add=SYS_PTRACE --security-opt seccomp:unconfined"
-
case "$buildmaster" in
- "lab.llvm.org:9990")
+ "normal")
mastername="normal"
+ masterurl="lab.llvm.org:9990"
;;
- "lab.llvm.org:9994")
+ "silent")
mastername="silent"
+ masterurl="lab.llvm.org:9994"
;;
*)
- usage "ERROR: Wrong buildmaster URL: $buildmaster"
+ mastername="custom"
+ masterurl="$buildmaster"
esac
# CXX, LLD and LNT bots need additional configuration, and
# are not supported yet.
case "$mastername:$slavename:$(hostname):$image" in
+ # No restrictions for custom masters:
+ custom:*:*:*) ;;
# Almost no restrictions for the silent master:
silent:*:r*-a*:*) ;;
silent:linaro-tk1-*:llvm-tk1-*:*-armhf-*) ;;
@@ -72,5 +68,23 @@ case "$mastername:$slavename:$(hostname):$image" in
;;
esac
-$DOCKER pull $image
-$DOCKER run --name=$mastername-$slavename --hostname=$mastername-$slavename --restart=unless-stopped -dt -p 22 --memory=${memlimit}G --pids-limit=5000 $caps $image "$@"
+case "$slavename" in
+ linaro-armv8-*)
+ # Use 64G out of 128G.
+ memlimit="64"
+ ;;
+ *)
+ # Use at most 30G or 90% of all RAM.
+ memlimit=$(($(free -g | awk '/^Mem/ { print $2 }') * 9 / 10))
+ if [ "$memlimit" -gt "30" ]; then
+ memlimit="30"
+ fi
+ ;;
+esac
+
+# IPC_LOCK is required for some implementations of ssh-agent (e.g., MATE's).
+# SYS_PTRACE is required for debugger work.
+# seccomp:unconfined is required to disable ASLR for sanitizer tests.
+caps="--cap-add=IPC_LOCK --cap-add=SYS_PTRACE --security-opt seccomp:unconfined"
+
+$DOCKER run --name=$mastername-$slavename --hostname=$mastername-$slavename --restart=unless-stopped -dt -p 22 --memory=${memlimit}G --pids-limit=5000 $caps "$image" "$masterurl" "$slavename" "$password"