(no commit message)
[openafs-wiki.git] / AFSLore / BuildbotSlaveHowto.mdwn
1 *How to set up a BuildBot Slave for OpenAFS*
2
3 _Rationale_
4
5 Why would I want to?  OpenAFS supports multiple platforms, but the strength of support for
6 each of those individual platforms is directly proportional to the amount of testing done thereon.
7 Although there are many different types of testing that can be done, one of the most basic is
8 that of changes to the code base.  A BuildBot slave allows for automated testing of each gerrit
9 commit and is therefore a great resource to developers, most of whom do not have the time or
10 resources to test their code on every platform prior to submission.  Therefore, we encourage you
11 to contribute a system as a build slave for a platform not already covered!  You know you want to!
12
13 _Approach_
14
15 This is a consumer-oriented, high-level "how-to" to (hopefully) show how simple it is to set up
16 your own build slave (and thereby contribute to OpenAFS!).  This document is not intended to be
17 platform-specific -- there are just too many different ways of doing things across
18 Linux/Windows/SunOS/IRIX/AIX/BSD etc.  There are additional notes elsewhere on this Wiki 
19 (see: [[BuildbotMasterNotes]]) about setting up the BuildBot Master, and some of this material
20 is covered there as well -- however, this page is an attempt to make the process more understandable
21 (specifically the buildslave setup).
22
23 _Overview_
24
25 A quick overview of the process:
26
27 1. Acquire suitable system
28 1. Install required software
29 1. Create buildbot account and home directory
30 1. Contact OpenAFS BuildBot admin for configuration details
31 1. Edit configuration files
32 1. Start build slave
33 1. Set up startup scripts
34 1. Optional configuration
35
36 *Of note:* since BuildBot slaves pull all their information from the master (rather than having it pushed
37 to them by the master), there is no need to open an incoming port on your firewall, etc.  As long as the
38 slave can contact the master on the port you're given (which will be explained later), you're good to go!
39
40 _Hardware Requirements_
41
42 * Any system which OpenAFS currently supports (the greater diversity of build slaves, the better)
43 * Enough free disk space to build OpenAFS tree (a couple gigabytes should do)
44
45 The machine does not necessarily need to be dedicated entirely to being a buildslave; a build slave
46 could run on any lightly-loaded, non-critical system (subject to your security requirements, etc.,
47 of course).  Some of the OpenAFS buildslaves are run by volunteers at their own homes, for instance.
48
49 If you happen to have an older system with multiple processors, you can run more than one build slave
50 instance on the same machine.  The workload will be distributed across them by the master: successive
51 gerrit commit builds are started on the next free instance, thus reducing the overall time to
52 test multiple commits.
53
54 _Software Requirements_
55
56 BuildBot has the following software dependencies:
57
58 * Python: [[http://www.python.org/]]
59 * Twisted: [[http://twistedmatrix.com/]]
60 * ZopeInterface: [[http://www.zope.org/Products/ZopeInterface]]
61 * Git: [[http://git-scm.com/]]
62
63 Links to the above software websites are provided for reference only -- you may very well have a more
64 convenient method for installing software on your platform than downloading the source, building,
65 and installing by hand.  Check public software repositories for your platform first to save yourself some
66 effort.  BuildBot is not particularly sensitive to dependency versioning, so you may not need the
67 absolute latest version of everything installed.  (For instance, BuildBot 0.7.12 is known to work with Python 2.5.2,
68 Git 1.6.6, ZopeInterface 3.3.0, Twisted 9.0.0.)
69
70 And, of course, you'll need to install BuildBot itself: [[http://buildbot.net/trac]]
71
72
73 _Create buildbot account and home directory_
74
75 It is recommended that you use a special-purpose non-priviledged user account to run the build slave
76 (i.e., "buildbot").  The build master does not need to know the account's password -- in fact, the
77 account does not necessarily need remote login priviledges and may be locked or otherwise secured
78 as long as your platform still allows you to run commands as that user.
79
80 Test that you can run the buildbot command successfully (without error messages that might indicate
81 installation issues): /path/to/buildbot
82
83 _Contact OpenAFS BuildBot Master admin for configuration details_
84
85 Check the openafs-devel list archives (or join and ask) for who to contact regarding the settings you'll
86 need to add your machine as an OpenAFS build slave.  These settings will include:
87
88 * buildmaster_host: this is the OpenAFS build master
89 * port: this is the port on the build master which your slave will talk to
90 * slavename: a unique descriptive name for your new build slave, usually representing your operating system and architecture (and not necessarily anything to do with your systems' hostname)
91 * passwd: a password assigned to your slave for use in connecting with the master
92
93 _Create your build slave configuration_
94
95 As your buildbot user:
96
97 Inside the user's home directory (say, /home/buildbot), create a subdirectory which will contain all of the buildslave files (say, /home/buildbot/slave1).
98 Buildbot will not touch anything outside of this directory.
99
100 Substituting the appropriate values from above, the execute:
101
102 /path/to/buildbot create-slave /home/buildbot/slave1 buildmaster_host:port slavename passwd
103
104 Check the configuration file /home/buildbot/slave1/buildbot.tac to make sure the settings you entered are reflected in it.
105
106 *Optional, but recommended:* Edit the /home/buildbot/slave1/info/{admin,host} files to describe the system (in host) and send
107 yourself a shout-out (tell who you are in admin).  These show up on the web if you drill down to the build slave information
108 on the OpenAFS buildbot web portal, so you may want to obfuscate your contact information.
109
110 *Note:* if you are planning on running multiple OpenAFS buildslave instances, you simply repeat this and all later steps,
111 specifying a different base directory (i.e., /home/buildbot/slave2, /home/buildbot/slave3, etc.)
112
113 _Start build slave_
114
115 /path/to/buildbot start
116
117 Check the logs to make sure it started properly.  Check the OpenAFS BuildBot web portal to see the build progress presented
118 graphically.
119
120 There may be some kinks to work out of the system with the first few builds, especially if you are contributing a slave system
121 for a less-heavily-used platform whose support might suffer from bit rot between releases (hey, it happens!).
122
123 _Set up startup scripts_
124
125 Self-explanatory.  Make sure they run /path/to/buildbot start as your buildbot user.
126
127 _Set up log rotation and various other useful settings_
128
129 The buildbot.tac configuration file can be used to optimize your build slave.  For instance, you may want to change maxRotatedFiles
130 so you don't end up with a bunch of logs littered about /home/buildbot/slave1/.  Have a look at the BuildBot documentation if
131 you wish, though you can expect to be able to take a fairly hands-off approach to administering your new OpenAFS build slave.
132
133 Link to current BuildBot documentation: [[http://buildbot.net/buildbot/docs/current/]]
134
135 Thanks for your help!
136