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
32 # the 'sources' list tells the buildmaster how it should find out about
33 # source code changes. Any class which implements IChangeSource can be added
34 # to this list: there are several in buildbot/changes/*.py to choose from.
36 from buildbot.changes.svnpoller import SVNPoller
37 c['change_source'] = SVNPoller("svn://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk", pollinterval=60)
39 from buildbot import scheduler
40 maketarball = scheduler.Scheduler(name="maketarball", branch=None, treeStableTimer=60, builderNames=['dist builder'])
42 c['schedulers'] = [maketarball]
45 ####################################################################################
46 # builders declarations
48 from extensions import CustomSVN, CustomConfigure, CustomCheck
49 from buildbot.process import factory
50 from buildbot.steps.transfer import FileUpload
51 from buildbot.steps.shell import ShellCommand
52 from buildbot.steps.source import SVN
54 # build tarball factory
55 dist_factory = factory.BuildFactory()
56 dist_factory.addStep(CustomSVN, name ="svn update", baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
57 dist_factory.addStep(ShellCommand,name ="clean oldies",description = "removing old archives", descriptionDone ="clean oldies",
58 flunkOnFailure=False,command=["bash","-c","rm -rfv simgrid-*-svn-r* *.tar.gz build/*tar.gz"])
59 dist_factory.addStep(ShellCommand,name = "svn revert",description = "reverting the SVN",descriptionDone = "svn revert",
60 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","."])
61 dist_factory.addStep(ShellCommand,name = "bootstrap",description = "bootstraping",descriptionDone = "bootstrap",
62 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./bootstrap"])
63 dist_factory.addStep(ShellCommand,name = "configure", description="configuring", descriptionDone="configure",
64 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--enable-maintainer-mode"])
65 #dist_factory.addStep(ShellCommand,name = "make clean",description = "running make clean",descriptionDone = "make clean",
66 # environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make", "clean"])
67 dist_factory.addStep(ShellCommand,name = "make -C src", description = "building src", descriptionDone = "make -C src",
68 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4","-C","src"])
69 dist_factory.addStep(ShellCommand,name = "make -C tools", description = "building tools", descriptionDone = "make -C tools",
70 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4","-C","tools"])
71 dist_factory.addStep(ShellCommand,name = "make dist", description = "building archive", descriptionDone = "make dist",
72 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","dist"])
73 dist_factory.addStep(ShellCommand,name = "Prepare archive",descriptionDone="Prepare archive", haltOnFailure = True,command=["bash","-c","ln -s simgrid-*.tar.gz simgrid-svn-lastest.tar.gz"])
74 dist_factory.addStep(FileUpload(name="Upload archive",slavesrc="simgrid-svn-lastest.tar.gz",masterdest="simgrid-svn-lastest.tar.gz",haltOnFailure = True))
76 # Test tarball factories
77 pthreads_factory_O3= factory.BuildFactory()
78 pthreads_factory_O3.addStep(CustomSVN, name ="{svn update}", baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
79 pthreads_factory_O3.addStep(ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert",
80 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","."])
81 pthreads_factory_O3.addStep(ShellCommand,name = "{configure}", description="running configure", descriptionDone="configure",
82 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-pthread","--enable-compile-warnings","--enable-compile-optimizations","--enable-botbuild"])
83 pthreads_factory_O3.addStep(ShellCommand,name = "{make clean}",description = "running make clean",descriptionDone = "make clean",
84 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make", "clean"])
85 pthreads_factory_O3.addStep(ShellCommand,name = "{make}", description = "running make", descriptionDone = "make",
86 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make","-j","4"])
87 pthreads_factory_O3.addStep(CustomCheck,name ="{check all}", description = "running check all", descriptionDone ="check all",
88 haltOnFailure = True,command=["./checkall"])
90 ucontext_factory_O3= factory.BuildFactory()
91 ucontext_factory_O3.addStep(CustomSVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
92 ucontext_factory_O3.addStep(ShellCommand,name = "{svn revert}",description = "running svn revert",descriptionDone = "svn revert",
93 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["svn" ,"revert","-R","."])
94 ucontext_factory_O3.addStep(CustomConfigure,name ="{configure}",description="running configure",descriptionDone="configure",
95 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./configure", "--with-context=ucontext","--enable-compile-warnings","--enable-compile-optimizations","--enable-botbuild"]) # Main difference with pthread_factory
96 ucontext_factory_O3.addStep(ShellCommand,name = "{make}",description = "running make",descriptionDone = "make",
97 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["make"])
98 ucontext_factory_O3.addStep(CustomCheck,name = "{check all}",description = "running check all",descriptionDone ="check all",
99 environ={"LC_ALL":"C"}, haltOnFailure = True,command=["./checkall"])
102 windows_factory= factory.BuildFactory()
103 windows_factory.addStep(SVN, name ="{svn update}",baseURL='svn://scm.gforge.inria.fr/svn/simgrid/simgrid/', defaultBranch='trunk', mode="update")
104 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"])
105 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"])
108 # One lock per machine since some tests open sockets on fixed ports
109 from buildbot import locks
110 bob_lock = locks.MasterLock("bob_lock")
111 artimon_lock = locks.MasterLock("artimon_lock")
112 fastnet_lock = locks.MasterLock("fastnet_lock")
116 {'name':'dist builder',
117 'slavename':'bob_dist_worker',
118 'builddir':'/var/lib/buildbot/simgrid/dist-worker',
119 'factory':dist_factory},
121 {'name':'linux_amd64_pthreads_O3',
122 'slavename':'bob_pthreads',
123 'builddir':'/var/lib/buildbot/simgrid/linux_amd64_pthreads/builddir_O3',
124 'factory':pthreads_factory_O3,
125 'locks': [bob_lock]},
127 {'name':'linux_amd64_ucontext_O3',
128 'slavename':'bob_ucontext',
129 'builddir':'/var/lib/buildbot/simgrid/linux_amd64_ucontext/builddir_O3',
130 'factory':ucontext_factory_O3,
131 'locks': [bob_lock]},
135 {'name':'linux_i386_pthreads_O3',
136 'slavename':'artimon_pthreads',
137 'builddir':'/var/lib/buildbot/simgrid/linux_i386_pthreads/builddir_O3',
138 'factory':pthreads_factory_O3,
139 'locks': [artimon_lock]},
141 {'name':'linux_i386_ucontext_O3',
142 'slavename':'artimon_ucontext',
143 'builddir':'/var/lib/buildbot/simgrid/linux_i386_ucontext/builddir_O3',
144 'factory':ucontext_factory_O3,
145 'locks': [artimon_lock]},
149 {'name':'mac_os_x_pthreads',
150 'slavename':'fastnet_pthreads',
151 'builddir':'/var/buildbot/simgrid/mac_os_x_pthreads/builddir',
152 'factory':pthreads_factory_O3,
153 'locks': [fastnet_lock]},
155 {'name':'mac_os_x_ucontext',
156 'slavename':'fastnet_ucontext',
157 'factory':ucontext_factory_O3,
158 'builddir':'/var/buildbot/simgrid/mac_os_x_ucontext/builddir',
159 'locks': [fastnet_lock]},
163 {'name':'windows_builder',
164 'slavename':'windows_slave',
165 'builddir':"C:\\buildslave\\projects\\simgrid\\builddir",
166 'factory':windows_factory}
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="buildbot", channels=["#simgrid"]))
180 from buildbot.status.mail import MailNotifier
181 mn = MailNotifier(fromaddr="SimGrid buildbot <sg-dev@lists.gforge.inria.fr>",
182 sendToInterestedUsers=False, 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: setup a rebuilder in response to SVN commits
191 # TODO: Define a list of all slaves and use it here and in the definition of c['builders']
193 from buildbot.scheduler import Scheduler, Nightly, Periodic
196 #nightly_scheduler = Nightly(
198 # all_slaves, # defined in account.py
199 # hour=[12,24], # schedule time
202 #hourly = Periodic("hourly_scheduler", all_slaves, 60*60*2) # delay in seconds
204 #c['schedulers'] = [nightly_scheduler,hourly]