summaryrefslogtreecommitdiff
path: root/tcwg-update-llvmbot-containers.sh
blob: 9fdb54c4d3085d9d2fbdb46ed78f8bb660800259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash

set -euf -o pipefail

scripts=$(dirname $0)
# shellcheck source=jenkins-helpers.sh
. $scripts/jenkins-helpers.sh
convert_args_to_variables "$@"

obligatory_variables NODE_NAME password
declare NODE_NAME password

distro="${distro-default}"
force="${force-false}"
master="${master-silent}"
verbose="${verbose-true}"

if $verbose; then set -x; fi

# Resolve LTS and LTS-1 values to Ubuntu distros.
case "$distro" in
    lts_1) distro=focal ;;
    lts|default) distro=jammy ;;
esac

if $force; then
    keep_existing=false
else
    keep_existing=keep_if_same_image
fi

case "$NODE_NAME:$master" in
    tcwg-jade-04:normal)
	bots=(
	    linaro-lldb-arm-ubuntu
	    linaro-lldb-aarch64-ubuntu
	)
	;;
    tcwg-jade-04:buildkite)
	bots=(
	    # 1 bot per config to limit the
	    # total build time to 1x the slowest config.
	    # aarch64 exceptions/no-exceptions
	    linaro-aarch64-libcxx-01
	    linaro-aarch64-libcxx-02
	    # These can all build any v7/8 config.
	    # 4 because there's 4 combinations.
	    # exceptions/no exceptions armv7/armv8
	    linaro-armv8-libcxx-01
	    linaro-armv8-libcxx-02
	    linaro-armv8-libcxx-03
	    linaro-armv8-libcxx-04
	)
	;;
    tcwg-jade-01:normal)
	bots=(
	    # Bots in same order as in llvm-zorg/.../workers.py
	    linaro-clang-armv7-lnt
	    linaro-clang-armv7-2stage
	    linaro-clang-armv7-lnt
	    linaro-clang-armv7-vfpv3-2stage
	    linaro-clang-armv8-quick
	    linaro-clang-armv8-lld-2stage
	    linaro-clang-aarch64-quick
	    linaro-clang-aarch64-lld-2stage
	    linaro-clang-aarch64-global-isel
	    linaro-clang-aarch64-full-2stage
	    linaro-flang-aarch64-dylib
	    linaro-flang-aarch64-sharedlibs
	    linaro-flang-aarch64-out-of-tree
	    linaro-flang-aarch64-release
	    linaro-flang-aarch64-debug
	    linaro-flang-aarch64-latest-clang
	    linaro-flang-aarch64-rel-assert
	    linaro-flang-aarch64-latest-gcc
	)
	;;
    tcwg-jade-01:silent)
	bots=(
	    linaro-clang-armv7-global-isel
	)
	;;
    tcwg-llvmbot_tk1-06:silent)
	# 02 is unreachable. Pretend to be 02 so that clang-native-arm-lnt-perf can continue to build.
	bots=("linaro-tk1-02")
	;;
	# Connect thumbv7 2stage workers to silent buildmaster
    tcwg-llvmbot_tk1-01:silent)
	bots=("linaro-tk1-01")
	;;
	# Connect armv7 2stage worker to silent buildmaster
    tcwg-llvmbot_tk1-08:silent)
	bots=("linaro-tk1-08")
	;;
    tcwg-g3-01:normal)
	bots=("linaro-g3-01")
	;;
    tcwg-g3-02:normal)
	bots=("linaro-g3-02")
	;;
    tcwg-g3-03:normal)
	bots=("linaro-g3-03")
	;;
esac

for bot in "${bots[@]+${bots[@]}}"; do
    case "$bot" in
	linaro-*aarch64-*|linaro-g3-*) arch="arm64" ;;
	linaro-lldb-arm-ubuntu) arch="armhf" ; distro="jammy" ;;
	linaro-*arm*|linaro-tk1-*) arch="armhf" ;;
	*) echo "ERROR: Unknown bot: $bot"; exit 1 ;;
    esac
    image="linaro/ci-$arch-tcwg-llvmbot-ubuntu:$distro"

    $scripts/tcwg-start-container.sh \
	--container "$master-$bot" \
	--image "$image" \
	--keep_existing "$keep_existing" \
	--verbose "$verbose" \
	-- \
	$image $master $bot $password
done