summaryrefslogtreecommitdiff
path: root/tcwg-update-llvmbot-containers.sh
blob: 72f9641bfb06f5030b94c17d616e6f0c49c078e0 (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
#!/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-clang-aarch64-full-2stage
	    linaro-flang-aarch64-libcxx
	    linaro-lldb-arm-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 and Armv7-M picolib
	    # (which is v7-M being simulated on AArch64).
	    linaro-aarch64-libcxx-01
	    linaro-aarch64-libcxx-02
	    linaro-aarch64-libcxx-03
	    # 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-global-isel
	    linaro-clang-armv7-lnt
	    linaro-clang-armv7-2stage
	    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-flang-aarch64-dylib
	    linaro-flang-aarch64-sharedlibs
	    linaro-flang-aarch64-out-of-tree
	    linaro-flang-aarch64-release
	    linaro-flang-aarch64-debug-reverse-iteration
	    linaro-flang-aarch64-rel-assert
	    linaro-flang-aarch64-latest-gcc
	)
	;;
    tcwg-g3-01:normal)
	# -01 is 32-core / 64GB RAM G3 instance.  It can comforably run
	# 1-2 linaro-g3-* workers.
	bots=(
	    linaro-g3-01
	)
	;;
    tcwg-g3-02:normal)
	# Testing lldb running on SVE/PAC enabled G3 hardware.
	bots=(
	    linaro-lldb-aarch64-ubuntu
	)
	;;
    tcwg-g3-04:normal)
	# -04 is 64-core / 128GB RAM G3 instance.  It can comforably run
	# 3-4 linaro-g3-* workers.
	bots=(
	    linaro-g3-02
	    linaro-g3-03
	    linaro-g3-04
	)
	;;
esac

default_distro=$distro
for bot in "${bots[@]+${bots[@]}}"; do
    case "$bot" in
	linaro-*aarch64-*|linaro-g3-*) arch="arm64" ; distro=$default_distro ;;
	linaro-*arm*|linaro-tk1-*)     arch="armhf" ; distro=$default_distro ;;
	*) 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