ReleaseEngineering/Buildslave Startup Process: Difference between revisions

no edit summary
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 =
canmove, Confirmed users
1,394

edits