gentoo docs have been updated
[openafs-wiki.git] / buildbotmasternotes.mdwn
1 There are Jason's notes for setting up the buildbot master
2
3 The buildbot master was installed in a VM on debian lenny. The VM has the following configuration:
4
5 * 10GB disk (partitions: 3GB root, 500MB swap, the rest for /home
6 * RAM 384MB
7
8 When installing lenny, uncheck desktop system and check web server
9
10 edit sources.list and comment out the cdrom source
11
12     root# apt-get build-dep buildbot
13     root# apt-get install git-core
14     root# apt-get install openssh-server
15
16     login as buildmaster user
17     % git clone git://github.com/jaysoffian/buildbot.git  buildbot-src
18     % cd buildbot-src/
19     % git checkout -b gerrit e4c0d458374b9a0ce34c
20
21     // fix a debugclient bug
22     % git cherry-pick 9ab140a03378baa5ec98
23
24     // allow for not clobbering the git tree each build
25     % git cherry-pick 7fa5137bbc449144d76334bd366920d8b6a7c2c0
26
27     // following
28     http://buildbot.net/buildbot/docs/0.8.1/Installing-the-code.html#Installing-the-code
29     // follow 8.1 docs
30     % python setup.py build
31     root# python setup.py install
32     root# apt-get install python-json
33     root# apt-get install python-jinja
34
35     // cvs is required to make the buildbot test suite go all clear
36     root# apt-get install cvs
37
38     // run the unit tests
39     % PYTHONPATH=. trial buildbot.test
40
41     % mkdir $HOME/buildbot/master/openafs
42     // create the buildbot master
43     % buildbot create-master $HOME/buildbot/master/openafs
44
45 edit config
46
47     ...
48     repourl="git://git.openafs.org/openafs.git"
49
50     from buildbot.process import factory
51     from buildbot.steps.source import Git
52     from buildbot.steps.shell import Compile
53     from buildbot.steps.shell import Configure
54
55     f1 = factory.BuildFactory()
56     f1.addStep(Git(repourl=repourl, mode="clobber"))
57     f1.addStep(Configure(command=["sh","regen.sh"]))
58     f1.addStep(Configure(command=["./configure","--enable-checking"]))
59     f1.addStep(Compile(command=["make"]))
60     f1.addStep(Compile(command=["make","dest"]))
61
62     b1 = {'name': "buildbot-full",
63           'slavename': "debian-i386",
64           'builddir': "full",
65           'factory': f1,
66           }
67     c['builders'] = [b1]
68     ...
69     =================================================
70
71     // test config
72     % buildbot checkconfig master.cfg
73     // start the buildmaster
74     % /usr/bin/buildbot start $HOME/buildbot/master/openafs
75
76 check http://localhost:8010 for web output
77
78     //install openafs builddeps
79     root# apt-get build-dep openafs
80     root# apt-get install automake1.9 linux-headers-2.6-686 flex bison dblatex docbook-xsl
81
82     root# useradd  -d /home/buildslave -m buildslave
83
84     buildslave% mkdir -p $HOME/buildbot/slave/openafs
85     buildslave% buildbot create-slave $HOME/buildbot/slave/openafs localhost:9989 debian-i386 PASSWORD
86
87 edit files in /home/buildslave/buildbot/slave/openafs/info
88
89     // start the buildslave
90     buildslave% buildbot start $HOME/buildbot/slave/openafs
91
92
93
94     /// begin setting up gerrit stuff
95     // create ssh key for buildbot
96     // sign in to gerrit and add buildbot ssh key
97     buildmaster% touch ~buildmaster/buildbot-src/contrib/__init__.py
98
99 Here is a working config snippet (minus the slave passwords) for gerrit+buildbot:
100
101     import sys
102     sys.path.append('/home/buildmaster/buildbot-src/contrib')
103
104     from gerrit import GerritChangeSource
105     #c['change_source'] = GerritChangeSource()
106
107     ## configure the Schedulers
108
109     from buildbot.scheduler import Scheduler, Periodic
110
111     mybuilders = []
112     mybuilders.append("debian-linux-i386-builder")
113     mybuilders.append("win2008-builder")
114
115     stable14_builders = []
116     stable14_builders.append("debian-linux-i386-builder")
117
118
119
120     c['schedulers'] = []
121     c['schedulers'].append(Scheduler(name="all", branch=None,
122                                      treeStableTimer=30,
123                                      builderNames=mybuilders))
124
125
126     c['schedulers'].append(Periodic("every_4_hours", ["irix-builder"], 4*60*60))
127
128     from gerrit import GerritScheduler
129     c['schedulers'].append(GerritScheduler("gerrit_scheduler", mybuilders, branches=["master","openafs-devel-1_5_x"]))
130
131     c['schedulers'].append(GerritScheduler("gerrit_stable_scheduler", stable14_builders, branches=["openafs-stable-1_4_x"]))
132
133     ####### BUILDERS
134
135     repourl="git://git.openafs.org/openafs.git"
136
137     from buildbot.process import factory
138     from buildbot.steps.source import Git
139     from buildbot.steps.shell import Compile
140     from buildbot.steps.shell import Configure
141     from buildbot.steps.shell import ShellCommand
142
143     f1 = factory.BuildFactory()
144     #f1.addStep(ShellCommand(command=["git","clean","-xdf"]))
145     #f1.addStep(Git(repourl=repourl, mode="clobber"))
146     f1.addStep(ShellCommand(command=["sleep","120"]))
147     f1.addStep(Git(repourl=repourl, mode="update", ignore_ignores=True, retry=[120,60]))
148     f1.addStep(ShellCommand(command=["sh","regen.sh"]))
149     f1.addStep(Configure(command=["./configure","--enable-checking","--enable-supergroups","--enable-namei-fileserver"]))
150     f1.addStep(Compile(command=["make"]))
151     f1.addStep(ShellCommand(command=["make","dest"]))
152
153     b1 = {'name': "debian-linux-i386-builder",
154           'slavename': "debian-i386",
155           'builddir': "full",
156           'factory': f1,
157           }
158
159     c['builders'] = [b1]
160
161     irix_configure_env={'CC':"cc"}
162
163     irixfactory = factory.BuildFactory()
164     irixfactory.addStep(ShellCommand(command=["sleep","120"]))
165     irixfactory.addStep(Git(repourl=repourl, mode="update", ignore_ignores=True, retry=[120,60]))
166     irixfactory.addStep(ShellCommand(command=["sh","regen.sh"]))
167     irixfactory.addStep(Configure(command=["./configure","--enable-checking","--enable-supergroups","--enable-namei-fileserver","--with-krb5=/usr/nekoware"],env=irix_configure_env))
168     irixfactory.addStep(Compile(command=["gmake"]))
169     irixfactory.addStep(ShellCommand(command=["make","dest"]))
170
171
172     irixbuilder = {'name': "irix-builder",
173           'slavename': "sgi_irix_65-64bit",
174           'builddir': "irix-65-64bit",
175           'factory': irixfactory,
176           }
177
178     c['builders'].append(irixbuilder)
179
180
181     ###### win_amd64 free builder
182
183     win_amd64_free_factory = factory.BuildFactory()
184
185     # wait for 2 minutes
186     win_amd64_free_factory.addStep(ShellCommand(command=["ping","-n","120","localhost"]))
187     win_amd64_free_factory.addStep(Git(repourl=repourl, mode="update", ignore_ignores=True, retry=[120,60]))
188     win_amd64_free_factory.addStep(Compile(command=["build-openafs.cmd", "amd64", "free"]))
189
190     win_amd64_free_builder = {'name': "win2008-builder",
191           'slavename': "win2008-amd64",
192           'builddir': "win-amd64-free",
193           'factory': win_amd64_free_factory,
194           }
195     c['builders'].append(win_amd64_free_builder)
196
197     ####### STATUS TARGETS
198
199     # 'status' is a list of Status Targets. The results of each build will be
200     # pushed to these targets. buildbot/status/*.py has a variety to choose from,
201     # including web pages, email senders, and IRC bots.
202
203     c['status'] = []
204
205     # Use allowForce=True (boolean, not a string. ie: not 'True') to allow
206     # Forcing Builds in the Web User Interface. The default is False.
207     from buildbot.status import html
208     c['status'].append(html.WebStatus(http_port=8010,allowForce=True))
209
210     from gerrit import GerritStatusPush
211     c['status'].append(GerritStatusPush('gerrit-prod'))
212
213
214     from buildbot.status import client
215     c['status'].append(client.PBListener(9988))
216
217
218     ####### PROJECT IDENTITY
219     c['projectName'] = "OpenAFS"
220     c['projectURL'] = "http://www.openafs.org/"
221     c['buildbotURL'] = "http://buildbot.openafs.org:8010/"