ReleaseEngineering/Buildslave Startup Process: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Note that the version of Buildbot installed on the slaves is not the same as that on the master.  See the 'slave' branch of http://hg.mozilla.org/build/buildbot for the version currently deployed (more or less).
= Buildslave Source =
Note that the version of Buildbot installed on the slaves is not the same as that on the master.  See the [[ReleaseEngineering/Buildslave Versions]] for details. The remainder of this page describes how that version is started.


The remainder of this page describes how that version is started.
= General (runslave) =
In general, the idea is to get around to running ''[http://hg.mozilla.org/build/puppet-manifests/file/tip/modules/buildslave/files/runslave.py runslave.py]]'', which takes care of contacting the slave allocator, setting up buidlbot.tac, and starting the buildslave process.


= Linux =
= Linux =
== Build (CentOS 5) ==
== Build (CentOS 5) ==
/etc/init.d/buildbot depends on /etc/init.d/puppet, which blocks until puppet
/etc/init.d/buildbot depends on /etc/init.d/puppet, which blocks until puppet
runs.  /etc/init.d/buildbot-tac will run right away.  buildbot-tac is installed
run to completion.  /etc/init.d/buildbot runs runslave.py as the cltbld user.
by puppet, so there are at least two race conditions here.
 
buildbot-tac runs buildbot-tac.py only on the first boot, creating the
buildbot.tac file for the slave.
 
buildbot-tac.py is installed as part of an RPM (build-tools - {{bug|615301}}).


Builds run in /builds/slave.
Builds run in /builds/slave.


== Test (Fedora 12) ==
== Test (Fedora 12) ==
On startup, test boxes automatically login, and run <tt>home/cltbld/.config/autostart/gnome-terminal.desktop</tt>.  This file runs <tt>/home/cltbld/run-puppet-and-buildbot.sh</tt>, which runs puppet in a loop, and when that's complete, runs 'buildbot start /home/cltbld/talos-slave'.
On startup, test boxes automatically login, and run <tt>home/cltbld/.config/autostart/gnome-terminal.desktop</tt>.  This file runs <tt>/home/cltbld/run-puppet-and-buildbot.sh</tt>, which runs puppet in a loop, and when that's complete, runs runslave.py.


= Darwin =
= Darwin =
== Build ==
== Build ==
com.reductivelabs.puppet.plist runs /usr/local/bin/sleep-and-run-puppet.sh,
The /Library/LaunchDaemons/com.reductivelabs.puppet.plist runs /usr/local/bin/sleep-and-run-puppet.sh as root, which is presumably installed as part of the base image.  This script sleeps for 60 seconds, then runs puppet in the foreground every 60 seconds until it succeeds.
which is presumably installed as part of the base image.  This script sleeps
for 60 seconds, then runs puppet in the foreground every 60 seconds until it
succeeds.
 
There is a buildbot-tac launchd script which runs /usr/local/bin/buildbot-tac,
which is installed by puppet.  This launchd script does not wait for puppet, so
there is a race condition here, although the 60-second pause in the puppet
launch script probably eliminates any risk.


The buildbot launchd script waits until puppet has run, and then invokes
The buildbot launchd script, /Library/LaunchAgents/org.mozilla.build.buildslave.plist, waits until puppet has run, and then invokes 'buildbot start' directly.  It runs as whatever user logs in on the GUI console, which had best be cltbld.
'buildbot start' directly.


= Windows =
= Windows =

Revision as of 23:28, 17 February 2011

Buildslave Source

Note that the version of Buildbot installed on the slaves is not the same as that on the master. See the ReleaseEngineering/Buildslave Versions for details. The remainder of this page describes how that version is started.

General (runslave)

In general, the idea is to get around to running runslave.py], which takes care of contacting the slave allocator, setting up buidlbot.tac, and starting the buildslave process.

Linux

Build (CentOS 5)

/etc/init.d/buildbot depends on /etc/init.d/puppet, which blocks until puppet run to completion. /etc/init.d/buildbot runs runslave.py as the cltbld user.

Builds run in /builds/slave.

Test (Fedora 12)

On startup, test boxes automatically login, and run home/cltbld/.config/autostart/gnome-terminal.desktop. This file runs /home/cltbld/run-puppet-and-buildbot.sh, which runs puppet in a loop, and when that's complete, runs runslave.py.

Darwin

Build

The /Library/LaunchDaemons/com.reductivelabs.puppet.plist runs /usr/local/bin/sleep-and-run-puppet.sh as root, which is presumably installed as part of the base image. This script sleeps for 60 seconds, then runs puppet in the foreground every 60 seconds until it succeeds.

The buildbot launchd script, /Library/LaunchAgents/org.mozilla.build.buildslave.plist, waits until puppet has run, and then invokes 'buildbot start' directly. It runs as whatever user logs in on the GUI console, which had best be cltbld.

Windows

Build

buildbot.bat is in cltbld's "Startup Items". It is installed via OPSI, but it's not in the OPSI hg repo, because it contains passwords. buildbot.bat runs buidlbot-tac.py, via a checkout of http://hg.mozilla.org/build/tools at d:\tools. That checkout is only done once.

Once buildbot-tac.py has created the tac file, buildbot.bat runs start-buildbot.bat, which sets up some VC++ variables and runs start-buildbot.sh, which finally runs 'buildbot start' in the appropriate directory.

Test

Talos windows systems are not administered by OPSI, so the various scripts are installed by hand. I don't know how they work yet