1
1
# -*- python -*-
2
2
# ex: set filetype=python:
3
3
4
- from buildbot .plugins import *
5
- from buildbot .process .properties import Property , Properties
6
- from buildbot .steps .shell import ShellCommand , Compile , Test , SetPropertyFromCommand
7
- from buildbot .steps .mtrlogobserver import MTR , MtrLogObserver
8
- from buildbot .steps .source .github import GitHub
9
- from buildbot .process .remotecommand import RemoteCommand
10
- from datetime import timedelta
11
- from twisted .internet import defer
12
-
13
- import docker
14
4
import os
15
- import sys
16
5
17
- sys .setrecursionlimit (10000 )
18
-
19
- sys .path .insert (0 , "/srv/buildbot/master" )
20
-
21
- from utils import *
22
- from constants import os_info
23
-
24
- # This is the dictionary that the buildmaster pays attention to. We also use
25
- # a shorter alias to save typing.
26
- c = BuildmasterConfig = {}
6
+ from buildbot .plugins import steps , util , worker
7
+ from buildbot .steps .shell import Test
8
+ from constants import BUILDERS_INSTALL , os_info
9
+ from master_common import base_master_config
10
+ from utils import canStartBuild , envFromProperties , getScript , nextBuild
27
11
28
12
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
29
13
# that the rest of the configuration can be public.
30
14
config = {"private" : {}}
31
- exec (open ("../ master-private.cfg" ).read (), config , {})
15
+ exec (open ("master-private.cfg" ).read (), config , {})
32
16
33
- ####### PROJECT IDENTITY
17
+ # This is the dictionary that the buildmaster pays attention to. We also use
18
+ # a shorter alias to save typing.
19
+ c = BuildmasterConfig = base_master_config (
20
+ title = os .getenv ("TITLE" , default = "MariaDB CI" ),
21
+ title_url = os .getenv ("TITLE_URL" , default = "https://github.com/MariaDB/server" ),
22
+ buildbot_url = os .getenv ("BUILDMASTER_URL" , default = "https://buildbot.mariadb.org/" ),
23
+ github_access_token = config ["private" ]["gh_mdbci" ]["access_token" ],
24
+ # TODO(cvicentiu) undo this hardcoding
25
+ secrets_provider_file = "/srv/buildbot/master/master-credential-provider" ,
26
+ master_port = int (os .getenv ("PORT" , default = "9990" )),
27
+ db_url = config ["private" ]["db_url" ],
28
+ mq_router_url = os .getenv ("MQ_ROUTER_URL" , default = "ws://localhost:8085/ws" ),
29
+ )
34
30
35
- # the 'title' string will appear at the top of this buildbot installation's
36
- # home pages (linked to the 'titleURL').
37
- c ["title" ] = os .getenv ("TITLE" , default = "MariaDB CI" )
38
- c ["titleURL" ] = os .getenv ("TITLE_URL" , default = "https://github.com/MariaDB/server" )
39
31
artifactsURL = os .getenv ("ARTIFACTS_URL" , default = "https://ci.mariadb.org" )
40
32
41
- # the 'buildbotURL' string should point to the location where the buildbot's
42
- # internal web server is visible. This typically uses the port number set in
43
- # the 'www' entry below, but with an externally-visible host name which the
44
- # buildbot cannot figure out without some help.
45
- c ["buildbotURL" ] = os .getenv ("BUILDMASTER_URL" , default = "https://buildbot.mariadb.org/" )
46
-
47
- # 'protocols' contains information about protocols which master will use for
48
- # communicating with workers. You must define at least 'port' option that workers
49
- # could connect to your master with this protocol.
50
- # 'port' must match the value configured into the workers (with their
51
- # --master option)
52
- port = int (os .getenv ("PORT" , default = "9990" ))
53
- c ["protocols" ] = {"pb" : {"port" : port }}
54
-
55
- ####### DB URL
56
-
57
- c ["db" ] = {
58
- # This specifies what database buildbot uses to store its state.
59
- "db_url" : config ["private" ]["db_url" ]
60
- }
61
-
62
- ####### Disable net usage reports from being sent to buildbot.net
63
- c ["buildbotNetUsageData" ] = None
64
-
65
33
66
34
####### UTILS
67
35
def getRpmUpgradeStep ():
@@ -120,6 +88,7 @@ def getRpmInstallStep():
120
88
command = ["./rpm-install.sh" ],
121
89
)
122
90
91
+
123
92
def getDebUpgradeStep ():
124
93
return Test (
125
94
name = "upgrade" ,
@@ -185,6 +154,7 @@ def getMajorVersionStep():
185
154
),
186
155
)
187
156
157
+
188
158
def getPAMTestStep ():
189
159
return Test (
190
160
name = "PAM authentication test" ,
@@ -199,34 +169,31 @@ def getPAMTestStep():
199
169
command = ["./pam-test.sh" ],
200
170
)
201
171
202
- # FACTORY
203
172
204
- ## f_deb_install
173
+ # FACTORY
205
174
f_deb_install = util .BuildFactory ()
206
175
f_deb_install .addStep (getScript ("deb-install.sh" ))
207
176
f_deb_install .addStep (getDebInstallStep ())
208
177
f_deb_install .addStep (getScript ("pam-test.sh" ))
209
178
f_deb_install .addStep (getPAMTestStep ())
210
179
211
- ## f_deb_upgrade
212
180
f_deb_upgrade = util .BuildFactory ()
213
181
f_deb_upgrade .addStep (getMajorVersionStep ())
214
182
f_deb_upgrade .addStep (getScript ("deb-upgrade.sh" ))
215
183
f_deb_upgrade .addStep (getDebUpgradeStep ())
216
184
217
- ## f_rpm_install
218
185
f_rpm_install = util .BuildFactory ()
219
186
f_rpm_install .addStep (getScript ("rpm-install.sh" ))
220
187
f_rpm_install .addStep (getRpmInstallStep ())
221
188
f_rpm_install .addStep (getScript ("pam-test.sh" ))
222
189
f_rpm_install .addStep (getPAMTestStep ())
223
190
224
- ## f_rpm_upgrade
225
191
f_rpm_upgrade = util .BuildFactory ()
226
192
f_rpm_upgrade .addStep (getMajorVersionStep ())
227
193
f_rpm_upgrade .addStep (getScript ("rpm-upgrade.sh" ))
228
194
f_rpm_upgrade .addStep (getRpmUpgradeStep ())
229
195
196
+
230
197
####### WORKERS and BUILDERS
231
198
232
199
# The 'workers' list defines the set of recognized workers. Each element is
@@ -274,15 +241,16 @@ for builder_name in BUILDERS_INSTALL:
274
241
elif builder_type == "rpm" :
275
242
factory_install = f_rpm_install
276
243
factory_upgrade = f_rpm_upgrade
277
- build_arch = os_name + str (os_info [os_info_name ]["version_name" ]) + "-" + platform
244
+ build_arch = (
245
+ os_name + str (os_info [os_info_name ]["version_name" ]) + "-" + platform
246
+ )
278
247
279
248
# FIXME - all RPM's should follow the same conventions!
280
249
if os_name == "centos" and os_info [os_info_name ]["version_name" ] >= 9 :
281
250
if platform == "amd64" :
282
251
platform = "x86_64"
283
252
build_arch = f"centos/{ os_info [os_info_name ]['version_name' ]} /{ platform } "
284
253
285
-
286
254
c ["builders" ].append (
287
255
util .BuilderConfig (
288
256
name = builder_name ,
@@ -379,15 +347,3 @@ for builder_name in BUILDERS_INSTALL:
379
347
factory = factory_upgrade ,
380
348
)
381
349
)
382
-
383
- c ["logEncoding" ] = "utf-8"
384
-
385
- c ["multiMaster" ] = True
386
-
387
- c ["mq" ] = { # Need to enable multimaster aware mq. Wamp is the only option for now.
388
- "type" : "wamp" ,
389
- "router_url" : os .getenv ("MQ_ROUTER_URL" , default = "ws://localhost:8085/ws" ),
390
- "realm" : "realm1" ,
391
- # valid are: none, critical, error, warn, info, debug, trace
392
- "wamp_debug_level" : "info" ,
393
- }
0 commit comments