forked from MariaDB/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
locks.py
130 lines (122 loc) · 6.25 KB
/
locks.py
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
123
124
125
126
127
128
129
130
from twisted.internet import defer
from buildbot.plugins import *
from buildbot.process.properties import Properties, Property
from buildbot.process.remotecommand import RemoteCommand
from buildbot.steps.mtrlogobserver import MTR, MtrLogObserver
from buildbot.steps.shell import Compile, SetPropertyFromCommand, ShellCommand, Test
from buildbot.steps.source.github import GitHub
from constants import *
####### LOCKS
# main_master_lock = util.MasterLock('main_master_lock', maxCount=30)
hz_bbw1_lock = util.MasterLock("hz_bbw1_lock", maxCount=9)
hz_bbw2_lock = util.MasterLock("hz_bbw2_lock", maxCount=1)
hz_bbw4_lock = util.MasterLock("hz_bbw4_lock", maxCount=9)
hz_bbw5_lock = util.MasterLock("hz_bbw5_lock", maxCount=9)
amd_bbw1_lock = util.MasterLock("amd_bbw1_lock", maxCount=4)
amd_bbw2_lock = util.MasterLock("amd_bbw2_lock", maxCount=6)
intel_bbw1_lock = util.MasterLock("intel_bbw1_lock", maxCount=5)
p9_rhel8_bbw1_lock = util.MasterLock("p9_rhel8_bbw1_lock", maxCount=6)
p9_rhel7_bbw1_lock = util.MasterLock("p9_rhel7_bbw1_lock", maxCount=6)
p9_db_bbw1_lock = util.MasterLock("p9_db_bbw1_lock", maxCount=8)
p9_raptor_bbw1_lock = util.MasterLock("p9_raptor_bbw1_lock", maxCount=6)
aarch_bbw1_lock = util.MasterLock("aarch64_bbw1_lock", maxCount=2)
aarch_bbw2_lock = util.MasterLock("aarch64_bbw2_lock", maxCount=2)
aarch_bbw3_lock = util.MasterLock("aarch64_bbw3_lock", maxCount=2)
aarch_bbw4_lock = util.MasterLock("aarch64_bbw4_lock", maxCount=2)
aarch_bbw5_lock = util.MasterLock("aarch64_bbw5_lock", maxCount=15)
aarch_bbw6_lock = util.MasterLock("aarch64_bbw6_lock", maxCount=15)
aarch_bbw7_lock = util.MasterLock("aarch64_bbw7_lock", maxCount=15)
apexis_bbw1_lock = util.MasterLock("apexis_bbw1_lock", maxCount=1)
apexis_bbw2_lock = util.MasterLock("apexis_bbw2_lock", maxCount=1)
apexis_bbw3_lock = util.MasterLock("apexis_bbw3_lock", maxCount=6)
bg_bbw1_lock = util.MasterLock("bg_bbw1_lock", maxCount=3)
bg_bbw2_lock = util.MasterLock("bg_bbw2_lock", maxCount=2)
bg_bbw3_lock = util.MasterLock("bg_bbw3_lock", maxCount=2)
bg_bbw4_lock = util.MasterLock("bg_bbw4_lock", maxCount=2)
win_bbw1_lock = util.MasterLock("win_bbw1_lock", maxCount=1)
win_bbw2_lock = util.MasterLock("win_bbw2_lock", maxCount=4)
s390x_bbw1_lock = util.MasterLock("s390x_bbw1_lock", maxCount=3)
s390x_bbw2_lock = util.MasterLock("s390x_bbw2_lock", maxCount=3)
s390x_bbw3_lock = util.MasterLock("s390x_bbw3_lock", maxCount=3)
s390x_bbw4_lock = util.MasterLock("s390x_bbw4_lock", maxCount=3)
s390x_bbw5_lock = util.MasterLock("s390x_bbw5_lock", maxCount=3)
@util.renderer
def getLocks(props):
worker_name = props.getProperty("workername", default=None)
builder_name = props.getProperty("buildername", default=None)
assert worker_name is not None
assert builder_name is not None
if (
builder_name in github_status_builders
or builder_name in builders_install
or builder_name in builders_upgrade
):
return []
locks = []
# else:
# locks = [main_master_lock.access('counting')]
if "hz-bbw1-docker" in worker_name:
locks = locks + [hz_bbw1_lock.access("counting")]
if "hz-bbw2-docker" in worker_name:
locks = locks + [hz_bbw2_lock.access("counting")]
if "hz-bbw4-docker" in worker_name:
locks = locks + [hz_bbw4_lock.access("counting")]
if "hz-bbw5-docker" in worker_name:
locks = locks + [hz_bbw5_lock.access("counting")]
if "intel-bbw1-docker" in worker_name:
locks = locks + [intel_bbw1_lock.access("counting")]
if "ppc64le-rhel8-bbw1-docker" in worker_name:
locks = locks + [p9_rhel8_bbw1_lock.access("counting")]
if "ppc64le-rhel7-bbw1-docker" in worker_name:
locks = locks + [p9_rhel7_bbw1_lock.access("counting")]
if "ppc64le-db-bbw1-docker" in worker_name:
locks = locks + [p9_db_bbw1_lock.access("counting")]
if "ppc64le-raptor-bbw1-docker" in worker_name:
locks = locks + [p9_raptor_bbw1_lock.access("counting")]
if "aarch64-bbw1-docker" in worker_name:
locks = locks + [aarch_bbw1_lock.access("counting")]
if "aarch64-bbw2-docker" in worker_name:
locks = locks + [aarch_bbw2_lock.access("counting")]
if "aarch64-bbw3-docker" in worker_name:
locks = locks + [aarch_bbw3_lock.access("counting")]
if "aarch64-bbw4-docker" in worker_name:
locks = locks + [aarch_bbw4_lock.access("counting")]
if "aarch64-bbw5-docker" in worker_name:
locks = locks + [aarch_bbw5_lock.access("counting")]
if "aarch64-bbw6-docker" in worker_name:
locks = locks + [aarch_bbw6_lock.access("counting")]
if "aarch64-bbw7-docker" in worker_name:
locks = locks + [aarch_bbw7_lock.access("counting")]
if "fjord1-docker" in worker_name:
locks = locks + [apexis_bbw1_lock.access("counting")]
if "fjord2-docker" in worker_name:
locks = locks + [apexis_bbw2_lock.access("counting")]
if "ns-x64-bbw1-docker" in worker_name:
locks = locks + [bg_bbw1_lock.access("counting")]
if "ns-x64-bbw2-docker" in worker_name:
locks = locks + [bg_bbw2_lock.access("counting")]
if "ns-x64-bbw3-docker" in worker_name:
locks = locks + [bg_bbw3_lock.access("counting")]
if "ns-x64-bbw4-docker" in worker_name:
locks = locks + [bg_bbw4_lock.access("counting")]
if "bbw1-docker-windows" in worker_name:
locks = locks + [win_bbw1_lock.access("counting")]
if "bbw2-docker-windows" in worker_name:
locks = locks + [win_bbw2_lock.access("counting")]
if "s390x-bbw1-docker" in worker_name:
locks = locks + [s390x_bbw1_lock.access("counting")]
if "s390x-bbw2-docker" in worker_name:
locks = locks + [s390x_bbw2_lock.access("counting")]
if "s390x-bbw3-docker" in worker_name:
locks = locks + [s390x_bbw3_lock.access("counting")]
if "s390x-bbw4-docker" in worker_name:
locks = locks + [s390x_bbw4_lock.access("counting")]
if "s390x-bbw5-docker" in worker_name:
locks = locks + [s390x_bbw5_lock.access("counting")]
if "amd-bbw1-docker" in worker_name:
locks = locks + [amd_bbw1_lock.access("counting")]
if "amd-bbw2-docker" in worker_name:
locks = locks + [amd_bbw2_lock.access("counting")]
if "apexis-bbw3-docker" in worker_name:
locks = locks + [apexis_bbw3_lock.access("counting")]
return locks