Skip to content

Commit 1d6c724

Browse files
committed
Master-libvirt move to common class
1 parent bc93a4a commit 1d6c724

File tree

1 file changed

+26
-70
lines changed

1 file changed

+26
-70
lines changed

master-libvirt/master.cfg

Lines changed: 26 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,35 @@
11
# -*- python -*-
22
# ex: set filetype=python:
33

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
144
import os
15-
import sys
165

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
2711

2812
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
2913
# that the rest of the configuration can be public.
3014
config = {"private": {}}
31-
exec(open("../master-private.cfg").read(), config, {})
15+
exec(open("master-private.cfg").read(), config, {})
3216

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+
)
3430

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")
3931
artifactsURL = os.getenv("ARTIFACTS_URL", default="https://ci.mariadb.org")
4032

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-
6533

6634
####### UTILS
6735
def getRpmUpgradeStep():
@@ -120,6 +88,7 @@ def getRpmInstallStep():
12088
command=["./rpm-install.sh"],
12189
)
12290

91+
12392
def getDebUpgradeStep():
12493
return Test(
12594
name="upgrade",
@@ -185,6 +154,7 @@ def getMajorVersionStep():
185154
),
186155
)
187156

157+
188158
def getPAMTestStep():
189159
return Test(
190160
name="PAM authentication test",
@@ -199,34 +169,31 @@ def getPAMTestStep():
199169
command=["./pam-test.sh"],
200170
)
201171

202-
# FACTORY
203172

204-
## f_deb_install
173+
# FACTORY
205174
f_deb_install = util.BuildFactory()
206175
f_deb_install.addStep(getScript("deb-install.sh"))
207176
f_deb_install.addStep(getDebInstallStep())
208177
f_deb_install.addStep(getScript("pam-test.sh"))
209178
f_deb_install.addStep(getPAMTestStep())
210179

211-
## f_deb_upgrade
212180
f_deb_upgrade = util.BuildFactory()
213181
f_deb_upgrade.addStep(getMajorVersionStep())
214182
f_deb_upgrade.addStep(getScript("deb-upgrade.sh"))
215183
f_deb_upgrade.addStep(getDebUpgradeStep())
216184

217-
## f_rpm_install
218185
f_rpm_install = util.BuildFactory()
219186
f_rpm_install.addStep(getScript("rpm-install.sh"))
220187
f_rpm_install.addStep(getRpmInstallStep())
221188
f_rpm_install.addStep(getScript("pam-test.sh"))
222189
f_rpm_install.addStep(getPAMTestStep())
223190

224-
## f_rpm_upgrade
225191
f_rpm_upgrade = util.BuildFactory()
226192
f_rpm_upgrade.addStep(getMajorVersionStep())
227193
f_rpm_upgrade.addStep(getScript("rpm-upgrade.sh"))
228194
f_rpm_upgrade.addStep(getRpmUpgradeStep())
229195

196+
230197
####### WORKERS and BUILDERS
231198

232199
# The 'workers' list defines the set of recognized workers. Each element is
@@ -274,15 +241,16 @@ for builder_name in BUILDERS_INSTALL:
274241
elif builder_type == "rpm":
275242
factory_install = f_rpm_install
276243
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+
)
278247

279248
# FIXME - all RPM's should follow the same conventions!
280249
if os_name == "centos" and os_info[os_info_name]["version_name"] >= 9:
281250
if platform == "amd64":
282251
platform = "x86_64"
283252
build_arch = f"centos/{os_info[os_info_name]['version_name']}/{platform}"
284253

285-
286254
c["builders"].append(
287255
util.BuilderConfig(
288256
name=builder_name,
@@ -379,15 +347,3 @@ for builder_name in BUILDERS_INSTALL:
379347
factory=factory_upgrade,
380348
)
381349
)
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

Comments
 (0)