This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
master.cfg
206 lines (170 loc) · 6.54 KB
/
master.cfg
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#! /usr/bin/python
# This configuration file is described in $BUILDBOT/docs/config.xhtml
# This is used to run the Twisted Buildbot at
# <http://buildbot.twistedmatrix.com/>. Passwords and other secret
# information are loaded from a neighboring file called 'private.py'.
# Enable TCP keepalives by monkey patching Twisted.
# Twisted ticket: https://twistedmatrix.com/trac/ticket/8492
# The build master is terrible at noticing
# disconnected slaves. Also it's terrible at letting me enable tcp
# keepalives.
from twisted.spread.pb import PBServerFactory
_parent = PBServerFactory.protocol
class KeepaliveBroker(_parent):
def makeConnection(self, transport):
transport.setTcpKeepAlive(True)
return _parent.makeConnection(self, transport)
PBServerFactory.protocol = KeepaliveBroker
# We now return to your regularly scheduled program.
from os.path import expanduser, dirname
import sys
sys.path.insert(0, dirname(__file__))
del expanduser, dirname, sys
from buildbot.process.properties import Interpolate
from buildbot.schedulers.timed import Nightly
from buildbot.schedulers import forcesched
from buildbot.status.github import GitHubStatus
from buildbot.status.web.auth import BasicAuth
from buildbot.status.web.authz import Authz
from buildbot.locks import SlaveLock
from buildbot.buildslave import BuildSlave
import private # holds passwords
reload(private) # make it possible to change the contents without a restart
from twisted_factories import (
TwistedBenchmarksFactory,
)
from txbuildbot.git import MergeForward, TwistedGit
from txbuildbot.web import TwistedGitHubEventHandler, TwistedWebStatus
BuildmasterConfig = c = {}
# Maximum number of builds to execute on a slave at a time. Slaves
# not listed here have no limit.
slave_max_builds = {}
ubuntu16_04_slaves = ['rax-ubuntu1604-%d' % (i,) for i in range(1,4)]
# These builders run some heavy builders (pypy, jython) so only run one at a
# time.
for slave in ubuntu16_04_slaves:
slave_max_builds[slave] = 1
c['slaves'] = []
alwaysNotify = ['tom.prince@ualberta.net']
for bot in private.bot_info.keys():
password, notifyOnMissing = private.bot_info[bot]
if alwaysNotify not in notifyOnMissing:
notifyOnMissing.extend(alwaysNotify)
c['slaves'].append(BuildSlave(
bot, password, slave_max_builds.get(bot, None),
notifyOnMissing, 2400))
c['change_source'] = []
## configure the builders
gitURL = "https://github.com/twisted/twisted.git"
git_update = [
TwistedGit(repourl=gitURL, branch="trunk", mode='full', method='fresh'),
MergeForward(repourl=gitURL)
]
builders = []
oneCPULock = SlaveLock('cpu-1', maxCount=1)
twoCPULock = SlaveLock('cpu-2', maxCount=2)
#
# Benchmarks
#
builders.append({
'name': 'ubuntu18.04-py2.7-benchmark',
'builddir': 'ubuntu18.04-py2.7-benchmark',
'slavenames': ubuntu16_04_slaves,
'locks': [twoCPULock.access('counting')],
'factory': TwistedBenchmarksFactory(python='python',
source=git_update),
'category': 'benchmark'})
builders.append({
'name': 'ubuntu16.04-pypy3-benchmark',
'builddir': 'ubuntu16.04-pypy3-benchmark',
'slavenames': ubuntu16_04_slaves,
'locks': [twoCPULock.access('counting')],
'factory': TwistedBenchmarksFactory(python="pypy3",
source=git_update),
'category': 'benchmark'})
builders.append({
'name': 'ubuntu16.04-pypy-benchmark',
'builddir': 'ubuntu16.04-pypy-benchmark',
'slavenames': ubuntu16_04_slaves,
'locks': [twoCPULock.access('counting')],
'factory': TwistedBenchmarksFactory(python="pypy",
source=git_update),
'category': 'benchmark'})
builders.append({
'name': 'ubuntu16.04-py3.5-benchmark',
'builddir': 'ubuntu16.04-py3.5-benchmark',
'slavenames': ubuntu16_04_slaves,
'locks': [twoCPULock.access('counting')],
'factory': TwistedBenchmarksFactory(python="python3.5",
source=git_update),
'category': 'benchmark'})
c['builders'] = builders
# Now set up the schedulers. We do this after setting up c['builders']
# so we can auto-generate the correct configuration from the builder
# definitions.
c['schedulers'] = [
# Run the benchmark test suite every day.
Nightly(
name="Benchmarks",
builderNames=[
b['name'] for b in builders if b['category'] == 'benchmark'],
hour=6, minute=3, branch='trunk', onlyIfChanged=True,
),
forcesched.ForceScheduler(
name='force-benchmark',
repository=forcesched.FixedParameter(name='repository', default=''),
branch=forcesched.StringParameter(name='branch', default=''),
project=forcesched.FixedParameter(name="project", default=""),
properties=[forcesched.StringParameter(name='test-case-name', label="test case", default='twisted')],
builderNames=[ b['name'] for b in builders if b['category'] == 'benchmark'],
),
]
# configure other status things
c['slavePortnum'] = 9987
c['status'] = []
from twisted.python.util import sibpath
import jinja2
users = [ ('twisted', 'matrix') ]
authz = Authz(
auth=BasicAuth(users),
default_action='auth',
gracefulShutdown=False,
cleanShutdown=False,
showUsersPage=False,
stopAllBuilds = True,
)
status = TwistedWebStatus(
authz=authz,
public_html=sibpath(__file__, 'public_html'),
change_hook_dialects={
# Will create a resource available at BUILDBOT_URL/change_hook/github
'github': {
'secret': private.github_hook_secret,
'strict': private.github_hook_strict,
'class': TwistedGitHubEventHandler,
},
},
jinja_loaders=[jinja2.FileSystemLoader(sibpath(__file__, 'templates'))],
**private.webOptions)
c['status'].append(status)
del status
c['debugPassword'] = private.debugPassword
c['status'].append(GitHubStatus(
token=private.github_status_token,
repoOwner='twisted',
repoName='twisted',
# When build are manually triggered from the builder page and only the
# branch is specified, `revision` is empty so we are looking at
# `got_revision`.
sha=Interpolate("%(prop:got_revision)s"),
startDescription='Buildbot test started.',
endDescription='Buildbot test done.',
))
c['projectName'] = "Twisted"
c['projectURL'] = "http://twistedmatrix.com/"
c['buildbotURL'] = "http://buildbot.twistedmatrix.com/"
c['buildCacheSize'] = 500
c['mergeRequests'] = lambda builder, req1, req2: False
# vim: filetype=python sw=4 expandtab
# Cleanup old builds.
c['buildHorizon'] = 1000