New buildbot master notes
[openafs-wiki.git] / devel / buildbotmasternotes.mdwn
1 OpenAFS Buildbot Master Configuration
2 =====================================
3
4 Buildbot master installation
5 ----------------------------
6
7 The following instructions describe how to use `pip` to install the buildbot
8 master in a Python virtual environment.  With sudo/root access, install Python3
9 and the development packages for it.
10
11 Ensure TCP ports 9989 and 8010 are open. Create a `buildbot` user on the
12 system.  The remaining steps to not require sudo access and should be run as
13 the `buildbot` user.
14
15 Optionally create a project level directory, for example:
16
17     $ mkdir openafs-buildbot
18     $ cd openafs-buildbot
19
20 Create a Python virtual environment:
21
22     $ python3 -m venv venv
23
24 Activate the virtual environment for the installation:
25
26     $ source venv/bin/activate
27
28 Install buildbot and it's dependencies:
29
30     $ pip install --upgrade pip
31     $ pip install 'buildbot[bundle]'
32
33 Create the buildbot master instance:
34
35     $ buildbot create-master master
36
37 The virtual environment can now be deactivated:
38
39     $ deactivate
40
41 Master configuration
42 --------------------
43
44 Download the buildbot master configuration:
45
46     $ git clone https://github.com/openafs-contrib/afsbotcfg.git
47     $ cd afsbotcfg
48
49 Create the `Makefile` and deploy the buildbot `master.cfg` and
50 sample `settings.ini` file:
51
52     $ python configure.py
53     $ make install
54
55 Make a link to the makefile in the top level directory:
56
57     $ cd ..
58     $ ln -s afsbotcfg/Makefile
59
60 Master settings
61 ---------------
62
63 Edit the `settings.ini` file in the `master` directory. This file stores
64 information we do not track with git, such as the buildbot worker passwords.
65 The `settings.ini` file is an INI-style file with the following sections:
66
67 * local - settings specific to the local environment
68 * admins - the list of user emails and passwords for authenticated access
69 * email - emails for notifications
70 * workers - the list of worker names and passwords
71
72 Example:
73
74     $ cat master/settings.ini
75     [local]
76     buildbotURL = http://buildbot.openafs.org:8010/
77     
78     [admins]
79     tycobb@yoyodyne.com = password
80     
81     [workers]
82     example-worker-1 = secret1
83     example-worker-2 = secret2
84
85 Gerrit account
86 --------------
87
88 The buildbot master needs an account on the [OpenAFS Gerrit][3] to listen for
89 Gerrit events and to report verified changes on successful builds.  The name of
90 the account is `buildbot`. Place the ssh keys for the buildbot's Gerrit account
91 in the `.ssh` directory under the home directory of the local account running
92 the buildbot master. The key file name should match the ones defined in the
93 `master.cfg` file.
94
95 Starting the master
96 -------------------
97
98 Check the buildbot master configuration with the command:
99
100     $ make check
101
102 Start the buildbot master with the command:
103
104     $ make start
105
106 Stop the buildbot master with the command:
107
108     $ make stop
109
110 [1]: https://buildbot.openafs.org/
111 [2]: https://openafs.org
112 [3]: https://gerrit.openafs.org/