blob: 464cb602f74069fd4a9b20d1e1d32c7081deb645 [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. Blair4f3e6222017-07-05 14:52:08 -0700104.. NOTE: this is a white lie at this point, since only the scheduler
105 uses this, however, we expect other components to use it later, so
106 it's reasonable for admins to plan for this now.
107
James E. Blair97940192017-08-03 14:47:47 -0700108.. attr:: zookeeper
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400109
James E. Blair97940192017-08-03 14:47:47 -0700110 Client connection information for ZooKeeper
James E. Blairfdb111d2017-06-23 20:56:05 +0100111
James E. Blair97940192017-08-03 14:47:47 -0700112 .. attr:: hosts
113 :required:
114
115 A list of zookeeper hosts for Zuul to use when communicating
116 with Nodepool.
117
James E. Blaire2f0a872017-09-28 10:35:12 -0700118 .. attr:: session_timeout
119 :default: 10.0
120
121 The ZooKeeper session timeout, in seconds.
122
James E. Blair97940192017-08-03 14:47:47 -0700123
124.. _scheduler:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700125
126Scheduler
127---------
128
129The scheduler is the primary component of Zuul. The scheduler is not
130a scalable component; one, and only one, scheduler must be running at
131all times for Zuul to be operational. It receives events from any
132connections to remote systems which have been configured, enqueues
133items into pipelines, distributes jobs to executors, and reports
134results.
135
136Configuration
137~~~~~~~~~~~~~
138
James E. Blair97940192017-08-03 14:47:47 -0700139The following sections of ``zuul.conf`` are used by the scheduler:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700140
James E. Blaireff5a9d2017-06-20 00:00:37 -0700141
James E. Blair97940192017-08-03 14:47:47 -0700142.. attr:: gearman_server
James E. Blaireff5a9d2017-06-20 00:00:37 -0700143
James E. Blair97940192017-08-03 14:47:47 -0700144 The builtin gearman server. Zuul can fork a gearman process from
145 itself rather than connecting to an external one.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400146
James E. Blair97940192017-08-03 14:47:47 -0700147 .. attr:: start
148 :default: false
James E. Blaireff5a9d2017-06-20 00:00:37 -0700149
James E. Blair97940192017-08-03 14:47:47 -0700150 Whether to start the internal Gearman server.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400151
James E. Blair97940192017-08-03 14:47:47 -0700152 .. attr:: listen_address
153 :default: all addresses
James E. Blaireff5a9d2017-06-20 00:00:37 -0700154
James E. Blair97940192017-08-03 14:47:47 -0700155 IP address or domain name on which to listen.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400156
Tristan Cacqueraya7586c92017-08-29 10:10:08 +0000157 .. attr:: port
158 :default: 4730
159
160 TCP port on which to listen.
161
James E. Blair97940192017-08-03 14:47:47 -0700162 .. attr:: log_config
James E. Blaireff5a9d2017-06-20 00:00:37 -0700163
James E. Blair97940192017-08-03 14:47:47 -0700164 Path to log config file for internal Gearman server.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700165
James E. Blair97940192017-08-03 14:47:47 -0700166 .. attr:: ssl_ca
James E. Blaireff5a9d2017-06-20 00:00:37 -0700167
James E. Blair97940192017-08-03 14:47:47 -0700168 An openssl file containing a set of concatenated “certification
169 authority” certificates in PEM formet.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700170
James E. Blair97940192017-08-03 14:47:47 -0700171 .. attr:: ssl_cert
James E. Blaireff5a9d2017-06-20 00:00:37 -0700172
James E. Blair97940192017-08-03 14:47:47 -0700173 An openssl file containing the server public certificate in PEM
174 format.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400175
James E. Blair97940192017-08-03 14:47:47 -0700176 .. attr:: ssl_key
James E. Blaireff5a9d2017-06-20 00:00:37 -0700177
James E. Blair97940192017-08-03 14:47:47 -0700178 An openssl file containing the server private key in PEM format.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400179
James E. Blair97940192017-08-03 14:47:47 -0700180.. attr:: webapp
James E. Blaireff5a9d2017-06-20 00:00:37 -0700181
James E. Blair97940192017-08-03 14:47:47 -0700182 .. attr:: listen_address
183 :default: all addresses
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400184
James E. Blair97940192017-08-03 14:47:47 -0700185 IP address or domain name on which to listen.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700186
James E. Blair97940192017-08-03 14:47:47 -0700187 .. attr:: port
188 :default: 8001
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400189
James E. Blair97940192017-08-03 14:47:47 -0700190 Port on which the webapp is listening.
James E. Blair4f3e6222017-07-05 14:52:08 -0700191
James E. Blair97940192017-08-03 14:47:47 -0700192 .. attr:: status_expiry
193 :default: 1
James E. Blaireff5a9d2017-06-20 00:00:37 -0700194
James E. Blair97940192017-08-03 14:47:47 -0700195 Zuul will cache the status.json file for this many seconds.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400196
James E. Blair97940192017-08-03 14:47:47 -0700197 .. attr:: status_url
James E. Blaireff5a9d2017-06-20 00:00:37 -0700198
James E. Blair97940192017-08-03 14:47:47 -0700199 URL that will be posted in Zuul comments made to changes when
200 starting jobs for a change.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400201
James E. Blair97940192017-08-03 14:47:47 -0700202 .. TODO: is this effectively required?
James E. Blaireff5a9d2017-06-20 00:00:37 -0700203
James E. Blair97940192017-08-03 14:47:47 -0700204.. attr:: scheduler
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400205
James E. Blair97940192017-08-03 14:47:47 -0700206 .. attr:: tenant_config
207 :required:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700208
James E. Blair97940192017-08-03 14:47:47 -0700209 Path to :ref:`tenant-config` file.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400210
James E. Blair97940192017-08-03 14:47:47 -0700211 .. attr:: log_config
212
213 Path to log config file.
214
215 .. attr:: pidfile
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700216 :default: /var/run/zuul-schedurecr/zuul-scheduler.pid
James E. Blair97940192017-08-03 14:47:47 -0700217
218 Path to PID lock file.
219
220 .. attr:: state_dir
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700221 :default: /var/lib/zuul
James E. Blair97940192017-08-03 14:47:47 -0700222
223 Path to directory in which Zuul should save its state.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700224
225Operation
226~~~~~~~~~
227
228To start the scheduler, run ``zuul-scheduler``. To stop it, kill the
229PID which was saved in the pidfile specified in the configuration.
230
231Most of Zuul's configuration is automatically updated as changes to
232the repositories which contain it are merged. However, Zuul must be
233explicitly notified of changes to the tenant config file, since it is
234not read from a git repository. To do so, send the scheduler PID
James E. Blair97940192017-08-03 14:47:47 -0700235(saved in the pidfile specified in the configuration) a `SIGHUP`
236signal.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700237
238Merger
239------
240
241Mergers are an optional Zuul service; they are not required for Zuul
242to operate, but some high volume sites may benefit from running them.
243Zuul performs quite a lot of git operations in the course of its work.
244Each change that is to be tested must be speculatively merged with the
245current state of its target branch to ensure that it can merge, and to
246ensure that the tests that Zuul perform accurately represent the
247outcome of merging the change. Because Zuul's configuration is stored
248in the git repos it interacts with, and is dynamically evaluated, Zuul
249often needs to perform a speculative merge in order to determine
250whether it needs to perform any further actions.
251
252All of these git operations add up, and while Zuul executors can also
253perform them, large numbers may impact their ability to run jobs.
254Therefore, administrators may wish to run standalone mergers in order
255to reduce the load on executors.
256
257Configuration
258~~~~~~~~~~~~~
259
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700260The following section of ``zuul.conf`` is used by the merger:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700261
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700262.. attr:: merger
James E. Blaireff5a9d2017-06-20 00:00:37 -0700263
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700264 .. attr:: git_dir
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400265
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700266 Directory in which Zuul should clone git repositories.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700267
Paul Belangeredadfed2017-10-05 16:04:27 -0400268 .. attr:: git_http_low_speed_limit
269 :default: 1000
270
271 If the HTTP transfer speed is less then git_http_low_speed_limit for
272 longer then git_http_low_speed_time, the transfer is aborted.
273
274 Value in bytes, setting to 0 will disable.
275
276 .. attr:: git_http_low_speed_time
277 :default: 30
278
279 If the HTTP transfer speed is less then git_http_low_speed_limit for
280 longer then git_http_low_speed_time, the transfer is aborted.
281
282 Value in seconds, setting to 0 will disable.
283
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700284 .. attr:: git_user_email
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400285
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700286 Value to pass to `git config user.email
287 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700288
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700289 .. attr:: git_user_name
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400290
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700291 Value to pass to `git config user.name
292 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700293
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700294 .. attr:: log_config
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400295
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700296 Path to log config file for the merger process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700297
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700298 .. attr:: pidfile
299 :default: /var/run/zuul-merger/zuul-merger.pid
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400300
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700301 Path to PID lock file for the merger process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700302
303Operation
304~~~~~~~~~
305
306To start the merger, run ``zuul-merger``. To stop it, kill the
307PID which was saved in the pidfile specified in the configuration.
308
David Shrewsburyb040b0a2017-08-03 15:53:59 -0400309.. _executor:
310
James E. Blaireff5a9d2017-06-20 00:00:37 -0700311Executor
312--------
313
314Executors are responsible for running jobs. At the start of each job,
315an executor prepares an environment in which to run Ansible which
316contains all of the git repositories specified by the job with all
317dependent changes merged into their appropriate branches. The branch
318corresponding to the proposed change will be checked out (in all
319projects, if it exists). Any roles specified by the job will also be
320present (also with dependent changes merged, if appropriate) and added
321to the Ansible role path. The executor also prepares an Ansible
322inventory file with all of the nodes requested by the job.
323
324The executor also contains a merger. This is used by the executor to
325prepare the git repositories used by jobs, but is also available to
326perform any tasks normally performed by standalone mergers. Because
327the executor performs both roles, small Zuul installations may not
328need to run standalone mergers.
329
330Trusted and Untrusted Playbooks
331~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
332
333The executor runs playbooks in one of two execution contexts depending
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700334on whether the project containing the playbook is a
335:term:`config-project` or an :term:`untrusted-project`. If the
336playbook is in a config project, the executor runs the playbook in the
337*trusted* execution context, otherwise, it is run in the *untrusted*
338execution context.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700339
Clint Byrum48b5a672017-08-18 14:44:00 -0700340Both execution contexts use `bubblewrap`_ [#nullwrap]_ to create a
341namespace to ensure that playbook executions are isolated and are unable
342to access files outside of a restricted environment. The administrator
343may configure additional local directories on the executor to be made
James E. Blaireff5a9d2017-06-20 00:00:37 -0700344available to the restricted environment.
345
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700346The trusted execution context has access to all Ansible features,
James E. Blaireff5a9d2017-06-20 00:00:37 -0700347including the ability to load custom Ansible modules. Needless to
348say, extra scrutiny should be given to code that runs in a trusted
349context as it could be used to compromise other jobs running on the
350executor, or the executor itself, especially if the administrator has
351granted additional access through bubblewrap, or a method of escaping
352the restricted environment created by bubblewrap is found.
353
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700354Playbooks run in the untrusted execution context are not permitted to
355load additional Ansible modules or access files outside of the
James E. Blaireff5a9d2017-06-20 00:00:37 -0700356restricted environment prepared for them by the executor. In addition
357to the bubblewrap environment applied to both execution contexts, in
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700358the untrusted context some standard Ansible modules are replaced with
359versions which prohibit some actions, including attempts to access
360files outside of the restricted execution context. These redundant
361protections are made as part of a defense-in-depth strategy.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700362
363.. _bubblewrap: https://github.com/projectatomic/bubblewrap
Clint Byrum48b5a672017-08-18 14:44:00 -0700364.. [#nullwrap] Unless one has set execution_wrapper to nullwrap in the
365 executor configuration.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700366
367Configuration
368~~~~~~~~~~~~~
369
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700370The following sections of ``zuul.conf`` are used by the executor:
James E. Blaireff5a9d2017-06-20 00:00:37 -0700371
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700372.. attr:: executor
James E. Blaireff5a9d2017-06-20 00:00:37 -0700373
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700374 .. attr:: finger_port
375 :default: 79
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400376
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700377 Port to use for finger log streamer.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700378
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700379 .. attr:: git_dir
380 :default: /var/lib/zuul/git
James E. Blair7e6e0a12017-07-25 11:04:42 -0700381
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700382 Directory that Zuul should clone local git repositories to. The
383 executor keeps a local copy of every git repository it works
384 with to speed operations and perform speculative merging.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400385
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700386 This should be on the same filesystem as
387 :attr:`executor.job_dir` so that when git repos are cloned into
388 the job workspaces, they can be hard-linked to the local git
389 cache.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700390
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700391 .. attr:: job_dir
392 :default: /tmp
James E. Blair7e6e0a12017-07-25 11:04:42 -0700393
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700394 Directory that Zuul should use to hold temporary job directories.
395 When each job is run, a new entry will be created under this
396 directory to hold the configuration and scratch workspace for
397 that job. It will be deleted at the end of the job (unless the
398 `--keep-jobdir` command line option is specified).
James E. Blair7e6e0a12017-07-25 11:04:42 -0700399
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700400 This should be on the same filesystem as :attr:`executor.git_dir`
401 so that when git repos are cloned into the job workspaces, they
402 can be hard-linked to the local git cache.
James E. Blair7e6e0a12017-07-25 11:04:42 -0700403
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700404 .. attr:: log_config
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400405
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700406 Path to log config file for the executor process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700407
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700408 .. attr:: pidfile
409 :default: /var/run/zuul-executor/zuul-executor.pid
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400410
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700411 Path to PID lock file for the executor process.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700412
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700413 .. attr:: private_key_file
414 :default: ~/.ssh/id_rsa
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400415
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700416 SSH private key file to be used when logging into worker nodes.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700417
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700418 .. attr:: user
419 :default: zuul
Jamie Lennox7655b552017-03-17 12:33:38 +1100420
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700421 User ID for the zuul-executor process. In normal operation as a
422 daemon, the executor should be started as the ``root`` user, but
423 it will drop privileges to this user during startup.
Jamie Lennox7655b552017-03-17 12:33:38 +1100424
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700425 .. _admin_sitewide_variables:
Jamie Lennox7655b552017-03-17 12:33:38 +1100426
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700427 .. attr:: variables
Jamie Lennox7655b552017-03-17 12:33:38 +1100428
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700429 Path to an Ansible variables file to supply site-wide variables.
430 This should be a YAML-formatted file consisting of a single
431 dictionary. The contents will be made available to all jobs as
432 Ansible variables. These variables take precedence over all
433 other forms (job variables and secrets). Care should be taken
434 when naming these variables to avoid potential collisions with
435 those used by jobs. Prefixing variable names with a
436 site-specific identifier is recommended. The default is not to
437 add any site-wide variables. See the :ref:`User's Guide
438 <user_sitewide_variables>` for more information.
Clint Byrumdc8a0902017-07-20 16:36:27 -0700439
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700440 .. attr:: disk_limit_per_job
441 :default: 250
Clint Byrumdc8a0902017-07-20 16:36:27 -0700442
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700443 This integer is the maximum number of megabytes that any one job
444 is allowed to consume on disk while it is running. If a job's
445 scratch space has more than this much space consumed, it will be
446 aborted.
Monty Taylor01380dd2017-07-28 16:01:20 -0500447
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700448 .. attr:: trusted_ro_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500449
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700450 List of paths, separated by ``:`` to read-only bind mount into
451 trusted bubblewrap contexts.
Monty Taylor01380dd2017-07-28 16:01:20 -0500452
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700453 .. attr:: trusted_rw_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500454
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700455 List of paths, separated by ``:`` to read-write bind mount into
456 trusted bubblewrap contexts.
Monty Taylor01380dd2017-07-28 16:01:20 -0500457
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700458 .. attr:: untrusted_ro_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500459
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700460 List of paths, separated by ``:`` to read-only bind mount into
461 untrusted bubblewrap contexts.
Monty Taylor01380dd2017-07-28 16:01:20 -0500462
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700463 .. attr:: untrusted_rw_paths
Monty Taylor01380dd2017-07-28 16:01:20 -0500464
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700465 List of paths, separated by ``:`` to read-write bind mount into
466 untrusted bubblewrap contexts.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700467
Clint Byrum48b5a672017-08-18 14:44:00 -0700468 .. attr:: execution_wrapper
469 :default: bubblewrap
470
471 Name of the execution wrapper to use when executing
472 `ansible-playbook`. The default, `bubblewrap` is recommended for
473 all installations.
474
475 There is also a `nullwrap` driver for situations where one wants
476 to run Zuul without access to bubblewrap or in such a way that
477 bubblewrap may interfere with the jobs themselves. However,
478 `nullwrap` is considered unsafe, as `bubblewrap` provides
479 significant protections against malicious users and accidental
480 breakage in playbooks. As such, `nullwrap` is not recommended
481 for use in production.
482
483 This option, and thus, `nullwrap`, may be removed in the future.
484 `bubblewrap` has become integral to securely operating Zuul. If you
485 have a valid use case for it, we encourage you to let us know.
486
Clint Byrum3cef7ed2017-09-29 20:18:54 -0700487 .. attr:: load_multiplier
488 :default: 2.5
489
490 When an executor host gets too busy, the system may suffer
491 timeouts and other ill effects. The executor will stop accepting
492 more than 1 job at a time until load has lowered below a safe
493 level. This level is determined by multiplying the number of
494 CPU's by `load_multiplier`.
495
496 So for example, if the system has 2 CPUs, and load_multiplier
497 is 2.5, the safe load for the system is 5.00. Any time the
498 system load average is over 5.00, the executor will quit
499 accepting multiple jobs at one time.
500
501 The executor will observe system load and determine whether
502 to accept more jobs every 30 seconds.
503
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700504.. attr:: merger
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400505
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700506 .. attr:: git_user_email
James E. Blaireff5a9d2017-06-20 00:00:37 -0700507
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700508 Value to pass to `git config user.email
509 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400510
James E. Blair9d0b4cc2017-08-03 15:08:47 -0700511 .. attr:: git_user_name
512
513 Value to pass to `git config user.name
514 <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_.
James E. Blaireff5a9d2017-06-20 00:00:37 -0700515
516Operation
517~~~~~~~~~
518
519To start the executor, run ``zuul-executor``.
520
521There are several commands which can be run to control the executor's
522behavior once it is running.
523
524To stop the executor immediately, aborting all jobs (they may be
525relaunched according to their retry policy), run ``zuul-executor
526stop``.
527
528To request that the executor stop executing new jobs and exit when all
529currently running jobs have completed, run ``zuul-executor graceful``.
530
James E. Blairafe27e62017-08-03 15:11:47 -0700531To enable or disable running Ansible in verbose mode (with the
532``-vvv`` argument to ansible-playbook) run ``zuul-executor verbose``
533and ``zuul-executor unverbose``.
David Shrewsburyae734d12017-07-11 12:41:59 -0400534
535Web Server
536----------
537
538The Zuul web server currently acts as a websocket interface to live log
539streaming. Eventually, it will serve as the single process handling all
540HTTP interactions with Zuul.
541
542Configuration
543~~~~~~~~~~~~~
544
James E. Blairafe27e62017-08-03 15:11:47 -0700545In addition to the common configuration sections, the following
546sections of ``zuul.conf`` are used by the web server:
David Shrewsburyae734d12017-07-11 12:41:59 -0400547
James E. Blairafe27e62017-08-03 15:11:47 -0700548.. attr:: web
David Shrewsburyae734d12017-07-11 12:41:59 -0400549
James E. Blairafe27e62017-08-03 15:11:47 -0700550 .. attr:: listen_address
551 :default: 127.0.0.1
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400552
James E. Blairafe27e62017-08-03 15:11:47 -0700553 IP address or domain name on which to listen.
David Shrewsburyae734d12017-07-11 12:41:59 -0400554
James E. Blairafe27e62017-08-03 15:11:47 -0700555 .. attr:: log_config
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400556
James E. Blairafe27e62017-08-03 15:11:47 -0700557 Path to log config file for the web server process.
David Shrewsburyae734d12017-07-11 12:41:59 -0400558
James E. Blairafe27e62017-08-03 15:11:47 -0700559 .. attr:: pidfile
560 :default: /var/run/zuul-web/zuul-web.pid
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400561
James E. Blairafe27e62017-08-03 15:11:47 -0700562 Path to PID lock file for the web server process.
David Shrewsburyae734d12017-07-11 12:41:59 -0400563
James E. Blairafe27e62017-08-03 15:11:47 -0700564 .. attr:: port
565 :default: 9000
David Shrewsbury6b3b49b2017-07-11 13:00:38 -0400566
James E. Blairafe27e62017-08-03 15:11:47 -0700567 Port to use for web server process.
David Shrewsburyae734d12017-07-11 12:41:59 -0400568
James E. Blairafe27e62017-08-03 15:11:47 -0700569 .. attr:: websocket_url
570
571 Base URL on which the websocket service is exposed, if different
572 than the base URL of the web app.
Tobias Henkelb4407fc2017-07-07 13:52:56 +0200573
David Shrewsburyae734d12017-07-11 12:41:59 -0400574Operation
575~~~~~~~~~
576
577To start the web server, run ``zuul-web``. To stop it, kill the
578PID which was saved in the pidfile specified in the configuration.