blob: 18bbfa3f44735087e5685501ef87812e7fc80b94 [file] [log] [blame]
James E. Blaireff5a9d2017-06-20 00:00:37 -07001:title: Components
2
3.. _components:
4
5Components
6==========
7
8Zuul is a distributed system consisting of several components, each of
James E. Blaire86abe12017-08-04 14:46:00 -07009which is described below.
10
11
12.. graphviz::
13 :align: center
14
15 graph {
16 node [shape=box]
17 Gearman [shape=ellipse]
18 Gerrit [fontcolor=grey]
19 Zookeeper [shape=ellipse]
20 Nodepool
21 GitHub [fontcolor=grey]
22
23 Merger -- Gearman
24 Executor -- Gearman
25 Web -- Gearman
26
27 Gearman -- Scheduler;
28 Scheduler -- Gerrit;
29 Scheduler -- Zookeeper;
30 Zookeeper -- Nodepool;
31 Scheduler -- GitHub;
32 }
33
34
35
36All Zuul processes read the ``/etc/zuul/zuul.conf`` file (an alternate
37location may be supplied on the command line) which uses an INI file
38syntax. Each component may have its own configuration file, though
39you may find it simpler to use the same file for all components.
James E. Blaireff5a9d2017-06-20 00:00:37 -070040
James E. Blair97940192017-08-03 14:47:47 -070041An example ``zuul.conf``:
42
43.. code-block:: ini
44
45 [gearman]
46 server=localhost
47
48 [gearman_server]
49 start=true
50 log_config=/etc/zuul/gearman-logging.yaml
51
52 [zookeeper]
53 hosts=zk1.example.com,zk2.example.com,zk3.example.com
54
55 [webapp]
56 status_url=https://zuul.example.com/status
57
58 [scheduler]
59 log_config=/etc/zuul/scheduler-logging.yaml
60
61A minimal Zuul system may consist of a :ref:`scheduler` and
62:ref:`executor` both running on the same host. Larger installations
63should consider running multiple executors, each on a dedicated host,
64and running mergers on dedicated hosts as well.
James E. Blaireff5a9d2017-06-20 00:00:37 -070065
66Common
67------
68
69The following applies to all Zuul components.
70
71Configuration
72~~~~~~~~~~~~~
73
James E. Blair97940192017-08-03 14:47:47 -070074The following sections of ``zuul.conf`` are used by all Zuul components:
James E. Blaireff5a9d2017-06-20 00:00:37 -070075
James E. Blaireff5a9d2017-06-20 00:00:37 -070076
James E. Blair97940192017-08-03 14:47:47 -070077.. attr:: gearman
James E. Blaireff5a9d2017-06-20 00:00:37 -070078
James E. Blair97940192017-08-03 14:47:47 -070079 Client connection information for Gearman.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -040080
James E. Blair97940192017-08-03 14:47:47 -070081 .. attr:: server
82 :required:
James E. Blaireff5a9d2017-06-20 00:00:37 -070083
James E. Blair97940192017-08-03 14:47:47 -070084 Hostname or IP address of the Gearman server.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -040085
James E. Blair97940192017-08-03 14:47:47 -070086 .. attr:: port
87 :default: 4730
James E. Blaireff5a9d2017-06-20 00:00:37 -070088
James E. Blair97940192017-08-03 14:47:47 -070089 Port on which the Gearman server is listening.
James E. Blaireff5a9d2017-06-20 00:00:37 -070090
James E. Blair97940192017-08-03 14:47:47 -070091 .. attr:: ssl_ca
James E. Blaireff5a9d2017-06-20 00:00:37 -070092
James E. Blair97940192017-08-03 14:47:47 -070093 An openssl file containing a set of concatenated “certification
94 authority” certificates in PEM formet.
James E. Blaireff5a9d2017-06-20 00:00:37 -070095
James E. Blair97940192017-08-03 14:47:47 -070096 .. attr:: ssl_cert
97
98 An openssl file containing the client public certificate in PEM format.
99
100 .. attr:: ssl_key
101
102 An openssl file containing the client private key in PEM format.
James E. Blairfdb111d2017-06-23 20:56:05 +0100103
James E. Blairded241e2017-10-10 13:22:40 -0700104.. attr:: statsd
105
106 Information about the optional statsd server. If the ``statsd``
107 python module is installed and this section is configured,
108 statistics will be reported to statsd. See :ref:`statsd` for more
109 information.
110
111 .. attr:: server
112
113 Hostname or IP address of the statsd server.
114
115 .. attr:: port
116 :default: 8125
117
118 The UDP port on which the statsd server is listening.
119
120 .. attr:: prefix
121
122 If present, this will be prefixed to all of the keys before
123 transmitting to the statsd server.
124
James E. Blair4f3e6222017-07-05 14:52:08 -0700125.. NOTE: this is a white lie at this point, since only the scheduler
126 uses this, however, we expect other components to use it later, so
127 it's reasonable for admins to plan for this now.
128
James E. Blair97940192017-08-03 14:47:47 -0700129.. attr:: zookeeper
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400130
James E. Blair97940192017-08-03 14:47:47 -0700131 Client connection information for ZooKeeper
James E. Blairfdb111d2017-06-23 20:56:05 +0100132
James E. Blair97940192017-08-03 14:47:47 -0700133 .. attr:: hosts
134 :required:
135
136 A list of zookeeper hosts for Zuul to use when communicating
137 with Nodepool.
138
James E. Blaire2f0a872017-09-28 10:35:12 -0700139 .. attr:: session_timeout
140 :default: 10.0
141
142 The ZooKeeper session timeout, in seconds.
143
James E. Blair97940192017-08-03 14:47:47 -0700144
145.. _scheduler:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700146
147Scheduler
148---------
149
150The scheduler is the primary component of Zuul. The scheduler is not
151a scalable component; one, and only one, scheduler must be running at
152all times for Zuul to be operational. It receives events from any
153connections to remote systems which have been configured, enqueues
154items into pipelines, distributes jobs to executors, and reports
155results.
156
157Configuration
158~~~~~~~~~~~~~
159
James E. Blair97940192017-08-03 14:47:47 -0700160The following sections of ``zuul.conf`` are used by the scheduler:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700161
James E. Blaireff5a9d2017-06-20 00:00:37 -0700162
James E. Blair97940192017-08-03 14:47:47 -0700163.. attr:: gearman_server
James E. Blaireff5a9d2017-06-20 00:00:37 -0700164
James E. Blair97940192017-08-03 14:47:47 -0700165 The builtin gearman server. Zuul can fork a gearman process from
166 itself rather than connecting to an external one.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400167
James E. Blair97940192017-08-03 14:47:47 -0700168 .. attr:: start
169 :default: false
James E. Blaireff5a9d2017-06-20 00:00:37 -0700170
James E. Blair97940192017-08-03 14:47:47 -0700171 Whether to start the internal Gearman server.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400172
James E. Blair97940192017-08-03 14:47:47 -0700173 .. attr:: listen_address
174 :default: all addresses
James E. Blaireff5a9d2017-06-20 00:00:37 -0700175
James E. Blair97940192017-08-03 14:47:47 -0700176 IP address or domain name on which to listen.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400177
Tristan Cacqueraya7586c92017-08-29 10:10:08 +0000178 .. attr:: port
179 :default: 4730
180
181 TCP port on which to listen.
182
James E. Blair97940192017-08-03 14:47:47 -0700183 .. attr:: log_config
James E. Blaireff5a9d2017-06-20 00:00:37 -0700184
James E. Blair97940192017-08-03 14:47:47 -0700185 Path to log config file for internal Gearman server.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700186
James E. Blair97940192017-08-03 14:47:47 -0700187 .. attr:: ssl_ca
James E. Blaireff5a9d2017-06-20 00:00:37 -0700188
James E. Blair97940192017-08-03 14:47:47 -0700189 An openssl file containing a set of concatenated “certification
190 authority” certificates in PEM formet.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700191
James E. Blair97940192017-08-03 14:47:47 -0700192 .. attr:: ssl_cert
James E. Blaireff5a9d2017-06-20 00:00:37 -0700193
James E. Blair97940192017-08-03 14:47:47 -0700194 An openssl file containing the server public certificate in PEM
195 format.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400196
James E. Blair97940192017-08-03 14:47:47 -0700197 .. attr:: ssl_key
James E. Blaireff5a9d2017-06-20 00:00:37 -0700198
James E. Blair97940192017-08-03 14:47:47 -0700199 An openssl file containing the server private key in PEM format.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400200
James E. Blair97940192017-08-03 14:47:47 -0700201.. attr:: webapp
James E. Blaireff5a9d2017-06-20 00:00:37 -0700202
James E. Blair97940192017-08-03 14:47:47 -0700203 .. attr:: listen_address
204 :default: all addresses
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400205
James E. Blair97940192017-08-03 14:47:47 -0700206 IP address or domain name on which to listen.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700207
James E. Blair97940192017-08-03 14:47:47 -0700208 .. attr:: port
209 :default: 8001
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400210
James E. Blair97940192017-08-03 14:47:47 -0700211 Port on which the webapp is listening.
James E. Blair4f3e6222017-07-05 14:52:08 -0700212
James E. Blair97940192017-08-03 14:47:47 -0700213 .. attr:: status_expiry
214 :default: 1
James E. Blaireff5a9d2017-06-20 00:00:37 -0700215
James E. Blair97940192017-08-03 14:47:47 -0700216 Zuul will cache the status.json file for this many seconds.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400217
James E. Blair97940192017-08-03 14:47:47 -0700218 .. attr:: status_url
James E. Blaireff5a9d2017-06-20 00:00:37 -0700219
James E. Blair97940192017-08-03 14:47:47 -0700220 URL that will be posted in Zuul comments made to changes when
221 starting jobs for a change.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400222
James E. Blair97940192017-08-03 14:47:47 -0700223 .. TODO: is this effectively required?
James E. Blaireff5a9d2017-06-20 00:00:37 -0700224
James E. Blair97940192017-08-03 14:47:47 -0700225.. attr:: scheduler
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400226
Paul Belanger40d3ce62017-11-28 11:49:55 -0500227 .. attr:: command_socket
228 :default: /var/lib/zuul/scheduler.socket
229
230 Path to command socket file for the scheduler process.
231
James E. Blair97940192017-08-03 14:47:47 -0700232 .. attr:: tenant_config
233 :required:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700234
James E. Blair97940192017-08-03 14:47:47 -0700235 Path to :ref:`tenant-config` file.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400236
James E. Blair97940192017-08-03 14:47:47 -0700237 .. attr:: log_config
238
239 Path to log config file.
240
241 .. attr:: pidfile
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700242 :default: /var/run/zuul-schedurecr/zuul-scheduler.pid
James E. Blair97940192017-08-03 14:47:47 -0700243
244 Path to PID lock file.
245
246 .. attr:: state_dir
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700247 :default: /var/lib/zuul
James E. Blair97940192017-08-03 14:47:47 -0700248
249 Path to directory in which Zuul should save its state.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700250
251Operation
252~~~~~~~~~
253
254To start the scheduler, run ``zuul-scheduler``. To stop it, kill the
255PID which was saved in the pidfile specified in the configuration.
256
257Most of Zuul's configuration is automatically updated as changes to
258the repositories which contain it are merged. However, Zuul must be
259explicitly notified of changes to the tenant config file, since it is
260not read from a git repository. To do so, send the scheduler PID
James E. Blair97940192017-08-03 14:47:47 -0700261(saved in the pidfile specified in the configuration) a `SIGHUP`
262signal.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700263
264Merger
265------
266
267Mergers are an optional Zuul service; they are not required for Zuul
268to operate, but some high volume sites may benefit from running them.
269Zuul performs quite a lot of git operations in the course of its work.
270Each change that is to be tested must be speculatively merged with the
271current state of its target branch to ensure that it can merge, and to
272ensure that the tests that Zuul perform accurately represent the
273outcome of merging the change. Because Zuul's configuration is stored
274in the git repos it interacts with, and is dynamically evaluated, Zuul
275often needs to perform a speculative merge in order to determine
276whether it needs to perform any further actions.
277
278All of these git operations add up, and while Zuul executors can also
279perform them, large numbers may impact their ability to run jobs.
280Therefore, administrators may wish to run standalone mergers in order
281to reduce the load on executors.
282
283Configuration
284~~~~~~~~~~~~~
285
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700286The following section of ``zuul.conf`` is used by the merger:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700287
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700288.. attr:: merger
James E. Blaireff5a9d2017-06-20 00:00:37 -0700289
David Shrewsburyfe1f1942017-12-04 13:57:46 -0500290 .. attr:: command_socket
Paul Belanger76506112017-11-27 14:10:30 -0500291 :default: /var/lib/zuul/merger.socket
292
293 Path to command socket file for the merger process.
294
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700295 .. attr:: git_dir
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400296
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700297 Directory in which Zuul should clone git repositories.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700298
Paul Belangeredadfed2017-10-05 16:04:27 -0400299 .. attr:: git_http_low_speed_limit
300 :default: 1000
301
302 If the HTTP transfer speed is less then git_http_low_speed_limit for
303 longer then git_http_low_speed_time, the transfer is aborted.
304
305 Value in bytes, setting to 0 will disable.
306
307 .. attr:: git_http_low_speed_time
308 :default: 30
309
310 If the HTTP transfer speed is less then git_http_low_speed_limit for
311 longer then git_http_low_speed_time, the transfer is aborted.
312
313 Value in seconds, setting to 0 will disable.
314
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700315 .. attr:: git_user_email
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400316
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700317 Value to pass to `git config user.email
318 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700319
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700320 .. attr:: git_user_name
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400321
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700322 Value to pass to `git config user.name
323 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700324
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700325 .. attr:: log_config
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400326
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700327 Path to log config file for the merger process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700328
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700329 .. attr:: pidfile
330 :default: /var/run/zuul-merger/zuul-merger.pid
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400331
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700332 Path to PID lock file for the merger process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700333
334Operation
335~~~~~~~~~
336
337To start the merger, run ``zuul-merger``. To stop it, kill the
338PID which was saved in the pidfile specified in the configuration.
339
David Shrewsburyb040b0a2017-08-03 15:53:59 -0400340.. _executor:
341
James E. Blaireff5a9d2017-06-20 00:00:37 -0700342Executor
343--------
344
345Executors are responsible for running jobs. At the start of each job,
346an executor prepares an environment in which to run Ansible which
347contains all of the git repositories specified by the job with all
348dependent changes merged into their appropriate branches. The branch
349corresponding to the proposed change will be checked out (in all
350projects, if it exists). Any roles specified by the job will also be
351present (also with dependent changes merged, if appropriate) and added
352to the Ansible role path. The executor also prepares an Ansible
353inventory file with all of the nodes requested by the job.
354
355The executor also contains a merger. This is used by the executor to
356prepare the git repositories used by jobs, but is also available to
357perform any tasks normally performed by standalone mergers. Because
358the executor performs both roles, small Zuul installations may not
359need to run standalone mergers.
360
361Trusted and Untrusted Playbooks
362~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
363
364The executor runs playbooks in one of two execution contexts depending
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700365on whether the project containing the playbook is a
366:term:`config-project` or an :term:`untrusted-project`. If the
367playbook is in a config project, the executor runs the playbook in the
368*trusted* execution context, otherwise, it is run in the *untrusted*
369execution context.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700370
Clint Byrum48b5a672017-08-18 14:44:00 -0700371Both execution contexts use `bubblewrap`_ [#nullwrap]_ to create a
372namespace to ensure that playbook executions are isolated and are unable
373to access files outside of a restricted environment. The administrator
374may configure additional local directories on the executor to be made
James E. Blaireff5a9d2017-06-20 00:00:37 -0700375available to the restricted environment.
376
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700377The trusted execution context has access to all Ansible features,
James E. Blaireff5a9d2017-06-20 00:00:37 -0700378including the ability to load custom Ansible modules. Needless to
379say, extra scrutiny should be given to code that runs in a trusted
380context as it could be used to compromise other jobs running on the
381executor, or the executor itself, especially if the administrator has
382granted additional access through bubblewrap, or a method of escaping
383the restricted environment created by bubblewrap is found.
384
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700385Playbooks run in the untrusted execution context are not permitted to
386load additional Ansible modules or access files outside of the
James E. Blaireff5a9d2017-06-20 00:00:37 -0700387restricted environment prepared for them by the executor. In addition
388to the bubblewrap environment applied to both execution contexts, in
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700389the untrusted context some standard Ansible modules are replaced with
390versions which prohibit some actions, including attempts to access
391files outside of the restricted execution context. These redundant
392protections are made as part of a defense-in-depth strategy.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700393
394.. _bubblewrap: https://github.com/projectatomic/bubblewrap
Clint Byrum48b5a672017-08-18 14:44:00 -0700395.. [#nullwrap] Unless one has set execution_wrapper to nullwrap in the
396 executor configuration.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700397
398Configuration
399~~~~~~~~~~~~~
400
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700401The following sections of ``zuul.conf`` are used by the executor:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700402
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700403.. attr:: executor
James E. Blaireff5a9d2017-06-20 00:00:37 -0700404
Paul Belanger20920912017-11-28 11:22:30 -0500405 .. attr:: command_socket
406 :default: /var/lib/zuul/executor.socket
407
408 Path to command socket file for the executor process.
409
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700410 .. attr:: finger_port
David Shrewsbury93eb56d2018-01-10 11:50:03 -0500411 :default: 7900
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400412
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700413 Port to use for finger log streamer.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700414
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700415 .. attr:: git_dir
416 :default: /var/lib/zuul/git
James E. Blair7e6e0a12017-07-25 11:04:42 -0700417
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700418 Directory that Zuul should clone local git repositories to. The
419 executor keeps a local copy of every git repository it works
420 with to speed operations and perform speculative merging.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400421
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700422 This should be on the same filesystem as
423 :attr:`executor.job_dir` so that when git repos are cloned into
424 the job workspaces, they can be hard-linked to the local git
425 cache.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700426
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700427 .. attr:: job_dir
428 :default: /tmp
James E. Blair7e6e0a12017-07-25 11:04:42 -0700429
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700430 Directory that Zuul should use to hold temporary job directories.
431 When each job is run, a new entry will be created under this
432 directory to hold the configuration and scratch workspace for
433 that job. It will be deleted at the end of the job (unless the
434 `--keep-jobdir` command line option is specified).
James E. Blair7e6e0a12017-07-25 11:04:42 -0700435
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700436 This should be on the same filesystem as :attr:`executor.git_dir`
437 so that when git repos are cloned into the job workspaces, they
438 can be hard-linked to the local git cache.
James E. Blair7e6e0a12017-07-25 11:04:42 -0700439
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700440 .. attr:: log_config
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400441
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700442 Path to log config file for the executor process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700443
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700444 .. attr:: pidfile
445 :default: /var/run/zuul-executor/zuul-executor.pid
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400446
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700447 Path to PID lock file for the executor process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700448
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700449 .. attr:: private_key_file
450 :default: ~/.ssh/id_rsa
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400451
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700452 SSH private key file to be used when logging into worker nodes.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700453
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700454 .. _admin_sitewide_variables:
Jamie Lennox7655b552017-03-17 12:33:38 +1100455
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700456 .. attr:: variables
Jamie Lennox7655b552017-03-17 12:33:38 +1100457
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700458 Path to an Ansible variables file to supply site-wide variables.
459 This should be a YAML-formatted file consisting of a single
460 dictionary. The contents will be made available to all jobs as
461 Ansible variables. These variables take precedence over all
462 other forms (job variables and secrets). Care should be taken
463 when naming these variables to avoid potential collisions with
464 those used by jobs. Prefixing variable names with a
465 site-specific identifier is recommended. The default is not to
466 add any site-wide variables. See the :ref:`User's Guide
467 <user_sitewide_variables>` for more information.
Clint Byrumdc8a0902017-07-20 16:36:27 -0700468
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700469 .. attr:: disk_limit_per_job
470 :default: 250
Clint Byrumdc8a0902017-07-20 16:36:27 -0700471
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700472 This integer is the maximum number of megabytes that any one job
473 is allowed to consume on disk while it is running. If a job's
474 scratch space has more than this much space consumed, it will be
475 aborted.
Monty Taylor01380dd2017-07-28 16:01:20 -0500476
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700477 .. attr:: trusted_ro_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500478
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700479 List of paths, separated by ``:`` to read-only bind mount into
480 trusted bubblewrap contexts.
Monty Taylor01380dd2017-07-28 16:01:20 -0500481
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700482 .. attr:: trusted_rw_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500483
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700484 List of paths, separated by ``:`` to read-write bind mount into
485 trusted bubblewrap contexts.
Monty Taylor01380dd2017-07-28 16:01:20 -0500486
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700487 .. attr:: untrusted_ro_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500488
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700489 List of paths, separated by ``:`` to read-only bind mount into
490 untrusted bubblewrap contexts.
Monty Taylor01380dd2017-07-28 16:01:20 -0500491
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700492 .. attr:: untrusted_rw_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500493
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700494 List of paths, separated by ``:`` to read-write bind mount into
495 untrusted bubblewrap contexts.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700496
Clint Byrum48b5a672017-08-18 14:44:00 -0700497 .. attr:: execution_wrapper
498 :default: bubblewrap
499
500 Name of the execution wrapper to use when executing
501 `ansible-playbook`. The default, `bubblewrap` is recommended for
502 all installations.
503
504 There is also a `nullwrap` driver for situations where one wants
505 to run Zuul without access to bubblewrap or in such a way that
506 bubblewrap may interfere with the jobs themselves. However,
507 `nullwrap` is considered unsafe, as `bubblewrap` provides
508 significant protections against malicious users and accidental
509 breakage in playbooks. As such, `nullwrap` is not recommended
510 for use in production.
511
512 This option, and thus, `nullwrap`, may be removed in the future.
513 `bubblewrap` has become integral to securely operating Zuul. If you
514 have a valid use case for it, we encourage you to let us know.
515
Clint Byrum3cef7ed2017-09-29 20:18:54 -0700516 .. attr:: load_multiplier
517 :default: 2.5
518
519 When an executor host gets too busy, the system may suffer
520 timeouts and other ill effects. The executor will stop accepting
521 more than 1 job at a time until load has lowered below a safe
522 level. This level is determined by multiplying the number of
523 CPU's by `load_multiplier`.
524
525 So for example, if the system has 2 CPUs, and load_multiplier
526 is 2.5, the safe load for the system is 5.00. Any time the
527 system load average is over 5.00, the executor will quit
528 accepting multiple jobs at one time.
529
530 The executor will observe system load and determine whether
531 to accept more jobs every 30 seconds.
532
Tobias Henkel055cda32017-10-17 13:08:18 +0200533 .. attr:: hostname
534 :default: hostname of the server
535
536 The executor needs to know its hostname under which it is reachable by
537 zuul-web. Otherwise live console log streaming doesn't work. In most cases
538 This is automatically detected correctly. But when running in environments
539 where it cannot determine its hostname correctly this can be overridden
540 here.
541
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700542.. attr:: merger
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400543
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700544 .. attr:: git_user_email
James E. Blaireff5a9d2017-06-20 00:00:37 -0700545
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700546 Value to pass to `git config user.email
547 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400548
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700549 .. attr:: git_user_name
550
551 Value to pass to `git config user.name
552 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700553
554Operation
555~~~~~~~~~
556
557To start the executor, run ``zuul-executor``.
558
559There are several commands which can be run to control the executor's
560behavior once it is running.
561
562To stop the executor immediately, aborting all jobs (they may be
563relaunched according to their retry policy), run ``zuul-executor
564stop``.
565
566To request that the executor stop executing new jobs and exit when all
567currently running jobs have completed, run ``zuul-executor graceful``.
568
James E. Blairafe27e62017-08-03 15:11:47 -0700569To enable or disable running Ansible in verbose mode (with the
570``-vvv`` argument to ansible-playbook) run ``zuul-executor verbose``
571and ``zuul-executor unverbose``.
David Shrewsburyae734d12017-07-11 12:41:59 -0400572
573Web Server
574----------
575
576The Zuul web server currently acts as a websocket interface to live log
577streaming. Eventually, it will serve as the single process handling all
578HTTP interactions with Zuul.
579
580Configuration
581~~~~~~~~~~~~~
582
James E. Blairafe27e62017-08-03 15:11:47 -0700583In addition to the common configuration sections, the following
584sections of ``zuul.conf`` are used by the web server:
David Shrewsburyae734d12017-07-11 12:41:59 -0400585
James E. Blairafe27e62017-08-03 15:11:47 -0700586.. attr:: web
David Shrewsburyae734d12017-07-11 12:41:59 -0400587
James E. Blairafe27e62017-08-03 15:11:47 -0700588 .. attr:: listen_address
589 :default: 127.0.0.1
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400590
James E. Blairafe27e62017-08-03 15:11:47 -0700591 IP address or domain name on which to listen.
David Shrewsburyae734d12017-07-11 12:41:59 -0400592
James E. Blairafe27e62017-08-03 15:11:47 -0700593 .. attr:: log_config
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400594
James E. Blairafe27e62017-08-03 15:11:47 -0700595 Path to log config file for the web server process.
David Shrewsburyae734d12017-07-11 12:41:59 -0400596
James E. Blairafe27e62017-08-03 15:11:47 -0700597 .. attr:: pidfile
598 :default: /var/run/zuul-web/zuul-web.pid
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400599
James E. Blairafe27e62017-08-03 15:11:47 -0700600 Path to PID lock file for the web server process.
David Shrewsburyae734d12017-07-11 12:41:59 -0400601
James E. Blairafe27e62017-08-03 15:11:47 -0700602 .. attr:: port
603 :default: 9000
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400604
James E. Blairafe27e62017-08-03 15:11:47 -0700605 Port to use for web server process.
David Shrewsburyae734d12017-07-11 12:41:59 -0400606
James E. Blairafe27e62017-08-03 15:11:47 -0700607 .. attr:: websocket_url
608
609 Base URL on which the websocket service is exposed, if different
610 than the base URL of the web app.
Tobias Henkelb4407fc2017-07-07 13:52:56 +0200611
Tristan Cacqueray3c2d39d2017-11-29 05:36:55 +0000612 .. attr:: static_cache_expiry
613 :default: 3600
614
615 The Cache-Control max-age response header value for static files served
616 by the zuul-web. Set to 0 during development to disable Cache-Control.
617
David Shrewsburyae734d12017-07-11 12:41:59 -0400618Operation
619~~~~~~~~~
620
621To start the web server, run ``zuul-web``. To stop it, kill the
622PID which was saved in the pidfile specified in the configuration.
David Shrewsburyfe1f1942017-12-04 13:57:46 -0500623
624Finger Gateway
625--------------
626
David Shrewsburyae3d96b2017-12-13 13:01:46 -0500627The Zuul finger gateway listens on the standard finger port (79) for
628finger requests specifying a build UUID for which it should stream log
David Shrewsburyfe1f1942017-12-04 13:57:46 -0500629results. The gateway will determine which executor is currently running that
630build and query that executor for the log stream.
631
632This is intended to be used with the standard finger command line client.
633For example::
634
635 finger UUID@zuul.example.com
636
637The above would stream the logs for the build identified by `UUID`.
638
639Configuration
640~~~~~~~~~~~~~
641
642In addition to the common configuration sections, the following
643sections of ``zuul.conf`` are used by the finger gateway:
644
645.. attr:: fingergw
646
647 .. attr:: command_socket
648 :default: /var/lib/zuul/fingergw.socket
649
650 Path to command socket file for the executor process.
651
652 .. attr:: listen_address
653 :default: all addresses
654
655 IP address or domain name on which to listen.
656
657 .. attr:: log_config
658
659 Path to log config file for the finger gateway process.
660
661 .. attr:: pidfile
662 :default: /var/run/zuul-fingergw/zuul-fingergw.pid
663
664 Path to PID lock file for the finger gateway process.
665
666 .. attr:: port
667 :default: 79
668
669 Port to use for the finger gateway. Note that since command line
670 finger clients cannot usually specify the port, leaving this set to
671 the default value is highly recommended.
672
673 .. attr:: user
674 :default: zuul
675
676 User ID for the zuul-fingergw process. In normal operation as a
677 daemon, the finger gateway should be started as the ``root`` user, but
678 it will drop privileges to this user during startup.
679
680Operation
681~~~~~~~~~
682
683To start the finger gateway, run ``zuul-fingergw``. To stop it, kill the
684PID which was saved in the pidfile specified in the configuration.