/[ascend]/trunk/tools/buildbot/master.cfg
ViewVC logotype

Contents of /trunk/tools/buildbot/master.cfg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3336 - (show annotations) (download)
Sat Jan 27 09:15:00 2018 UTC (3 months, 3 weeks ago) by jpye
File size: 12183 byte(s)
fix Schedulers for additional changesource for freesteam

1 # vim: ft=python ts=4 sw=4
2 """
3 This is the Buildbot master.cfg configuration file. We keep it at
4 /srv/ascend/buildbot/master.
5 """
6
7 from buildbot.plugins import *
8 import urllib.parse
9
10 ASCEND_SVN = "http://svn.ascend4.org/"
11
12 def SVNURL(branch):
13 if branch=="trunk":
14 return "%s%s" % (ASCEND_SVN,"trunk")
15 else:
16 return "%sbranches/%s" % (ASCEND_SVN,urllib.parse.quote_plus(branch))
17
18 ASCEND_SVN_INTERP = util.Transform(SVNURL,util.Interpolate("%(src::branch)s"))
19
20 #ASCEND_TESTS = "general_color general_dstring general_hashpjw general_list general_listio general_pool general_pretty general_stack general_table general_tm_time general_ospath general_env general_ltmatrix general_ascMalloc utilities_error utilities_ascDynaLoad utilities_ascEnvVar utilities_ascPrint utilities_ascSignal utilities_readln utilities_set linear_qrrank linear_mtx compiler_basics compiler_expr compiler_fixfree compiler_fixassign packages_defaultall solver_slv_common solver_slvreq solver_qrslv solver_fprops solver_lrslv integrator_lsode".split()
21 # solver_ipopt
22
23 # This is the dictionary that the buildmaster pays attention to. We also use
24 # a shorter alias to save typing.
25 c = BuildmasterConfig = {}
26
27 #------------------------------------------------------------------------------
28 ####### WORKERS
29
30 # The 'workers' list defines the set of recognized workers. Each element is
31 # a Worker object, specifying a unique worker name and password. The same
32 # worker name and password must be configured on the worker.
33 c['workers'] = [
34 worker.Worker("bot-ub1404"
35 ,"pwx2ub1404"
36 ,properties={'os':'ubuntu'}
37 ,max_builds=2
38 )
39 ]
40
41 WORKERS = ['bot-ub1404']
42
43 # 'protocols' contains information about protocols which master will use for
44 # communicating with workers. You must define at least 'port' option that workers
45 # could connect to your master with this protocol.
46 # 'port' must match the value configured into the workers (with their
47 # --master option)
48 c['protocols'] = {'pb': {'port': 9989}}
49
50 #------------------------------------------------------------------------------
51 ####### CHANGESOURCES
52
53 # the 'change_source' setting tells the buildmaster how it should find out
54 # about source code changes. Here we point to the buildbot clone of pyflakes.
55
56 FREESTEAM_SVN = "https://svn.code.sf.net/p/freesteam/code"
57 FREESTEAM_SVN_TRUNK = "%s/trunk"%(FREESTEAM_SVN,)
58
59 c['change_source'] = [
60 # ASCEND
61 changes.PBChangeSource(
62 passwd='ascend4bb')
63 # freesteam
64 ,changes.SVNPoller(
65 repourl=FREESTEAM_SVN
66 ,split_file=util.svn.split_file_alwaystrunk)
67 ]
68
69 # CUNIT
70 #CUNIT_SVN = "https://svn.code.sf.net/p/cunit/code/"
71 #CUNIT_SVN_INTERP = util.Interpolate("%(kw:svn)s%(src::branch)s",svn=CUNIT_SVN)
72
73 #c['change_source'].append(changes.SVNPoller(
74 # repourl=CUNIT_SVN
75 # ,split_file=my_split_file_branches
76 # ,pollinterval=3600
77 #))
78
79 #from buildbot import revlinks
80 #c['revlink'] = revlinks.RevlinkMatch(
81 # repo_urls=[r'http://svn.ascend4.org/(.*)',r'(.*)']
82 #,revlink=r'http://code.ascend4.org/ascend/\1?view=revision&revision=%s'
83 # ,revlink=r'http://ascend4.org/stuff=\1'
84 #)
85 c['revlink'] = util.RevlinkMatch([r'http://svn.ascend4.org/(.*)'],
86 r'http://code.ascend4.org/ascend?view=revision&revision=%s')
87
88 c['revlink'] = util.RevlinkMatch(
89 repo_urls=[r'http://svn.ascend4.org/(.*)$'
90 ,r'/srv/ascend/svn/ascend/(.*)$'
91 ]
92 ,revlink=r'http://ascend4.org/r%s'
93 )
94
95 #------------------------------------------------------------------------------
96 ####### SCHEDULERS
97
98 # Configure the Schedulers, which decide how to react to incoming changes. In this
99 # case, just kick off a 'ascend' build
100
101 c['schedulers'] = []
102
103 # ASCEND SCHEDULERS
104
105 c['schedulers'].append(schedulers.AnyBranchScheduler(
106 name='ascendsvn'
107 ,builderNames=['ascend','ascend-lcov']
108 ,change_filter=util.ChangeFilter(
109 repository_re=r"ascend4\.org")
110 ,treeStableTimer=2
111 ))
112
113 c['schedulers'].append(schedulers.SingleBranchScheduler(
114 name='svntrunk'
115 ,builderNames=['ascend-doc']
116 ,change_filter=util.ChangeFilter(
117 branch='trunk'
118 ,repository_re=r"ascend4\.org")
119 ,treeStableTimer=2
120 ))
121
122 c['schedulers'].append(schedulers.ForceScheduler(
123 name='force_ascend'
124 ,builderNames=['ascend','ascend-lcov','ascend-doc']
125 ,label='Force ASCEND build'
126 ,codebases=[
127 util.CodebaseParameter(
128 ""
129 ,label="Repository"
130 ,branch=util.ChoiceStringParameter(
131 name="branch"
132 ,choices=['trunk','relerrorlist']
133 ,default='trunk'
134 )
135 ,revision=util.FixedParameter(name="revision",default="")
136 )
137 ]
138 ))
139
140 # FREESTEAM SCHEDULERS
141
142 c['schedulers'].append(schedulers.SingleBranchScheduler(
143 name='freesteam'
144 ,builderNames=['freesteam']
145 ,change_filter=util.ChangeFilter(branch='trunk'
146 ,repository_re="freesteam")
147 ,treeStableTimer=2
148 ))
149 c['schedulers'].append(schedulers.ForceScheduler(
150 name='force_freesteam'
151 ,builderNames=['freesteam']
152 ,label='Force freesteam build'
153 ,codebases=[
154 util.CodebaseParameter("",
155 revision=util.FixedParameter(name="revision",default="")
156 )
157 ]
158 ))
159
160
161
162 ## CUNIT SCHEDULERS
163 #
164 #c['schedulers'].append(schedulers.ForceScheduler(
165 # name="force_cunit"
166 # ,buttonName="force"
167 # ,builderNames=["cunit"]
168 # ,codebases=[
169 # util.CodebaseParameter(
170 # "",
171 # name="svn",
172 # # will generate a combo box
173 # branch=util.ChoiceStringParameter(
174 # name="branch"
175 # ,choices=["trunk"]+["branches/%s"%i for i in ["mingw64"]]
176 # ,default="branches/ming64"
177 # ),
178 # # following are hidden, but needed for the scheduling system
179 # revision=util.FixedParameter(name="revision", default=""),
180 # repository=util.FixedParameter(name="repository", default=""),
181 # project=util.FixedParameter(name="project", default=""),
182 # )]
183 #))
184
185 ####### BUILDERS
186
187 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
188 # what steps, and which workers can execute them. Note that any particular build will
189 # only take place on one worker.
190
191 c['builders'] = []
192
193 asctargets =["test","ascend","models","solvers"]
194 ascendsvnstep = steps.SVN(repourl=ASCEND_SVN_INTERP ,mode="incremental" ,haltOnFailure=True)
195 ascendcleanstep = steps.ShellCommand(name="clean",command=['/usr/bin/scons','-c']+asctargets, haltOnFailure=True)
196 ascendteststep1 = steps.Test(name="test clean",command=["test/test_expectpass_mallocdebug"],env={'LD_LIBRARY_PATH':'.:/usr/local/lib'},haltOnFailure=True)
197 ascendteststep2 = steps.Test(name="test leaky",command=["test/test_expectpass_leaky"],env={'LD_LIBRARY_PATH':'.:/usr/local/lib'},haltOnFailure=True)
198
199 # ASCEND CUNIT TESTS
200
201 ascendfactory = util.BuildFactory()
202 # svn check URL
203 #ascendfactory.addStep(steps.ShellCommand(name=ASCEND_SVN_INTERP,command=['svn','info',ASCEND_SVN_INTERP],haltOnFailure=True))
204 # svn up
205 ascendfactory.addStep(ascendsvnstep)
206 # clean
207 ascendfactory.addStep(ascendcleanstep)
208 # build
209 ascendfactory.addStep(steps.Compile(name="build"
210 ,command=["/usr/bin/scons","WITH_DOC_BUILD=0","MALLOC_DEBUG=1"
211 ,"ascend","models","solvers","test"
212 ],haltOnFailure=True
213 # ,warningPattern="^(.\*?):([0-9]+): [Ww]arning: (.\*)$"
214 # ,warningExtractor=steps.Compile.warnExtractFromRegexpGroups
215 ))
216 # test
217 ascendfactory.addStep(ascendteststep1)
218 ascendfactory.addStep(ascendteststep2)
219
220 c['builders'].append(util.BuilderConfig(
221 name="ascend", workernames=WORKERS
222 ,factory=ascendfactory
223 ))
224
225 # ASCEND LCOV COVERAGE
226
227 covfactory = util.BuildFactory()
228
229 LCOV = "/usr/local/bin/lcov"
230 GENHTML = "/usr/local/bin/genhtml"
231
232 from buildbot.steps.transfer import DirectoryUpload
233
234 covfactory.addSteps([
235 ascendsvnstep
236 ,ascendcleanstep
237 ,steps.Compile(name="build"
238 ,command=["/usr/bin/scons","WITH_DOC_BUILD=0","MALLOC_DEBUG=1","GCOV=1"]+asctargets
239 ,haltOnFailure=True)
240 ,steps.ShellCommand(name="zero",command=[LCOV,"-z","-d","."],haltOnFailure=True)
241 ,ascendteststep1
242 ,ascendteststep2
243 ,steps.ShellCommand(name="fprops",command=['models/johnpye/fprops/test/cutest'],haltOnFailure=True)
244 ,steps.ShellCommand(name="lcov"
245 ,command=[LCOV,"-c","-d",".","-o","test/lcov1.info","-t","\"ASCEND CUnit Tests\"","--no-external","--exclude","*<stdout>"]
246 ,haltOnFailure=True)
247 ,steps.ShellCommand(name="genhtml"
248 ,command=[GENHTML,"-o","lcov-html","test/lcov1.info","--ignore-errors","source","--prefix",util.Interpolate('%(prop:builddir)s/build')]
249 ,haltOnFailure=True)
250 ,steps.ShellCommand(name="chmod",command=["/bin/chmod","a+rX","lcov-html","-R"],haltOnFailure=True)
251 ,DirectoryUpload(name="upload"
252 ,workersrc="lcov-html"
253 ,masterdest=util.Interpolate("~/lcov-upload/%(prop:buildername)s-%(prop:buildnumber)s")
254 ,url=util.Interpolate("lcov/%(prop:buildername)s-%(prop:buildnumber)s/"))
255 ,steps.MasterShellCommand(name="latest"
256 ,command=["/bin/ln","-fsT",util.Interpolate("/home/buildbot/lcov-upload/%(prop:buildername)s-%(prop:buildnumber)s")
257 ,util.Interpolate("/home/buildbot/lcov-upload/%(prop:buildername)s-latest")])
258 ])
259
260 c['builders'].append(util.BuilderConfig(
261 name="ascend-lcov", workernames=WORKERS
262 ,factory=covfactory
263 ))
264
265 # LATEST DOCUMENTATION BUILD
266
267 docfactory = util.BuildFactory()
268
269 docfactory.addSteps([
270 ascendsvnstep
271 ,steps.Compile(name="build"
272 ,command=["/usr/bin/scons","WITH_DOC_BUILD=1","doc"]
273 ,haltOnFailure=True)
274 ,steps.ShellCommand(name="chmod",command=["/bin/chmod","a+rX","doc","-R"],haltOnFailure=True)
275 ,DirectoryUpload(name="upload"
276 ,workersrc="doc/doxy"
277 ,masterdest=util.Interpolate("~/doc-upload/%(prop:buildername)s-%(prop:buildnumber)s")
278 ,url=util.Interpolate("doc/%(prop:buildername)s-%(prop:buildnumber)s/html")
279 ,haltOnFailure=True)
280 ,steps.MasterShellCommand(name="latest"
281 ,command=["/bin/ln","-fsT"
282 ,util.Interpolate("/home/buildbot/doc-upload/%(prop:buildername)s-%(prop:buildnumber)s/html")
283 ,"/home/buildbot/doc-upload/latest"])
284 ])
285
286 c['builders'].append(util.BuilderConfig(
287 name="ascend-doc",workernames=['bot-ub1404']
288 ,factory=docfactory
289 ))
290
291 # FREESTEAM BUILD
292
293 fsfactory = util.BuildFactory()
294 fsfactory.addSteps([
295 steps.SVN(repourl=FREESTEAM_SVN_TRUNK, mode="full", method="clobber", haltOnFailure=True)
296 ,steps.Compile(name="build",command=["/usr/bin/scons","DEBUG=1","test"],haltOnFailure=True)
297 ,steps.ShellCommand(name="test",command=["./test"],haltOnFailure=True
298 ,env={'LD_LIBRARY_PATH':"."})
299 ])
300
301 c['builders'].append(util.BuilderConfig(
302 name="freesteam",workernames=['bot-ub1404']
303 ,factory=fsfactory
304 ))
305
306 #------------------------------------------------------------------------------
307 ####### BUILDBOT SERVICES
308 #------------------------------------------------------------------------------
309 # 'services' is a list of BuildbotService items like reporter targets. The
310 # status of each build will be pushed to these targets. buildbot/reporters/*.py
311 # has a variety to choose from, like IRC bots.
312
313 c['services'] = []
314
315 #------------------------------------------------------------------------------
316 ####### PROJECT IDENTITY
317
318 # the 'title' string will appear at the top of this buildbot installation's
319 # home pages (linked to the 'titleURL').
320
321 c['title'] = "ASCEND"
322 c['titleURL'] = "http://ascend4.org/Buildbot"
323
324 # the 'buildbotURL' string should point to the location where the buildbot's
325 # internal web server is visible. This typically uses the port number set in
326 # the 'www' entry below, but with an externally-visible host name which the
327 # buildbot cannot figure out without some help.
328
329 c['buildbotURL'] = "https://build.ascend4.org/"
330 #c['buildbotURL'] = "http://localhost:8020/"
331
332 # minimalistic config to activate new web UI
333 c['www'] = {
334 'port':8020
335 ,'plugins': {
336 'waterfall_view': True
337 # ,'console_view': True
338 # ,'grid_view': True
339 }
340 ,'allowed_origins':['*']
341 # ,'auth': util.HTPasswdAuth("/srv/ascend/apache2/svn.htpasswd")
342 }
343
344 #------------------------------------------------------------------------------
345 ####### DB URL
346
347 c['db'] = {
348 # This specifies what database buildbot uses to store its state. You can leave
349 # this at its default for all but the largest installations.
350 'db_url' : "sqlite:///state.sqlite",
351 }
352
353 #------------------------------------------------------------------------------
354 ####### VALIDATION
355
356 import re
357 c['validation'] = {
358 'branch' : re.compile(r'^[A-Za-z0-9][\w.+/~-]+$'),
359 'revision' : re.compile(r'[1-9][0-9]+$'),
360 'property_name' : re.compile(r'^[\w\.\-\/\~:]*$'),
361 'property_value' : re.compile(r'^[\w\.\-\/\~:]*$'),
362 }
363
364
365

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22