1
1
2
- .. _ buildslave :
2
+ .. _ buildworker :
3
3
4
- Running a buildslave
5
- ====================
4
+ Running a buildbot worker
5
+ =========================
6
6
7
7
.. highlight :: bash
8
8
9
9
Python's :ref: `buildbots ` system was discussed earlier. We sometimes refer to
10
- the collection of *build slaves * as our "buildbot fleet". The machines that
10
+ the collection of *build workers * as our "buildbot fleet". The machines that
11
11
comprise the fleet are voluntarily contributed resources. Many are run by
12
12
individual volunteers out of their own pockets and time, while others are
13
13
supported by corporations. Even the corporate sponsored buildbots, however,
14
14
tend to exist because some individual championed them, made them a reality, and
15
15
is committed to maintaining them.
16
16
17
17
Anyone can contribute a buildbot to the fleet. This chapter describes how
18
- to go about setting up a buildslave , getting it added, and some hints about
18
+ to go about setting up a buildbot worker , getting it added, and some hints about
19
19
buildbot maintenance.
20
20
21
21
Anyone running a buildbot that is part of the fleet should subscribe to the
@@ -24,18 +24,18 @@ mailing list. This mailing list is also the place to contact if you want to
24
24
contribute a buildbot but have questions.
25
25
26
26
As for what kind of buildbot to run...take a look at our `current fleet
27
- <http://buildbot.python.org/all/buildslaves > `_. Pretty much anything that isn't
27
+ <http://buildbot.python.org/all/#/workers > `_. Pretty much anything that isn't
28
28
on that list would be interesting: different Linux/UNIX distributions,
29
29
different versions of the various OSes, other OSes if you or someone are
30
30
prepared to make the test suite actually pass on that new OS. Even if you only
31
31
want to run an OS that's already on our list there may be utility in setting it
32
- up: we also need to build and test python under various alternate build
32
+ up; we also need to build and test python under various alternate build
33
33
configurations. Post to the mailing list and talk about what you'd like to
34
34
contribute.
35
35
36
36
37
- Preparing for buildslave setup
38
- ------------------------------
37
+ Preparing for buildbot worker setup
38
+ -----------------------------------
39
39
40
40
Since the goal is to build Python from source, the system will need to have
41
41
everything required to do normal python development: a compiler, a linker, and
@@ -45,33 +45,33 @@ everything required to do normal python development: a compiler, a linker, and
45
45
compiled python.
46
46
47
47
In order to set up the buildbot software, you will need to obtain an identifier
48
- and password for your buildslave so it can join the fleet. Email
49
- [email protected] to discuss adding your
buildslave and to obtain the
50
- needed slavename and password. You can do some of the steps that follow
48
+ and password for your worker so it can join the fleet. Email
49
+ [email protected] to discuss adding your
worker and to obtain the
50
+ needed workername and password. You can do some of the steps that follow
51
51
before having the credentials, but it is easiest to have them before
52
- the "buildslave " step below.
52
+ the "buildbot worker " step below.
53
53
54
54
55
- Setting up the buildslave
56
- -------------------------
55
+ Setting up the buildbot worker
56
+ ------------------------------
57
57
58
58
Conventional always-on machines
59
59
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60
60
61
61
You need a recent version of the `buildbot <http://buildbot.net/ >`_ software,
62
62
and you will probably want a separate 'buildbot' user to run the buildbot
63
63
software. You may also want to set the buildbot up using a virtual
64
- environment, depending on you manage your system. We won't cover how to that
64
+ environment, depending on how you manage your system. We won't cover how to that
65
65
here; it doesn't differ from setting up a virtual environment for any other
66
66
software, but you'll need to modify the sequence of steps below as appropriate
67
67
if you choose that path.
68
68
69
69
For Linux:
70
70
71
- * If your package manager provides the buildbot slave software, that is
71
+ * If your package manager provides the buildbot worker software, that is
72
72
probably the best way to install it; it may create the buildbot user for
73
73
you, in which case you can skip that step. Otherwise, do ``pip install
74
- buildbot-slave ``.
74
+ buildbot-worker ``.
75
75
* Create a ``buildbot `` user (using, eg: ``useradd ``) if necessary.
76
76
* Log in as the buildbot user.
77
77
@@ -80,42 +80,40 @@ For Mac:
80
80
* Create a buildbot user using the OS/X control panel user admin. It
81
81
should be a "standard" user.
82
82
* Log in as the buildbot user.
83
- * Install either the Python 2.7 bundle from python.org [# ]_, or pip.
84
- * Open a terminal window.
85
- * Execute ``pip install buildbot-slave ``.
83
+ * Install the buildbot worker [# ]_ by running ``pip install buildbot-worker ``.
86
84
87
85
For Windows:
88
86
89
87
* Create a buildbot user as a "standard" user.
90
88
* Install the latest version of Python 2.7 from python.org.
91
89
* Open a Command Prompt.
92
- * Execute ``python -m pip install pypiwin32 buildbot-slave `` (note that
90
+ * Execute ``python -m pip install pypiwin32 buildbot-worker `` (note that
93
91
``python.exe `` is not added to ``PATH `` by default, making the
94
92
``python `` command accessible is left as an exercise for the user).
95
93
96
94
In a terminal window for the buildbot user, issue the following commands (you
97
95
can put the ``buildarea `` wherever you want to)::
98
96
99
97
mkdir buildarea
100
- buildslave create-slave buildarea buildbot.python.org:9020 slavename slavepasswd
98
+ buildbot-worker create-worker buildarea buildbot.python.org:9020 workername workerpasswd
101
99
102
- (Note that on Windows, the ``buildslave `` command will be in the
100
+ (Note that on Windows, the ``buildbot-worker `` command will be in the
103
101
:file: `Scripts ` directory of your Python installation.)
104
102
105
- Once this initial slave setup completes, you should edit the files
103
+ Once this initial worker setup completes, you should edit the files
106
104
``buildarea/info/admin `` and ``buildarea/info/host `` to provide your contact
107
105
info and information on the host configuration, respectively. This information
108
106
will be presented in the buildbot web pages that display information about the
109
- builders running on your buildslave .
107
+ builders running on your worker .
110
108
111
- You will also want to make sure that the buildslave is started when the
109
+ You will also want to make sure that the worker is started when the
112
110
machine reboots:
113
111
114
112
For Linux:
115
113
116
114
* Add the following line to ``/etc/crontab ``::
117
115
118
- @reboot buildslave restart /path/to/buildarea
116
+ @reboot buildbot-worker restart /path/to/buildarea
119
117
120
118
Note that we use ``restart`` rather than ``start`` in case a crash has
121
119
left a ``twistd.pid`` file behind.
@@ -126,13 +124,13 @@ For OSX:
126
124
127
125
mkdir bin
128
126
129
- * Place the following script, named ``run_slave .sh ``, into that directory::
127
+ * Place the following script, named ``run_worker .sh ``, into that directory::
130
128
131
129
#!/bin/bash
132
130
export PATH=/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
133
131
export LC_CTYPE=en_US.utf-8
134
132
cd /Users/buildbot/buildarea
135
- twistd --nodaemon --python=buildbot.tac --logfile=buildbot.log --prefix=slave
133
+ twistd --nodaemon --python=buildbot.tac --logfile=buildbot.log --prefix=worker
136
134
137
135
If you use pip with Apple's system python, add '/System' to the front of
138
136
the path to the Python bin directory.
@@ -147,14 +145,14 @@ For OSX:
147
145
<plist version =" 1.0" >
148
146
<dict >
149
147
<key >Label</key >
150
- <string >net.buildbot.slave </string >
148
+ <string >net.buildbot.worker </string >
151
149
<key >UserName</key >
152
150
<string >buildbot</string >
153
151
<key >WorkingDirectory</key >
154
152
<string >/Users/buildbot/buildarea</string >
155
153
<key >ProgramArguments</key >
156
154
<array >
157
- <string >/Users/buildbot/bin/run_slave .sh</string >
155
+ <string >/Users/buildbot/bin/run_worker .sh</string >
158
156
</array >
159
157
<key >StandardOutPath</key >
160
158
<string >twistd.log</string >
@@ -167,27 +165,27 @@ For OSX:
167
165
</dict >
168
166
</plist >
169
167
170
- The recommended name for the file is ``net.buildbot.slave ``.
168
+ The recommended name for the file is ``net.buildbot.worker ``.
171
169
172
170
For Windows:
173
171
174
- * Add a Scheduled Task to run ``buildslave start buildarea `` as the
172
+ * Add a Scheduled Task to run ``buildbot-worker start buildarea `` as the
175
173
buildbot user "when the computer starts up". It is best to provide
176
- absolute paths to the ``buildslave `` command and the :file: `buildarea `
174
+ absolute paths to the ``buildbot-worker `` command and the :file: `buildarea `
177
175
directory. It is also recommended to set the task to run in the
178
176
directory that contains the :file: `buildarea ` directory.
179
177
180
- * Alternatively (note: don't do both!), set up the buildslave
178
+ * Alternatively (note: don't do both!), set up the worker
181
179
service as described in the `buildbot documentation
182
180
<http://trac.buildbot.net/wiki/RunningBuildbotOnWindows#Service> `_.
183
181
184
- To start the buildslave running for your initial testing, you can do::
182
+ To start the worker running for your initial testing, you can do::
185
183
186
- buildslave start buildarea
184
+ buildbot-worker start buildarea
187
185
188
186
Then you can either wait for someone to make a commit, or you can pick a
189
- builder associated with your buildslave from the `list of builders
190
- <http://buildbot.python.org/all/buildslaves > `_ and force a build.
187
+ builder associated with your worker from the `list of builders
188
+ <http://buildbot.python.org/all/#/builders > `_ and force a build.
191
189
192
190
In any case you should initially monitor builds on your builders to make sure
193
191
the tests are passing and to resolve any platform issues that may be revealed
@@ -196,19 +194,19 @@ only of failures on your builders, so doing periodic spot checks is also a good
196
194
idea.
197
195
198
196
199
- Latent slaves
200
- ^^^^^^^^^^^^^
197
+ Latent workers
198
+ ^^^^^^^^^^^^^^
201
199
202
- We also support running `latent buildslaves
203
- <http://docs.buildbot.net/current/manual/cfg-buildslaves .html#latent-buildslaves > `_
204
- on the AWS EC2 service. To set up such a slave :
200
+ We also support running `latent workers
201
+ <http://docs.buildbot.net/current/manual/cfg-workers .html#latent-workers > `_
202
+ on the AWS EC2 service. To set up such a worker :
205
203
206
204
* Start an instance of your chosen base AMI and set it up as a
207
- conventional slave .
208
- * After the instance is fully set up as a conventional slave (including
209
- slave name and password, and admin and host information), create an AMI
205
+ conventional worker .
206
+ * After the instance is fully set up as a conventional worker (including
207
+ worker name and password, and admin and host information), create an AMI
210
208
from the instance and stop the instance.
211
- * Contact the buildmaster administrator who gave you your slave
209
+ * Contact the buildmaster administrator who gave you your worker
212
210
name and password and give them the following information:
213
211
214
212
* Instance size (such as ``m4.large ``)
@@ -221,63 +219,63 @@ on the AWS EC2 service. To set up such a slave:
221
219
The buildmaster cannot guarantee that it will always shut down your
222
220
instance(s), so it is recommended to periodically check and make sure
223
221
there are no "zombie" instances running on your account, created by the
224
- buildbot master. Also, if you notice that your slave seems to have been
222
+ buildbot master. Also, if you notice that your worker seems to have been
225
223
down for an unexpectedly long time, please ping the `python-buildbots
226
224
<https://mail.python.org/mailman/listinfo/python-buildbots> `_ list to
227
225
request that the master be restarted.
228
226
229
- Latent slaves should also be updated periodically to include operating system
230
- or other software updates, but when do do such maintenance is largely up to you
231
- as the slave owner. There are a couple different options for doing such
227
+ Latent workers should also be updated periodically to include operating system
228
+ or other software updates, but when to do such maintenance is largely up to you
229
+ as the worker owner. There are a couple different options for doing such
232
230
updates:
233
231
234
232
* Start an instance from your existing AMI, do updates on that instance,
235
233
and save a new AMI from the updated instance. Note that (especially for
236
- Windows slaves ) you should do at least one restart of the instance after
234
+ Windows workers ) you should do at least one restart of the instance after
237
235
doing updates to be sure that any post-reboot update work is done before
238
236
creating the new AMI.
239
237
* Create an entirely new setup from a newer base AMI using your existing
240
- slave name and password.
238
+ worker name and password.
241
239
242
240
Whichever way you choose to update your AMI, you'll need to provide the
243
241
buildmaster administrators with the new AMI ID.
244
242
245
243
246
- Buildslave operation
247
- --------------------
244
+ Buildbot worker operation
245
+ -------------------------
248
246
249
- Most of the time, running a buildslave is a "set and forget" operation,
247
+ Most of the time, running a worker is a "set and forget" operation,
250
248
depending on the level of involvement you want to have in resolving bugs
251
249
revealed by your builders. There are, however, times when it is helpful or
252
250
even necessary for you to get involved. As noted above, you should be
253
251
subscribed to ``
[email protected] `` so that you will be made
254
252
aware of any fleet-wide issues.
255
253
256
254
Necessary tasks include, obviously, keeping the buildbot running. Currently
257
- the system for notifying buildbot owners when their slaves go offline is not
255
+ the system for notifying buildbot owners when their workers go offline is not
258
256
working; this is something we hope to resolve. So currently it is helpful if
259
- you periodically check the status of your buildslave . We will also contact you
257
+ you periodically check the status of your worker . We will also contact you
260
258
via your contact address in ``buildarea/info/admin `` when we notice there is a
261
259
problem that has not been resolved for some period of time and you have
262
260
not responded to a posting on the python-buildbots list about it.
263
261
264
- We currently do not have a minimum version requirement for the buildslave
262
+ We currently do not have a minimum version requirement for the worker
265
263
software. However, this is something we will probably establish as we tune the
266
- fleet, so another task will be to occasionally upgrade the buildslave software.
264
+ fleet, so another task will be to occasionally upgrade the buildbot worker software.
267
265
Coordination for this will be done via ``
[email protected] ``.
268
266
269
- The most interesting extra involvement is when your buildslave reveals a unique
267
+ The most interesting extra involvement is when your worker reveals a unique
270
268
or almost-unique problem: a test that is failing on your system but not on
271
269
other systems. In this case you should be prepared to offer debugging help to
272
- the people working on the bug: running tests by hand on the buildslave machine
270
+ the people working on the bug: running tests by hand on the worker machine
273
271
or, if possible, providing ssh access to a committer to run experiments to try
274
272
to resolve the issue.
275
273
276
274
277
275
Required Ports
278
276
--------------
279
277
280
- The buildslave operates as a *client * to the *buildmaster *. This means that
278
+ The worker operates as a *client * to the *buildmaster *. This means that
281
279
all network connections are *outbound *. This is true also for the network
282
280
tests in the test suite. Most consumer firewalls will allow any outbound
283
281
traffic, so normally you do not need to worry about what ports the buildbot
@@ -325,10 +323,10 @@ suite.
325
323
Security Considerations
326
324
-----------------------
327
325
328
- We only allow builds to be triggered against commits to the CPython repository,
329
- or committer-initiated branches hosted on hg. python.org. This means that the
330
- code your buildbot will run will have been vetted by a committer. However,
331
- mistakes and bugs happen, as could a compromise, so keep this in mind when
326
+ We only allow builds to be triggered against commits to the
327
+ ` CPython repository on GitHub < https://github.com/ python/cpython >`_.
328
+ This means that the code your buildbot will run will have been vetted by a committer.
329
+ However, mistakes and bugs happen, as could a compromise, so keep this in mind when
332
330
siting your buildbot on your network and establishing the security around it.
333
331
Treat the buildbot like you would any resource that is public facing and might
334
332
get hacked (use a VM and/or jail/chroot/solaris zone, put it in a DMZ, etc).
0 commit comments