2 # ex: set syntax=python:
4 ###################################################################################
5 # This is the file configuration of the buildmaster used in the Simgrid project.
7 #from os import environ
8 #environ['LC_ALL'] = "C"
10 # The buildmaster configuration object.
12 c = BuildmasterConfig = {}
14 # Project informations
16 c['projectName'] = "SimGrid compilation status"
17 c['projectURL']= "http://simgrid.gforge.inria.fr/"
18 c['buildbotURL'] = "http://bob.loria.fr:8010/"
20 # Gets bot from account module (hide passphrases)
21 from account import slaves
24 # Port number used by slaves
25 c['slavePortnum'] = 9989
29 ####################################################################################
30 # builders declarations
32 from extensions import CustomSVN, CustomConfigure, CustomCheck, CleanupCommand
33 from buildbot.process import factory
34 from buildbot.steps.transfer import FileUpload,FileDownload
35 from buildbot.steps.shell import ShellCommand
36 from buildbot.steps.source import SVN
37 from buildbot.process.properties import WithProperties
39 # build tarball factory
40 dist_factory = factory.BuildFactory()
41 dist_factory.addStep(CustomSVN, name ="svn update", baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
42 dist_factory.addStep(ShellCommand,name ="clean oldies",description = "removing old archives", descriptionDone ="clean oldies",
43 flunkOnFailure=False,command=["bash","-c","rm -rfv simgrid-*-svn-r* *.tar.gz build/*tar.gz"])
44 dist_factory.addStep(ShellCommand,name = "svn revert",description = "reverting the SVN",descriptionDone = "svn revert",
45 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","."])
46 dist_factory.addStep(ShellCommand,name = "bootstrap",description = "bootstraping",descriptionDone = "bootstrap",
47 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./bootstrap"])
48 dist_factory.addStep(ShellCommand,name = "configure", description="configuring", descriptionDone="configure",
49 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--enable-maintainer-mode"])
50 dist_factory.addStep(ShellCommand,name = "make -C src", description = "building src", descriptionDone = "make -C src",
51 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4","-C","src"])
52 dist_factory.addStep(ShellCommand,name = "make -C tools", description = "building tools", descriptionDone = "make -C tools",
53 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4","-C","tools"])
54 dist_factory.addStep(ShellCommand,name = "make dist", description = "building archive", descriptionDone = "make dist",
55 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","dist"])
56 dist_factory.addStep(FileUpload(name="Upload archive",haltOnFailure = True,
57 slavesrc= WithProperties("simgrid-3.3-svn-r%s.tar.gz", "got_revision"),
58 masterdest=WithProperties("simgrid-3.3-svn-r%s.tar.gz", "got_revision")))
59 dist_factory.addStep(FileUpload(name="Update lastest archive",haltOnFailure = True,
60 slavesrc= WithProperties("simgrid-3.3-svn-r%s.tar.gz", "got_revision"),
61 masterdest="simgrid-3.3-svn-r.tar.gz"))
63 archive = "simgrid-3.3-svn-r%(revision:-)s.tar.gz"
64 # Test tarball factories
65 pthreads_factory_O3= factory.BuildFactory()
66 pthreads_factory_O3.addStep(CleanupCommand)
67 pthreads_factory_O3.addStep(FileDownload(name="get archive",haltOnFailure=True,slavedest=WithProperties(archive),mastersrc=WithProperties(archive)))
68 pthreads_factory_O3.addStep(ShellCommand, name ="open archive",descriptionDone="open archive", command=["tar","xvfz",WithProperties(archive),"--strip","1"])
69 pthreads_factory_O3.addStep(ShellCommand,name = "configure", description="running configure", descriptionDone="configure",
70 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-pthread","--enable-compile-warnings","--enable-compile-optimizations"])
71 pthreads_factory_O3.addStep(ShellCommand,name = "make", description = "running make", descriptionDone = "make",
72 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4"])
73 pthreads_factory_O3.addStep(CustomCheck,name ="check all", description = "running check all", descriptionDone ="check all",
74 haltOnFailure = True,command=["./checkall"])
76 ucontext_factory_O3= factory.BuildFactory()
77 ucontext_factory_O3.addStep(CleanupCommand)
78 ucontext_factory_O3.addStep(FileDownload(name="get archive",haltOnFailure=True,slavedest=WithProperties(archive),mastersrc=WithProperties(archive)))
79 ucontext_factory_O3.addStep(ShellCommand, name ="open archive",descriptionDone="open archive", command=["tar","xvfz",WithProperties(archive),"--strip","1"])
80 ucontext_factory_O3.addStep(CustomConfigure,name ="configure",description="running configure",descriptionDone="configure",
81 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-context=ucontext","--enable-compile-warnings","--enable-compile-optimizations","--enable-botbuild"]) # Main difference with pthread_factory
82 ucontext_factory_O3.addStep(ShellCommand,name = "make",description = "running make",descriptionDone = "make",
83 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4"])
84 ucontext_factory_O3.addStep(CustomCheck,name = "check all",description = "running check all",descriptionDone ="check all",
85 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./checkall"])
88 windows_factory= factory.BuildFactory()
89 windows_factory.addStep(SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
90 windows_factory.addStep(ShellCommand,name = "{make}",description = "running make",descriptionDone = "make",haltOnFailure = True,command=["C:\\buildslave\\projects\\simgrid\\builddir\\buildMake", "C:\\buildslave\\projects\\simgrid\\builddir\\make_all.tst"])
91 windows_factory.addStep(ShellCommand,name = "{test suite}",description= "running test suite",descriptionDone ="test suite",haltOnFailure = True,command=["C:\\buildslave\\projects\\simgrid\\builddir\\Test", "C:\\buildslave\\projects\\simgrid\\builddir\\test_all.tst"])
94 # One lock per machine since some tests open sockets on fixed ports
95 from buildbot import locks
96 artimon_lock = locks.MasterLock("artimon_lock")
97 fastnet_lock = locks.MasterLock("fastnet_lock")
101 c['builders'].append({'name':'distBuilder',
102 'slavename':'bob_dist',
103 'builddir':'/var/lib/buildbot/simgrid/dist-worker',
104 'factory':dist_factory})
106 c['builders'].append({'name':'linux_amd64_pth',
108 'builddir':'/var/lib/buildbot/simgrid/linux_amd64_pthreads/builddir_O3',
109 'factory':pthreads_factory_O3})
110 c['builders'].append({'name':'linux_amd64_uctx',
112 'builddir':'/var/lib/buildbot/simgrid/linux_amd64_ucontext/builddir_O3',
113 'factory':ucontext_factory_O3})
115 c['builders'].append({'name':'debiantesting_amd64_pth',
116 'slavenames':['pipol1','pipol2','pipol3','pipol4','pipol5','pipol6','pipol7'],
117 'builddir':'/var/lib/buildbot/simgrid/pipol/debiantesting_amd64_pth',
118 'factory':pthreads_factory_O3})
121 c['builders'].append({'name':'linux_i386_pth',
122 'slavename':'artimon_pthreads',
123 'builddir':'/var/lib/buildbot/simgrid/linux_i386_pthreads/builddir_O3',
124 'factory':pthreads_factory_O3,
125 'locks': [artimon_lock]})
126 c['builders'].append({'name':'linux_i386_uctx',
127 'slavename':'artimon_ucontext',
128 'builddir':'/var/lib/buildbot/simgrid/linux_i386_ucontext/builddir_O3',
129 'factory':ucontext_factory_O3,
130 'locks': [artimon_lock]})
132 c['builders'].append({'name':'mac_osx_pth',
133 'slavename':'fastnet_pthreads',
134 'builddir':'/var/buildbot/simgrid/mac_os_x_pthreads/builddir',
135 'factory':pthreads_factory_O3})
136 # Next one not very interesting: it constitently fails (arch not supported yet)
137 #c['builders'].append({'name':'mac_os_x_ucontext',
138 # 'slavename':'fastnet',
139 # 'factory':ucontext_factory_O3,
140 # 'builddir':'/var/buildbot/simgrid/mac_os_x_ucontext/builddir',
141 # 'locks': [fastnet_lock]})
143 c['builders'].append({'name':'windows_builder',
144 'slavename':'windows_slave',
145 'builddir':"C:\\buildslave\\projects\\simgrid\\builddir",
146 'factory':windows_factory})
149 test_builders = [b['name'] for b in c['builders']]
151 test_builders.remove("distBuilder")
153 ####### CHANGESOURCES
155 # Get changes from SVN, by polling every 60 seconds
156 from buildbot.changes.svnpoller import SVNPoller
157 c['change_source'] = SVNPoller("svn://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk", pollinterval=600)
159 # Once we have a change, build a tarball
160 from buildbot import scheduler
163 c['schedulers'].append( scheduler.Scheduler(name="maketarball", branch=None, treeStableTimer=60, builderNames=['distBuilder']) )
165 # and build everything afterward, when the archive is builded
166 c['schedulers'].append( scheduler.Triggerable(name="run tests", builderNames=test_builders) )
168 from buildbot.steps import trigger
169 dist_factory.addStep(trigger.Trigger(schedulerNames=['run tests'], waitForFinish=False,
170 set_properties={"revision":WithProperties("%(got_revision)s"),
171 "got_revision":WithProperties("%(got_revision)s")}))
176 # TODO: move to modernity here (but write an index.html for that)
177 #from buildbot.status.html import WebStatus
178 #c['status'].append(WebStatus(8010))
179 from buildbot.status import html
180 c['status'].append( html.Waterfall(http_port=8010) )
182 from buildbot.status import words
183 c['status'].append(words.IRC(host="irc.oftc.net", nick="simgrid_buildbot", channels=["#simgrid"]))
185 from buildbot.status.mail import MailNotifier
186 mn = MailNotifier(fromaddr="sg-dev@lists.gforge.inria.fr",
187 sendToInterestedUsers=False, addLogs=True, extraRecipients=['martin.quinson@loria.fr'])
188 c['status'].append(mn)
190 ####################################################################################
191 ## Scheduler configuration
193 # We use only one scheduling right now, a nightly one, which reruns everything
195 # TODO: Define a list of all slaves and use it here and in the definition of c['builders']
197 from buildbot.scheduler import Scheduler, Nightly, Periodic
199 #nightly_scheduler = Nightly(
201 # all_slaves, # defined in account.py
202 # hour=[12,24], # schedule time
205 #hourly = Periodic("hourly_scheduler", all_slaves, 60*60*2) # delay in seconds
207 #c['schedulers'] = [nightly_scheduler,hourly]
208 #c['schedulers'] = []