148
edits
(Added instructions for testing bb patches) |
(Updated instructions on how to setup a personal dev master) |
||
| Line 9: | Line 9: | ||
'''NOTE''': You will need root access to create a user account for yourself on dev- | '''NOTE''': You will need root access to create a user account for yourself on dev-master2 and a buildbot area under /builds/buildbot/your_name - if not using root, you might get this error (I think it has to do with which group your account belongs to): | ||
<pre> | |||
from twisted.python.zippath import ZipArchive | |||
ImportError: No module named zippath | |||
</pre> | |||
== General == | == General == | ||
* Instructions specific to dev- | * Instructions specific to dev-master2 (dev-master2.bb.releng.use1.mozilla.com) | ||
<pre> | <pre> | ||
# as root | # as root | ||
WHO= | WHO=$whoami | ||
mkdir /builds/buildbot/${WHO} | mkdir /builds/buildbot/${WHO} | ||
chown ${WHO} /builds/buildbot/${WHO} | chown ${WHO} /builds/buildbot/${WHO} | ||
| Line 27: | Line 26: | ||
** BASEDIR refers to where you want the new master to be created | ** BASEDIR refers to where you want the new master to be created | ||
** MASTER_NAME is the name of one of the predefined masters. Search for a name prefixed by "staging". | ** MASTER_NAME is the name of one of the predefined masters. Search for a name prefixed by "staging". | ||
*** /usr/bin/python2.6 setup-master.py -l | *** display a list of enabled masters: /usr/bin/python2.6 setup-master.py -l | ||
*** display a hardcoded list of 0.8.0 masters: /usr/bin/python2.6 setup-master.py -l -8 | |||
** PYTHON, HG, VIRTUALENV should be adjusted to your local environment | ** PYTHON, HG, VIRTUALENV should be adjusted to your local environment | ||
== Create a build master == | == Create a build master == | ||
There are two ways to do it: | |||
* using an automation [https://hg.mozilla.org/build/braindump/file/tip/buildbot-related/create-staging-master.pl script]: | |||
<pre> | |||
perl create-staging-master.pl -u aselagea --master-kind=build --master-dir=build1 --http-port=8021 | |||
</pre> | |||
* following several manual steps: | |||
:* clone the <code>buildbot-configs</code> repository. | |||
<pre> | <pre> | ||
$ hg clone https://hg.mozilla.org/build/buildbot-configs | $ hg clone https://hg.mozilla.org/build/buildbot-configs | ||
</pre> | </pre> | ||
:* add <code>'try'</code> to the list of <code>ACTIVE_BRANCHES</code> in <code>master/master_localconfig.py</code>. | |||
:* run <code>create_master.sh</code> below | |||
<code>create_master.sh</code> | |||
<pre> | <pre> | ||
USERNAME=`whoami` | USERNAME=`whoami` | ||
| Line 69: | Line 68: | ||
=== build-master path values === | === build-master path values === | ||
* Configs: buildbot-configs/mozilla/ | * Configs: buildbot-configs/mozilla/ | ||
* master_localconfig: | * master_localconfig: build_localconfig.py ? | ||
* host: preprod-builder | * host: preprod-builder | ||
=== Signing server setup === | === Signing server setup === | ||
Ever since we started signing all builds, a proper signing server setup in your dev master is necessary to do proper tests. The signing servers are configured in passwords.py and require real secrets (meaning, do not distribute them publicly). The [https://github.com/mozilla/build-buildbot-configs/blob/master/mozilla/passwords.py.template templatized version of passwords.py] will show you the format of the file, but you'll need to get the real values elsewhere. bhearsum's version is generally up-to-date and available at /builds/buildbot/bhearsum/build1/master/passwords.py on dev- | Ever since we started signing all builds, a proper signing server setup in your dev master is necessary to do proper tests. The signing servers are configured in passwords.py and require real secrets (meaning, do not distribute them publicly). The [https://github.com/mozilla/build-buildbot-configs/blob/master/mozilla/passwords.py.template templatized version of passwords.py] will show you the format of the file, but you'll need to get the real values elsewhere. bhearsum's version is generally up-to-date and available at /builds/buildbot/bhearsum/build1/master/passwords.py on dev-master2. Note that in staging you must be careful not to use the Release or Nightly signing server instances, which will sign builds with real certificates (instead of self signed ones) -- so do NOT copy a passwords.py file from a production build master. If you have trouble with this, ask for help. | ||
=== Disable periodic builds === | === Disable periodic builds === | ||
| Line 81: | Line 80: | ||
== Create a tests master == | == Create a tests master == | ||
We can create a test master using the same automation [https://hg.mozilla.org/build/braindump/file/tip/buildbot-related/create-staging-master.pl script] as for a build master: | |||
<pre> | |||
perl create-staging-master.pl -u aselagea --master-kind=test --master-dir=test1 --http-port=8049 | |||
</pre> | |||
= Customize your configs = | = Customize your configs = | ||
| Line 97: | Line 97: | ||
Do this: | Do this: | ||
<pre> | <pre> | ||
WHO= | WHO=$whoami | ||
mkdir -p /dev/shm/${WHO}/queue | mkdir -p /dev/shm/${WHO}/queue | ||
chown ${WHO} /dev/shm/${WHO} | chown ${WHO} /dev/shm/${WHO} | ||
</pre> | </pre> | ||
* modify your master/master_localconfig.py so that QUEUEDIR points to your new dir: | * modify your master/master_localconfig.py so that QUEUEDIR points to your new dir: | ||
QUEUEDIR = "/dev/shm/${WHO}/queue" | |||
* or (newer) <tt>master/master_config.json</tt> to add the line: | * or (newer) <tt>master/master_config.json</tt> to add the line: | ||
"queuedir": "/dev/shm/${WHO}/queue" | |||
= Test your buildbot patches = | = Test your buildbot patches = | ||
Once you have created a build/test master, you can test various buildbot changes quite easily. Basic steps: | Once you have created a build/test master, you can test various buildbot changes quite easily. Basic steps: | ||
* clone | :* clone [https://hg.mozilla.org/build/braindump/ braindump] repo | ||
* cd to master's home folder && activate virtual | :* cd to master's home folder && activate the virtual environment | ||
* make sure 'bb-configs' repo is up-to-date | :* make sure 'bb-configs' repo is up-to-date | ||
<pre> | |||
* compute the initial list of builds/tests | hg pull; hg update -C | ||
</pre> | |||
* apply your patch | :* compute the initial list of builds/tests | ||
* compute the list of builds/tests following your changes | <pre> | ||
python ../braindump/buildbot-related/builder_list.py master/master.cfg > old | |||
* compute the diff between them | </pre> | ||
:* apply your patch | |||
<pre> | |||
patch -p1 < <patch_name>.patch | |||
</pre> | |||
:* compute the list of builds/tests following your changes | |||
<pre> | |||
python ../braindump/buildbot-related/builder_list.py master/master.cfg > new | |||
:* compute the diff between them | |||
<pre> | |||
diff -U 0 -p old new | |||
</pre> | |||
:*make sure your changes are not causing issues on the other masters | |||
<pre> | |||
bash buildbot-configs/test-masters.sh | |||
</pre> | |||
= Does it work? = | = Does it work? = | ||
If you want production schedulers to run, then run the following: | |||
:* build master: | |||
<pre> | |||
cd $BASEDIR/master; ln -sf ../buildbot-configs/mozilla/universal_master_sqlite.cfg master.cfg; cd - | |||
</pre> | |||
:* test master: | |||
* | |||
<pre> | <pre> | ||
cd $BASEDIR/master; ln -sf ../buildbot-configs/mozilla-tests/universal_master_sqlite.cfg master.cfg; cd - | |||
</pre> | </pre> | ||
<small>Note: the default scheduler <code>builder_master.cfg</code> is usually fine.</small> | |||
:* Read the above as "you '''always''' want <tt>universal_master_sqlite.cfg</tt> unless you have a good and solid reason for not wanting it <small>(or want to test your antacid options)</small>. | |||
:* Run "make checkconfig" to make sure the default configs are in place and good. | |||
:* Run "make start" to make sure you master starts. | |||
:** You should have a Makefile at $BASEDIR/Makefile to start/stop your master | |||
:** Visit http://dev-master2.bb.releng.use1.mozilla.com:${YOUR_WEBSTATUS_PORT}/waterfall | |||
:* If it works, congrats! Now run "make stop" to shut it down until you're ready to actually start testing. | |||
= Adding your master to slavealloc = | = Adding your master to slavealloc = | ||
| Line 154: | Line 158: | ||
If you have an old master you can modify it: | If you have an old master you can modify it: | ||
* Visit http://slavealloc.build.mozilla.org/ui/#masters | * Visit http://slavealloc.build.mozilla.org/ui/#masters | ||
* Modify the FQDN of the master and the port (e.g. dev- | * Modify the FQDN of the master and the port (e.g. dev-master2.bb.releng.use1.mozilla.com) | ||
= Setup/Running local master scheduler on laptop - not dev-master = | = Setup/Running local master scheduler on laptop - not dev-master = | ||
| Line 233: | Line 237: | ||
Using the slaves interface of slavealloc (http://slavealloc.build.mozilla.org/ui/#slaves), search for slaves that are currently in the preprod (or preprod-tests) pool that are not currently locked to someone else's dev master. Edit the slave and lock that slave to your master. | Using the slaves interface of slavealloc (http://slavealloc.build.mozilla.org/ui/#slaves), search for slaves that are currently in the preprod (or preprod-tests) pool that are not currently locked to someone else's dev master. Edit the slave and lock that slave to your master. | ||
'''NOTE''': the slave will need to be rebooted to pick up this change. | '''NOTE''': the slave will need to be rebooted to pick up this change. If no slaves are available for your required platform, find out who has them all and ask to borrow one. | ||
If no slaves are available for your required platform, find out who has them all and ask to borrow one. | |||
= Setup a user source repository = | = Setup a user source repository = | ||
| Line 275: | Line 277: | ||
== Resetting db state == | == Resetting db state == | ||
This is generally most useful when you want to get rid of all pending builds. First, add this to your master's Makefile: | This is generally most useful when you want to get rid of all pending builds. First, add this to your master's Makefile: | ||
<pre> | |||
reset-db: | |||
rm master/state.sqlite | rm master/state.sqlite | ||
cd master && $(BUILDBOT) upgrade-master $$PWD | cd master && $(BUILDBOT) upgrade-master $$PWD | ||
</pre> | |||
Then run: | Then run: | ||
<pre> | |||
make stop | |||
make reset-db | |||
make start | |||
</pre> | |||
== Getting build notifications == | == Getting build notifications == | ||
It might be useful to know when a build finishes or the status of certain builds. This way you don't have to keep an eye on your dev master and move on to other awesome things. There are a few ways to accomplish this: | It might be useful to know when a build finishes or the status of certain builds. This way you don't have to keep an eye on your dev master and move on to other awesome things. There are a few ways to accomplish this: | ||
* Using Buildbot's IRC bot | :* Using Buildbot's IRC bot | ||
** | :** add the following to your list of status obj in your master.cfg: | ||
<pre> | |||
from buildbot.status import words | from buildbot.status import words | ||
... | ... | ||
| Line 300: | Line 305: | ||
}) | }) | ||
c['status'].append(irc) | c['status'].append(irc) | ||
</pre> | |||
now reconfig and your should see your bot join <irc-channel>. From there you can do a number of things: http://docs.buildbot.net/0.8.0/IRC-Bot.html | ::* now reconfig and your should see your bot join <irc-channel>. From there you can do a number of things: http://docs.buildbot.net/0.8.0/IRC-Bot.html | ||
::* I like to start a private chat with my bot and request the build status when a job finishes. This gives me actual pings! You can do this like so from irc: | |||
I like to start a private chat with my bot and request the build status when a job finishes. This gives me actual pings! | <pre> | ||
> /query <your-bot-nick> | > /query <your-bot-nick> | ||
> notify on finished | > notify on finished | ||
</pre> | |||
* Using Check4Change Firefox extension: | :* Using Check4Change Firefox extension: | ||
** this extension will check if a page changes without having to actually refresh! You can hook this up to your dev master buildbot web UI | :** this extension will check if a page changes without having to actually refresh! You can hook this up to your dev master buildbot web UI | ||
** for more details: http://www.check4change.com/ | :** for more details: http://www.check4change.com/ | ||
= See Also = | = See Also = | ||
edits