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 bots
23 from account import all_slaves
26 # Port number used by slaves
27 c['slavePortnum'] = 9989
31 ####################################################################################
32 # builders declarations
34 from extensions import CustomSVN, CustomConfigure, CustomCheck
35 from buildbot.process import factory
36 from buildbot.steps.transfer import FileUpload,FileDownload
37 from buildbot.steps.shell import ShellCommand
38 from buildbot.steps.source import SVN
39 from buildbot.process.properties import WithProperties
41 # build tarball factory
42 dist_factory = factory.BuildFactory()
43 dist_factory.addStep(CustomSVN, name ="svn update", baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
44 dist_factory.addStep(ShellCommand,name ="clean oldies",description = "removing old archives", descriptionDone ="clean oldies",
45 flunkOnFailure=False,command=["bash","-c","rm -rfv simgrid-*-svn-r* *.tar.gz build/*tar.gz"])
46 dist_factory.addStep(ShellCommand,name = "svn revert",description = "reverting the SVN",descriptionDone = "svn revert",
47 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","."])
48 dist_factory.addStep(ShellCommand,name = "bootstrap",description = "bootstraping",descriptionDone = "bootstrap",
49 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./bootstrap"])
50 dist_factory.addStep(ShellCommand,name = "configure", description="configuring", descriptionDone="configure",
51 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--enable-maintainer-mode"])
52 dist_factory.addStep(ShellCommand,name = "make -C src", description = "building src", descriptionDone = "make -C src",
53 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4","-C","src"])
54 dist_factory.addStep(ShellCommand,name = "make -C tools", description = "building tools", descriptionDone = "make -C tools",
55 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4","-C","tools"])
56 dist_factory.addStep(ShellCommand,name = "make dist", description = "building archive", descriptionDone = "make dist",
57 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","dist"])
58 dist_factory.addStep(FileUpload(name="Upload archive",haltOnFailure = True,
59 slavesrc= WithProperties("simgrid-3.3-svn-r%sM.tar.gz", "got_revision"),
60 masterdest=WithProperties("simgrid-3.3-svn-r%sM.tar.gz", "got_revision")))
62 archive = "simgrid-3.3-svn-r%(revision:-)sM.tar.gz"
63 # Test tarball factories
64 pthreads_factory_O3= factory.BuildFactory()
65 pthreads_factory_O3.addStep(ShellCommand,name="cleanup",descriptionDone="cleanup",command=["bash","-c","rm -rf * .svn"])
66 pthreads_factory_O3.addStep(FileDownload(name="get archive",haltOnFailure=True,slavedest=WithProperties(archive),mastersrc=WithProperties(archive)))
67 pthreads_factory_O3.addStep(ShellCommand, name ="open archive",descriptionDone="open archive", command=["tar","xvfz",WithProperties(archive),"--strip","1"])
68 pthreads_factory_O3.addStep(ShellCommand,name = "configure", description="running configure", descriptionDone="configure",
69 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-pthread","--enable-compile-warnings","--enable-compile-optimizations"])
70 pthreads_factory_O3.addStep(ShellCommand,name = "make", description = "running make", descriptionDone = "make",
71 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","10"])
72 pthreads_factory_O3.addStep(CustomCheck,name ="check all", description = "running check all", descriptionDone ="check all",
73 haltOnFailure = True,command=["./checkall"])
75 ucontext_factory_O3= factory.BuildFactory()
76 ucontext_factory_O3.addStep(CustomSVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
77 ucontext_factory_O3.addStep(ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert",
78 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","."])
79 ucontext_factory_O3.addStep(CustomConfigure,name ="{configure}",description="running configure",descriptionDone="configure",
80 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-context=ucontext","--enable-compile-warnings","--enable-compile-optimizations","--enable-botbuild"]) # Main difference with pthread_factory
81 ucontext_factory_O3.addStep(ShellCommand,name = "{make}",description = "running make",descriptionDone = "make",
82 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make"])
83 ucontext_factory_O3.addStep(CustomCheck,name = "{check all}",description = "running check all",descriptionDone ="check all",
84 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./checkall"])
87 windows_factory= factory.BuildFactory()
88 windows_factory.addStep(SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
89 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"])
90 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"])
93 # One lock per machine since some tests open sockets on fixed ports
94 from buildbot import locks
95 bob_lock = locks.MasterLock("bob_lock")
96 artimon_lock = locks.MasterLock("artimon_lock")
97 fastnet_lock = locks.MasterLock("fastnet_lock")
101 {'name':'distBuilder',
102 'slavename':'bob_dist_worker',
103 'builddir':'/var/lib/buildbot/simgrid/dist-worker',
104 'factory':dist_factory},
106 {'name':'linux_amd64_pthreads_O3',
107 'slavename':'bob_pthreads',
108 'builddir':'/var/lib/buildbot/simgrid/linux_amd64_pthreads/builddir_O3',
109 'factory':pthreads_factory_O3,
110 'locks': [bob_lock]},
112 {'name':'linux_amd64_ucontext_O3',
113 'slavename':'bob_ucontext',
114 'builddir':'/var/lib/buildbot/simgrid/linux_amd64_ucontext/builddir_O3',
115 'factory':ucontext_factory_O3,
116 'locks': [bob_lock]},
118 {'name':'linux_i386_pthreads_O3',
119 'slavename':'artimon_pthreads',
120 'builddir':'/var/lib/buildbot/simgrid/linux_i386_pthreads/builddir_O3',
121 'factory':pthreads_factory_O3,
122 'locks': [artimon_lock]},
124 {'name':'linux_i386_ucontext_O3',
125 'slavename':'artimon_ucontext',
126 'builddir':'/var/lib/buildbot/simgrid/linux_i386_ucontext/builddir_O3',
127 'factory':ucontext_factory_O3,
128 'locks': [artimon_lock]},
132 {'name':'mac_os_x_pthreads',
133 'slavename':'fastnet_pthreads',
134 'builddir':'/var/buildbot/simgrid/mac_os_x_pthreads/builddir',
135 'factory':pthreads_factory_O3,
136 'locks': [fastnet_lock]},
138 {'name':'mac_os_x_ucontext',
139 'slavename':'fastnet_ucontext',
140 'factory':ucontext_factory_O3,
141 'builddir':'/var/buildbot/simgrid/mac_os_x_ucontext/builddir',
142 'locks': [fastnet_lock]},
146 {'name':'windows_builder',
147 'slavename':'windows_slave',
148 'builddir':"C:\\buildslave\\projects\\simgrid\\builddir",
149 'factory':windows_factory}
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
161 from buildbot import scheduler
162 maketarball = scheduler.Scheduler(name="maketarball", branch=None, treeStableTimer=60, builderNames=['distBuilder'])
164 c['schedulers'] = [maketarball]
171 # TODO: move to modernity here (but write an index.html for that)
172 #from buildbot.status.html import WebStatus
173 #c['status'].append(WebStatus(8010))
174 from buildbot.status import html
175 c['status'].append( html.Waterfall(http_port=8010) )
177 from buildbot.status import words
178 c['status'].append(words.IRC(host="irc.oftc.net", nick="simgrid_buildbot", channels=["#simgrid"]))
180 from buildbot.status.mail import MailNotifier
181 mn = MailNotifier(fromaddr="sg-dev@lists.gforge.inria.fr",
182 sendToInterestedUsers=False, addLogs=True, extraRecipients=['martin.quinson@loria.fr'])
183 c['status'].append(mn)
185 ####################################################################################
186 ## Scheduler configuration
188 # We use only one scheduling right now, a nightly one, which reruns everything
190 # TODO: Define a list of all slaves and use it here and in the definition of c['builders']
192 from buildbot.scheduler import Scheduler, Nightly, Periodic
194 #nightly_scheduler = Nightly(
196 # all_slaves, # defined in account.py
197 # hour=[12,24], # schedule time
200 #hourly = Periodic("hourly_scheduler", all_slaves, 60*60*2) # delay in seconds
202 #c['schedulers'] = [nightly_scheduler,hourly]
203 #c['schedulers'] = []