blob: a78a0fab2b648e17e004041315310029a4fced2b [file] [log] [blame]
James E. Blaircdd00072012-06-08 19:17:28 -07001:title: Zuul
2
3Zuul
4====
5
6Configuration
7-------------
8
9Zuul has three configuration files:
10
11**zuul.conf**
James E. Blair1f4c2bb2013-04-26 08:40:46 -070012 Connection information for Gerrit and Gearman, locations of the
Thanh Ha266cbb82016-01-24 20:57:59 -050013 other config files. (required)
James E. Blaircdd00072012-06-08 19:17:28 -070014**layout.yaml**
Thanh Ha266cbb82016-01-24 20:57:59 -050015 Project and pipeline configuration -- what Zuul does. (required)
James E. Blaircdd00072012-06-08 19:17:28 -070016**logging.conf**
Thanh Ha266cbb82016-01-24 20:57:59 -050017 Python logging config. (optional)
James E. Blaircdd00072012-06-08 19:17:28 -070018
19Examples of each of the three files can be found in the etc/ directory
20of the source distribution.
21
James E. Blair6aea36d2012-12-17 13:03:24 -080022.. _zuulconf:
23
James E. Blaircdd00072012-06-08 19:17:28 -070024zuul.conf
25~~~~~~~~~
26
27Zuul will look for ``/etc/zuul/zuul.conf`` or ``~/zuul.conf`` to
28bootstrap its configuration. Alternately, you may specify ``-c
29/path/to/zuul.conf`` on the command line.
30
James E. Blair1f4c2bb2013-04-26 08:40:46 -070031Gerrit and Gearman connection information are each described in a
32section of zuul.conf. The location of the other two configuration
33files (as well as the location of the PID file when running Zuul as a
34server) are specified in a third section.
James E. Blaircdd00072012-06-08 19:17:28 -070035
Clark Boylan9b670902012-09-28 13:47:56 -070036The three sections of this config and their options are documented below.
37You can also find an example zuul.conf file in the git
38`repository
Andreas Jaegerbcfbf932014-09-29 20:21:44 +020039<https://git.openstack.org/cgit/openstack-infra/zuul/tree/etc/zuul.conf-sample>`_
Clark Boylan9b670902012-09-28 13:47:56 -070040
James E. Blair1f4c2bb2013-04-26 08:40:46 -070041gearman
Clark Boylan9b670902012-09-28 13:47:56 -070042"""""""
43
Thanh Ha266cbb82016-01-24 20:57:59 -050044Client connection information for gearman. If using Zuul's builtin gearmand
45server just set **server** to 127.0.0.1.
46
Clark Boylan9b670902012-09-28 13:47:56 -070047**server**
James E. Blair1f4c2bb2013-04-26 08:40:46 -070048 Hostname or IP address of the Gearman server.
Thanh Ha266cbb82016-01-24 20:57:59 -050049 ``server=gearman.example.com`` (required)
Clark Boylan9b670902012-09-28 13:47:56 -070050
James E. Blair1f4c2bb2013-04-26 08:40:46 -070051**port**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010052 Port on which the Gearman server is listening.
Thanh Ha266cbb82016-01-24 20:57:59 -050053 ``port=4730`` (optional)
Clark Boylan9b670902012-09-28 13:47:56 -070054
James E. Blair77cc7b82013-07-15 13:22:37 -070055gearman_server
56""""""""""""""
57
Thanh Ha266cbb82016-01-24 20:57:59 -050058The builtin gearman server. Zuul can fork a gearman process from itself rather
59than connecting to an external one.
60
James E. Blair77cc7b82013-07-15 13:22:37 -070061**start**
62 Whether to start the internal Gearman server (default: False).
63 ``start=true``
64
James E. Blair0ac452e2015-07-22 09:05:16 -070065**listen_address**
66 IP address or domain name on which to listen (default: all addresses).
67 ``listen_address=127.0.0.1``
68
James E. Blair77cc7b82013-07-15 13:22:37 -070069**log_config**
70 Path to log config file for internal Gearman server.
71 ``log_config=/etc/zuul/gearman-logging.yaml``
72
Paul Belanger88ef0ea2015-12-23 11:57:02 -050073webapp
74""""""
75
76**listen_address**
77 IP address or domain name on which to listen (default: 0.0.0.0).
78 ``listen_address=127.0.0.1``
79
80**port**
81 Port on which the webapp is listening (default: 8001).
82 ``port=8008``
83
Clark Boylan9b670902012-09-28 13:47:56 -070084zuul
85""""
86
Thanh Ha266cbb82016-01-24 20:57:59 -050087Zuul's main configuration section. At minimum zuul must be able to find
88layout.yaml to be useful.
89
90.. note:: Must be provided when running zuul-server
91
Antoine Musso9adc6d42014-11-14 15:37:48 +010092.. _layout_config:
93
Clark Boylan9b670902012-09-28 13:47:56 -070094**layout_config**
James E. Blair4076e2b2014-01-28 12:42:20 -080095 Path to layout config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070096 ``layout_config=/etc/zuul/layout.yaml``
97
98**log_config**
James E. Blaira4430132014-02-17 08:32:07 -080099 Path to log config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700100 ``log_config=/etc/zuul/logging.yaml``
101
102**pidfile**
James E. Blaira4430132014-02-17 08:32:07 -0800103 Path to PID lock file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700104 ``pidfile=/var/run/zuul/zuul.pid``
105
106**state_dir**
James E. Blair4076e2b2014-01-28 12:42:20 -0800107 Path to directory that Zuul should save state to. Used by all Zuul
108 commands.
Clark Boylan9b670902012-09-28 13:47:56 -0700109 ``state_dir=/var/lib/zuul``
110
David Shrewsburyd6784292017-04-13 12:08:29 -0400111**jobroot_dir**
112 Path to directory that Zuul should store temporary job files.
113 ``jobroot_dir=/tmp``
114
James E. Blair4076e2b2014-01-28 12:42:20 -0800115**report_times**
116 Boolean value (``true`` or ``false``) that determines if Zuul should
117 include elapsed times for each job in the textual report. Used by
118 zuul-server only.
119 ``report_times=true``
120
121**status_url**
122 URL that will be posted in Zuul comments made to Gerrit changes when
123 starting jobs for a change. Used by zuul-server only.
124 ``status_url=https://zuul.example.com/status``
125
Clark Boylane0b4bdb2014-06-03 17:01:25 -0700126**status_expiry**
127 Zuul will cache the status.json file for this many seconds. This is an
128 optional value and ``1`` is used by default.
129 ``status_expiry=1``
130
James E. Blair4076e2b2014-01-28 12:42:20 -0800131**job_name_in_report**
132 Boolean value (``true`` or ``false``) that indicates whether the
133 job name should be included in the report (normally only the URL
134 is included). Defaults to ``false``. Used by zuul-server only.
135 ``job_name_in_report=true``
136
137merger
138""""""
139
Thanh Ha266cbb82016-01-24 20:57:59 -0500140The zuul-merger process configuration. Detailed documentation on this process
141can be found on the :doc:`merger` page.
142
143.. note:: Must be provided when running zuul-merger. Both services may share the
144 same configuration (and even host) or otherwise have an individual
145 zuul.conf.
146
Clark Boylan9b670902012-09-28 13:47:56 -0700147**git_dir**
148 Directory that Zuul should clone local git repositories to.
149 ``git_dir=/var/lib/zuul/git``
150
Paul Belangerb67aba12013-05-13 19:22:14 -0400151**git_user_email**
152 Optional: Value to pass to `git config user.email`.
153 ``git_user_email=zuul@example.com``
154
155**git_user_name**
156 Optional: Value to pass to `git config user.name`.
157 ``git_user_name=zuul``
158
Arx Cruzb1b010d2013-10-28 19:49:59 -0200159**zuul_url**
James E. Blair4076e2b2014-01-28 12:42:20 -0800160 URL of this merger's git repos, accessible to test workers. Usually
161 "http://zuul.example.com/p" or "http://zuul-merger01.example.com/p"
162 depending on whether the merger is co-located with the Zuul server.
Arx Cruzb1b010d2013-10-28 19:49:59 -0200163
James E. Blaira4430132014-02-17 08:32:07 -0800164**log_config**
165 Path to log config file for the merger process.
166 ``log_config=/etc/zuul/logging.yaml``
167
168**pidfile**
169 Path to PID lock file for the merger process.
170 ``pidfile=/var/run/zuul-merger/merger.pid``
171
David Shrewsburye7374202017-04-27 12:28:45 -0400172executor
173""""""""
174
175The zuul-executor process configuration.
176
177**git_dir**
178 Directory that Zuul should clone local git repositories to.
179 ``git_dir=/var/lib/zuul/git``
180
181**log_config**
182 Path to log config file for the executor process.
183 ``log_config=/etc/zuul/logging.yaml``
184
185**private_key_file**
186 SSH private key file to be used when logging into worker nodes.
187 ``private_key_file=~/.ssh/id_rsa``
188
189**user**
190 User ID for the zuul-executor process. In normal operation as a daemon,
191 the executor should be started as the ``root`` user, but it will drop
192 privileges to this user during startup.
193 ``user=zuul``
194
Joshua Heskethfe485c62015-08-11 23:42:34 +1000195.. _connection:
196
197connection ArbitraryName
198""""""""""""""""""""""""
199
200A connection can be listed with any arbitrary name. The required
201parameters are specified in the :ref:`connections` documentation
202depending on what driver you are using.
203
204.. _layoutyaml:
205
James E. Blaircdd00072012-06-08 19:17:28 -0700206layout.yaml
207~~~~~~~~~~~
208
Clark Boylan00635dc2012-09-19 14:03:08 -0700209This is the main configuration file for Zuul, where all of the pipelines
James E. Blaircdd00072012-06-08 19:17:28 -0700210and projects are defined, what tests should be run, and what actions
Clark Boylan00635dc2012-09-19 14:03:08 -0700211Zuul should perform. There are three sections: pipelines, jobs, and
James E. Blaircdd00072012-06-08 19:17:28 -0700212projects.
213
Clark Boylan00635dc2012-09-19 14:03:08 -0700214Pipelines
215"""""""""
James E. Blaircdd00072012-06-08 19:17:28 -0700216
Clark Boylan00635dc2012-09-19 14:03:08 -0700217Zuul can have any number of independent pipelines. Whenever a matching
218Gerrit event is found for a pipeline, that event is added to the
219pipeline, and the jobs specified for that pipeline are run. When all
220jobs specified for the pipeline that were triggered by an event are
221completed, Zuul reports back to Gerrit the results.
James E. Blaircdd00072012-06-08 19:17:28 -0700222
Clark Boylan00635dc2012-09-19 14:03:08 -0700223There are no pre-defined pipelines in Zuul, rather you can define
224whatever pipelines you need in the layout file. This is a very flexible
225system that can accommodate many kinds of workflows.
James E. Blaircdd00072012-06-08 19:17:28 -0700226
Clark Boylan00635dc2012-09-19 14:03:08 -0700227Here is a quick example of a pipeline definition followed by an
James E. Blaircdd00072012-06-08 19:17:28 -0700228explanation of each of the parameters::
229
230 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700231 manager: IndependentPipelineManager
Joshua Heskethfe485c62015-08-11 23:42:34 +1000232 source: my_gerrit
James E. Blaircdd00072012-06-08 19:17:28 -0700233 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000234 my_gerrit:
James E. Blair6c358e72013-07-29 17:06:47 -0700235 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700236 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000237 my_gerrit:
238 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700239 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000240 my_gerrit
241 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700242
243**name**
244 This is used later in the project definition to indicate what jobs
Clark Boylan00635dc2012-09-19 14:03:08 -0700245 should be run for events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700246
James E. Blair8dbd56a2012-12-22 10:55:10 -0800247**description**
248 This is an optional field that may be used to provide a textual
249 description of the pipeline.
250
James E. Blairc0dedf82014-08-06 09:37:52 -0700251**source**
Joshua Heskethfe485c62015-08-11 23:42:34 +1000252 A required field that specifies a connection that provides access to
253 the change objects that this pipeline operates on. The name of the
254 connection as per the zuul.conf should be specified. The driver used
255 for the connection named will be the source. Currently only ``gerrit``
256 drivers are supported.
James E. Blairc0dedf82014-08-06 09:37:52 -0700257
James E. Blair56370192013-01-14 15:47:28 -0800258**success-message**
259 An optional field that supplies the introductory text in message
260 reported back to Gerrit when all the voting builds are successful.
261 Defaults to "Build successful."
262
263**failure-message**
264 An optional field that supplies the introductory text in message
265 reported back to Gerrit when at least one voting build fails.
266 Defaults to "Build failed."
267
Joshua Heskethb7179772014-01-30 23:30:46 +1100268**merge-failure-message**
269 An optional field that supplies the introductory text in message
270 reported back to Gerrit when a change fails to merge with the
271 current state of the repository.
272 Defaults to "Merge failed."
273
Joshua Hesketh3979e3e2014-03-04 11:21:10 +1100274**footer-message**
275 An optional field to supply additional information after test results.
276 Useful for adding information about the CI system such as debugging
277 and contact details.
278
James E. Blaircdd00072012-06-08 19:17:28 -0700279**manager**
Clark Boylan00635dc2012-09-19 14:03:08 -0700280 There are currently two schemes for managing pipelines:
James E. Blaircdd00072012-06-08 19:17:28 -0700281
Clark Boylan00635dc2012-09-19 14:03:08 -0700282 *IndependentPipelineManager*
283 Every event in this pipeline should be treated as independent of
284 other events in the pipeline. This is appropriate when the order of
285 events in the pipeline doesn't matter because the results of the
286 actions this pipeline performs can not affect other events in the
287 pipeline. For example, when a change is first uploaded for review,
James E. Blaircdd00072012-06-08 19:17:28 -0700288 you may want to run tests on that change to provide early feedback
289 to reviewers. At the end of the tests, the change is not going to
290 be merged, so it is safe to run these tests in parallel without
Clark Boylan00635dc2012-09-19 14:03:08 -0700291 regard to any other changes in the pipeline. They are independent.
James E. Blaircdd00072012-06-08 19:17:28 -0700292
Clark Boylan00635dc2012-09-19 14:03:08 -0700293 Another type of pipeline that is independent is a post-merge
294 pipeline. In that case, the changes have already merged, so the
295 results can not affect any other events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700296
Clark Boylan00635dc2012-09-19 14:03:08 -0700297 *DependentPipelineManager*
298 The dependent pipeline manager is designed for gating. It ensures
James E. Blaircdd00072012-06-08 19:17:28 -0700299 that every change is tested exactly as it is going to be merged
300 into the repository. An ideal gating system would test one change
301 at a time, applied to the tip of the repository, and only if that
302 change passed tests would it be merged. Then the next change in
303 line would be tested the same way. In order to achieve parallel
Clark Boylan00635dc2012-09-19 14:03:08 -0700304 testing of changes, the dependent pipeline manager performs
James E. Blaircdd00072012-06-08 19:17:28 -0700305 speculative execution on changes. It orders changes based on
Clark Boylan00635dc2012-09-19 14:03:08 -0700306 their entry into the pipeline. It begins testing all changes in
307 parallel, assuming that each change ahead in the pipeline will pass
James E. Blaircdd00072012-06-08 19:17:28 -0700308 its tests. If they all succeed, all the changes can be tested and
Clark Boylan00635dc2012-09-19 14:03:08 -0700309 merged in parallel. If a change near the front of the pipeline
310 fails its tests, each change behind it ignores whatever tests have
311 been completed and are tested again without the change in front.
312 This way gate tests may run in parallel but still be tested
313 correctly, exactly as they will appear in the repository when
314 merged.
James E. Blaircdd00072012-06-08 19:17:28 -0700315
Clark Boylan00635dc2012-09-19 14:03:08 -0700316 One important characteristic of the DependentPipelineManager is that
James E. Blaircdd00072012-06-08 19:17:28 -0700317 it analyzes the jobs that are triggered by different projects, and
318 if those projects have jobs in common, it treats those projects as
319 related, and they share a single virtual queue of changes. Thus,
320 if there is a job that performs integration testing on two
321 projects, those two projects will automatically share a virtual
322 change queue. If a third project does not invoke that job, it
Clark Boylan00635dc2012-09-19 14:03:08 -0700323 will be part of a separate virtual change queue, and changes to
324 it will not depend on changes to the first two jobs.
James E. Blaircdd00072012-06-08 19:17:28 -0700325
326 For more detail on the theory and operation of Zuul's
Clark Boylan00635dc2012-09-19 14:03:08 -0700327 DependentPipelineManager, see: :doc:`gating`.
James E. Blaircdd00072012-06-08 19:17:28 -0700328
329**trigger**
James E. Blairc494d542014-08-06 09:23:52 -0700330 At least one trigger source must be supplied for each pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700331 Triggers are not exclusive -- matching events may be placed in
James E. Blair6c358e72013-07-29 17:06:47 -0700332 multiple pipelines, and they will behave independently in each of
Joshua Heskethfe485c62015-08-11 23:42:34 +1000333 the pipelines they match.
James E. Blaircdd00072012-06-08 19:17:28 -0700334
Joshua Heskethfe485c62015-08-11 23:42:34 +1000335 Triggers are loaded from their connection name. The driver type of
336 the connection will dictate which options are available.
337 See :doc:`triggers`.
James E. Blairc494d542014-08-06 09:23:52 -0700338
James E. Blair11041d22014-05-02 14:49:53 -0700339**require**
340 If this section is present, it established pre-requisites for any
341 kind of item entering the Pipeline. Regardless of how the item is
342 to be enqueued (via any trigger or automatic dependency resolution),
343 the conditions specified here must be met or the item will not be
344 enqueued.
345
Antoine Musso27ab0d52014-10-22 14:20:17 +0200346.. _pipeline-require-approval:
347
James E. Blair5bf78a32015-07-30 18:08:24 +0000348 **approval**
James E. Blair11041d22014-05-02 14:49:53 -0700349 This requires that a certain kind of approval be present for the
350 current patchset of the change (the approval could be added by the
351 event in question). It takes several sub-parameters, all of which
352 are optional and are combined together so that there must be an
353 approval matching all specified requirements.
354
355 *username*
James E. Blairb01ec542016-06-16 09:46:49 -0700356 If present, an approval from this username is required. It is
357 treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700358
James E. Blair1fbfceb2014-06-23 14:42:53 -0700359 *email*
James E. Blair11041d22014-05-02 14:49:53 -0700360 If present, an approval with this email address is required. It
James E. Blairb01ec542016-06-16 09:46:49 -0700361 is treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700362
James E. Blair1fbfceb2014-06-23 14:42:53 -0700363 *email-filter* (deprecated)
364 A deprecated alternate spelling of *email*. Only one of *email* or
365 *email_filter* should be used.
366
James E. Blair11041d22014-05-02 14:49:53 -0700367 *older-than*
368 If present, the approval must be older than this amount of time
369 to match. Provide a time interval as a number with a suffix of
370 "w" (weeks), "d" (days), "h" (hours), "m" (minutes), "s"
371 (seconds). Example ``48h`` or ``2d``.
372
373 *newer-than*
374 If present, the approval must be newer than this amount of time
375 to match. Same format as "older-than".
376
377 Any other field is interpreted as a review category and value
378 pair. For example ``verified: 1`` would require that the approval
James E. Blair9c17dbf2014-06-23 14:21:58 -0700379 be for a +1 vote in the "Verified" column. The value may either
380 be a single value or a list: ``verified: [1, 2]`` would match
381 either a +1 or +2 vote.
James E. Blair11041d22014-05-02 14:49:53 -0700382
383 **open**
384 A boolean value (``true`` or ``false``) that indicates whether the change
385 must be open or closed in order to be enqueued.
386
Clark Boylana9702ad2014-05-08 17:17:24 -0700387 **current-patchset**
388 A boolean value (``true`` or ``false``) that indicates whether the change
389 must be the current patchset in order to be enqueued.
390
James E. Blair11041d22014-05-02 14:49:53 -0700391 **status**
392 A string value that corresponds with the status of the change
393 reported by the trigger. For example, when using the Gerrit
394 trigger, status values such as ``NEW`` or ``MERGED`` may be useful.
James E. Blair63bb0ef2013-07-29 17:14:51 -0700395
Joshua Hesketh66c8e522014-06-26 15:30:08 +1000396**reject**
397 If this section is present, it establishes pre-requisites that can
398 block an item from being enqueued. It can be considered a negative
399 version of **require**.
400
401 **approval**
402 This takes a list of approvals. If an approval matches the provided
403 criteria the change can not be entered into the pipeline. It follows
404 the same syntax as the :ref:`"require approval" pipeline above
405 <pipeline-require-approval>`.
406
407 Example to reject a change with any negative vote::
408
409 reject:
410 approval:
411 - code-review: [-1, -2]
412
James E. Blair2fa50962013-01-30 21:50:41 -0800413**dequeue-on-new-patchset**
414 Normally, if a new patchset is uploaded to a change that is in a
415 pipeline, the existing entry in the pipeline will be removed (with
416 jobs canceled and any dependent changes that can no longer merge as
417 well. To suppress this behavior (and allow jobs to continue
418 running), set this to ``false``. Default: ``true``.
419
James E. Blair17dd6772015-02-09 14:45:18 -0800420**ignore-dependencies**
421 In any kind of pipeline (dependent or independent), Zuul will
422 attempt to enqueue all dependencies ahead of the current change so
423 that they are tested together (independent pipelines report the
424 results of each change regardless of the results of changes ahead).
425 To ignore dependencies completely in an independent pipeline, set
426 this to ``true``. This option is ignored by dependent pipelines.
427 The default is: ``false``.
428
James E. Blaircdd00072012-06-08 19:17:28 -0700429**success**
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000430 Describes where Zuul should report to if all the jobs complete
431 successfully.
James E. Blaircdd00072012-06-08 19:17:28 -0700432 This section is optional; if it is omitted, Zuul will run jobs and
433 do nothing on success; it will not even report a message to Gerrit.
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000434 If the section is present, the listed reporter plugins will be
435 asked to report on the jobs.
Joshua Heskethfe485c62015-08-11 23:42:34 +1000436 The reporters are listed by their connection name. The options
437 available depend on the driver for the supplied connection.
438 See :doc:`reporters` for more details.
James E. Blaircdd00072012-06-08 19:17:28 -0700439
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400440**failure**
James E. Blaircdd00072012-06-08 19:17:28 -0700441 Uses the same syntax as **success**, but describes what Zuul should
442 do if at least one job fails.
James E. Blairdc253862012-06-13 17:12:42 -0700443
Joshua Heskethb7179772014-01-30 23:30:46 +1100444**merge-failure**
445 Uses the same syntax as **success**, but describes what Zuul should
446 do if it is unable to merge in the patchset. If no merge-failure
447 reporters are listed then the ``failure`` reporters will be used to
448 notify of unsuccessful merges.
449
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400450**start**
James E. Blairdc253862012-06-13 17:12:42 -0700451 Uses the same syntax as **success**, but describes what Zuul should
Clark Boylan00635dc2012-09-19 14:03:08 -0700452 do when a change is added to the pipeline manager. This can be used,
James E. Blairdc253862012-06-13 17:12:42 -0700453 for example, to reset the value of the Verified review category.
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400454
Joshua Hesketh89e829d2015-02-10 16:29:45 +1100455**disabled**
456 Uses the same syntax as **success**, but describes what Zuul should
457 do when a pipeline is disabled.
458 See ``disable-after-consecutive-failures``.
459
460**disable-after-consecutive-failures**
461 If set, a pipeline can enter a ''disabled'' state if too many changes
462 in a row fail. When this value is exceeded the pipeline will stop
463 reporting to any of the ``success``, ``failure`` or ``merge-failure``
464 reporters and instead only report to the ``disabled`` reporters.
465 (No ``start`` reports are made when a pipeline is disabled).
466
James E. Blair64ed6f22013-07-10 14:07:23 -0700467**precedence**
468 Indicates how the build scheduler should prioritize jobs for
469 different pipelines. Each pipeline may have one precedence, jobs
470 for pipelines with a higher precedence will be run before ones with
471 lower. The value should be one of ``high``, ``normal``, or ``low``.
472 Default: ``normal``.
473
Clark Boylanc2d19e42014-01-23 14:08:58 -0800474**window**
475 DependentPipelineManagers only. Zuul can rate limit
476 DependentPipelineManagers in a manner similar to TCP flow control.
477 Jobs are only started for changes in the queue if they sit in the
478 actionable window for the pipeline. The initial length of this window
479 is configurable with this value. The value given should be a positive
480 integer value. A value of ``0`` disables rate limiting on the
481 DependentPipelineManager.
482 Default: ``20``.
483
484**window-floor**
485 DependentPipelineManagers only. This is the minimum value for the
486 window described above. Should be a positive non zero integer value.
487 Default: ``3``.
488
489**window-increase-type**
490 DependentPipelineManagers only. This value describes how the window
491 should grow when changes are successfully merged by zuul. A value of
492 ``linear`` indicates that ``window-increase-factor`` should be added
493 to the previous window value. A value of ``exponential`` indicates
494 that ``window-increase-factor`` should be multiplied against the
495 previous window value and the result will become the window size.
496 Default: ``linear``.
497
498**window-increase-factor**
Clint Adams041ae512015-06-16 20:02:29 -0400499 DependentPipelineManagers only. The value to be added or multiplied
Clark Boylanc2d19e42014-01-23 14:08:58 -0800500 against the previous window value to determine the new window after
501 successful change merges.
502 Default: ``1``.
503
504**window-decrease-type**
505 DependentPipelineManagers only. This value describes how the window
506 should shrink when changes are not able to be merged by Zuul. A value
507 of ``linear`` indicates that ``window-decrease-factor`` should be
508 subtracted from the previous window value. A value of ``exponential``
509 indicates that ``window-decrease-factor`` should be divided against
510 the previous window value and the result will become the window size.
511 Default: ``exponential``.
512
513**window-decrease-factor**
514 DependentPipelineManagers only. The value to be subtracted or divided
515 against the previous window value to determine the new window after
516 unsuccessful change merges.
517 Default: ``2``.
518
Clark Boylan00635dc2012-09-19 14:03:08 -0700519Some example pipeline configurations are included in the sample layout
520file. The first is called a *check* pipeline::
James E. Blaircdd00072012-06-08 19:17:28 -0700521
522 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700523 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700524 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000525 my_gerrit:
526 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700527 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000528 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000529 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700530 failure:
Thomas Bechtolda8c0dbd2015-12-10 07:16:54 +0100531 my_gerrit:
532 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700533
534This will trigger jobs each time a new patchset (or change) is
535uploaded to Gerrit, and report +/-1 values to Gerrit in the
536``verified`` review category. ::
537
538 - name: gate
Clark Boylan00635dc2012-09-19 14:03:08 -0700539 manager: DependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700540 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000541 my_gerrit:
542 - event: comment-added
543 approval:
544 - approved: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700545 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000546 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000547 verified: 2
548 submit: true
James E. Blaircdd00072012-06-08 19:17:28 -0700549 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000550 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000551 verified: -2
James E. Blaircdd00072012-06-08 19:17:28 -0700552
553This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the
554``approved`` review category in Gerrit (a non-standard category).
555Changes will be tested in such a way as to guarantee that they will be
556merged exactly as tested, though that will happen in parallel by
557creating a virtual queue of dependent changes and performing
558speculative execution of jobs. ::
559
560 - name: post
Clark Boylan00635dc2012-09-19 14:03:08 -0700561 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700562 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000563 my_gerrit:
564 - event: ref-updated
565 ref: ^(?!refs/).*$
James E. Blaircdd00072012-06-08 19:17:28 -0700566
567This will trigger jobs whenever a change is merged to a named branch
568(e.g., ``master``). No output will be reported to Gerrit. This is
569useful for side effects such as creating per-commit tarballs. ::
570
571 - name: silent
Clark Boylan00635dc2012-09-19 14:03:08 -0700572 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700573 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000574 my_gerrit:
575 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700576
577This also triggers jobs when changes are uploaded to Gerrit, but no
578results are reported to Gerrit. This is useful for jobs that are in
Antoine Mussoce333842012-10-16 14:42:35 +0200579development and not yet ready to be presented to developers. ::
580
581 pipelines:
582 - name: post-merge
583 manager: IndependentPipelineManager
584 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000585 my_gerrit:
586 - event: change-merged
Antoine Mussoce333842012-10-16 14:42:35 +0200587 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000588 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000589 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200590 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000591 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000592 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200593
594The ``change-merged`` events happen when a change has been merged in the git
595repository. The change is thus closed and Gerrit will not accept modifications
596to the review scoring such as ``code-review`` or ``verified``. By using the
597``force-message: True`` parameter, Zuul will pass ``--force-message`` to the
598``gerrit review`` command, thus making sure the message is actually
599sent back to Gerrit regardless of approval scores.
600That kind of pipeline is nice to run regression or performance tests.
601
602.. note::
603 The ``change-merged`` event does not include the commit sha1 which can be
604 hazardous, it would let you report back to Gerrit though. If you were to
Michael Prokop526926a2013-10-24 16:16:57 +0200605 build a tarball for a specific commit, you should consider instead using
Łukasz Jernaś048acb42014-03-02 18:49:41 +0100606 the ``ref-updated`` event which does include the commit sha1 (but lacks the
Antoine Mussoce333842012-10-16 14:42:35 +0200607 Gerrit change number).
James E. Blaircdd00072012-06-08 19:17:28 -0700608
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100609
610.. _jobs:
611
James E. Blaircdd00072012-06-08 19:17:28 -0700612Jobs
613""""
614
615The jobs section is optional, and can be used to set attributes of
616jobs that are independent of their association with a project. For
617example, if a job should return a customized message on failure, that
618may be specified here. Otherwise, Zuul does not need to be told about
619each job as it builds a list from the project specification.
620
621**name**
622 The name of the job. This field is treated as a regular expression
623 and will be applied to each job that matches.
624
James E. Blairc8a1e052014-02-25 09:29:26 -0800625**queue-name (optional)**
626 Zuul will automatically combine projects that share a job into
627 shared change queues for dependent pipeline managers. In order to
628 report statistics about these queues, it is convenient for them to
629 have names. Zuul can automatically name change queues, however
630 these can grow quite long and are prone to changing as projects in
631 the queue change. If you assign a queue-name to a job, Zuul will
632 use that as the name for the shared change queue that contains that
633 job instead of the automatically generated one. It is an error for
634 a shared change queue to have more than one job with a queue-name if
635 they are not the same.
636
James E. Blaire5a847f2012-07-10 15:29:14 -0700637**failure-message (optional)**
638 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700639
James E. Blaire5a847f2012-07-10 15:29:14 -0700640**success-message (optional)**
641 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700642
James E. Blair6aea36d2012-12-17 13:03:24 -0800643**failure-pattern (optional)**
644 The URL that should be reported to Gerrit if the job fails.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700645 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800646 zuul.conf. May be supplied as a string pattern with substitutions
647 as described in url_pattern in :ref:`zuulconf`.
648
649**success-pattern (optional)**
650 The URL that should be reported to Gerrit if the job succeeds.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700651 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800652 zuul.conf. May be supplied as a string pattern with substitutions
653 as described in url_pattern in :ref:`zuulconf`.
654
James E. Blair222d4982012-07-16 09:31:19 -0700655**hold-following-changes (optional)**
656 This is a boolean that indicates that changes that follow this
Clark Boylan00635dc2012-09-19 14:03:08 -0700657 change in a dependent change pipeline should wait until this job
Paul Belanger174a8272017-03-14 13:20:10 -0400658 succeeds before executing. If this is applied to a very short job
James E. Blair222d4982012-07-16 09:31:19 -0700659 that can predict whether longer jobs will fail early, this can be
Paul Belanger174a8272017-03-14 13:20:10 -0400660 used to reduce the number of jobs that Zuul will execute and
James E. Blair222d4982012-07-16 09:31:19 -0700661 ultimately have to cancel. In that case, a small amount of
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400662 parallelization of jobs is traded for more efficient use of testing
James E. Blair222d4982012-07-16 09:31:19 -0700663 resources. On the other hand, to apply this to a long running job
664 would largely defeat the parallelization of dependent change testing
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400665 that is the main feature of Zuul. Default: ``false``.
James E. Blair222d4982012-07-16 09:31:19 -0700666
Tobias Henkel9a0e1942017-03-20 16:16:02 +0100667**semaphore (optional)**
668 This is a string that names a semaphore that should be observed by this
669 job. The semaphore defines how many jobs which reference that semaphore
670 can be enqueued at a time. This applies across all pipelines in the same
671 tenant. The max value of the semaphore can be specified in the config
672 repositories and defaults to 1.
James E. Blairaf17a972016-02-03 15:07:18 -0800673
James E. Blaire5a847f2012-07-10 15:29:14 -0700674**branch (optional)**
James E. Blaircdd00072012-06-08 19:17:28 -0700675 This job should only be run on matching branches. This field is
676 treated as a regular expression and multiple branches may be
677 listed.
678
James E. Blair70c71582013-03-06 08:50:50 -0800679**files (optional)**
680 This job should only be run if at least one of the files involved in
681 the change (added, deleted, or modified) matches at least one of the
682 file patterns listed here. This field is treated as a regular
683 expression and multiple expressions may be listed.
684
Maru Newby3fe5f852015-01-13 04:22:14 +0000685**skip-if (optional)**
686
687 This job should not be run if all the patterns specified by the
688 optional fields listed below match on their targets. When multiple
689 sets of parameters are provided, this job will be skipped if any set
690 matches. For example: ::
691
692 jobs:
693 - name: check-tempest-dsvm-neutron
694 skip-if:
695 - project: ^openstack/neutron$
696 branch: ^stable/juno$
697 all-files-match-any:
698 - ^neutron/tests/.*$
699 - ^tools/.*$
700 - all-files-match-any:
701 - ^doc/.*$
702 - ^.*\.rst$
703
704 With this configuration, the job would be skipped for a neutron
705 patchset for the stable/juno branch provided that every file in the
706 change matched at least one of the specified file regexes. The job
707 will also be skipped for any patchset that modified only the doc
708 tree or rst files.
709
710 *project* (optional)
711 The regular expression to match against the project of the change.
712
713 *branch* (optional)
714 The regular expression to match against the branch or ref of the
715 change.
716
717 *all-files-match-any* (optional)
718 A list of regular expressions intended to match the files involved
719 in the change. This parameter will be considered matching a
720 change only if all files in a change match at least one of these
721 expressions.
722
723 The pattern for '/COMMIT_MSG' is always matched on and does not
Alexander Evseevdbe6fab2015-11-19 12:46:34 +0300724 have to be included. Exception is merge commits (without modified
725 files), in this case '/COMMIT_MSG' is not matched, and job is not
726 skipped. In case of merge commits it's assumed that list of modified
727 files isn't predictible and CI should be run.
Maru Newby3fe5f852015-01-13 04:22:14 +0000728
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400729**voting (optional)**
730 Boolean value (``true`` or ``false``) that indicates whatever
731 a job is voting or not. Default: ``true``.
732
Paul Belanger71d98172016-11-08 10:56:31 -0500733**attempts (optional)**
Paul Belanger174a8272017-03-14 13:20:10 -0400734 Number of attempts zuul will execute a job. Once reached, zuul will report
Paul Belanger71d98172016-11-08 10:56:31 -0500735 RETRY_LIMIT as the job result.
736 Defaults to 3.
737
James E. Blair456f2fb2016-02-09 09:29:33 -0800738**tags (optional)**
739 A list of arbitrary strings which will be associated with the job.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700740
James E. Blaircdd00072012-06-08 19:17:28 -0700741Here is an example of setting the failure message for jobs that check
742whether a change merges cleanly::
743
744 - name: ^.*-merge$
Jeremy Stanley1c2c3c22015-06-15 21:23:19 +0000745 failure-message: This change or one of its cross-repo dependencies
746 was unable to be automatically merged with the current state of
747 its repository. Please rebase the change and upload a new
748 patchset.
James E. Blaircdd00072012-06-08 19:17:28 -0700749
750Projects
751""""""""
752
Clark Boylan00635dc2012-09-19 14:03:08 -0700753The projects section indicates what jobs should be run in each pipeline
James E. Blaircdd00072012-06-08 19:17:28 -0700754for events associated with each project. It contains a list of
755projects. Here is an example::
756
757 - name: example/project
758 check:
759 - project-merge:
760 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700761 - project-pep8
762 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700763 gate:
764 - project-merge:
765 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700766 - project-pep8
767 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700768 post:
769 - project-publish
770
771**name**
772 The name of the project (as known by Gerrit).
773
James E. Blair19deff22013-08-25 13:17:35 -0700774**merge-mode (optional)**
775 An optional value that indicates what strategy should be used to
776 merge changes to this project. Supported values are:
777
778 ** merge-resolve **
779 Equivalent to 'git merge -s resolve'. This corresponds closely to
780 what Gerrit performs (using JGit) for a project if the "Merge if
781 necessary" merge mode is selected and "Automatically resolve
782 conflicts" is checked. This is the default.
783
784 ** merge **
785 Equivalent to 'git merge'.
786
787 ** cherry-pick **
788 Equivalent to 'git cherry-pick'.
789
Clark Boylan00635dc2012-09-19 14:03:08 -0700790This is followed by a section for each of the pipelines defined above.
791Pipelines may be omitted if no jobs should run for this project in a
792given pipeline. Within the pipeline section, the jobs that should be
James E. Blaircdd00072012-06-08 19:17:28 -0700793executed are listed. If a job is entered as a dictionary key, then
794jobs contained within that key are only executed if the key job
795succeeds. In the above example, project-unittest, project-pep8, and
Fredrik Medleyf8aec832015-09-28 13:40:20 +0200796project-pyflakes are only executed if project-merge succeeds.
797Furthermore, project-finaltest is executed only if project-unittest,
798project-pep8 and project-pyflakes all succeed. This can help avoid
799running unnecessary jobs while maximizing parallelism. It is also
800useful when distributing results between jobs.
James E. Blaircdd00072012-06-08 19:17:28 -0700801
James E. Blair18c64442014-03-18 10:14:45 -0700802The special job named ``noop`` is internal to Zuul and will always
803return ``SUCCESS`` immediately. This can be useful if you require
804that all changes be processed by a pipeline but a project has no jobs
805that can be run on it.
806
Andreas Jaegerbcfbf932014-09-29 20:21:44 +0200807.. seealso:: The OpenStack Zuul configuration for a comprehensive example: https://git.openstack.org/cgit/openstack-infra/project-config/tree/zuul/layout.yaml
James E. Blaircdd00072012-06-08 19:17:28 -0700808
Antoine Musso80edd5a2013-02-13 15:37:53 +0100809Project Templates
810"""""""""""""""""
811
Michael Prokop526926a2013-10-24 16:16:57 +0200812Whenever you have lot of similar projects (such as plugins for a project) you
Antoine Musso80edd5a2013-02-13 15:37:53 +0100813will most probably want to use the same pipeline configurations. The
814project templates let you define pipelines and job name templates to trigger.
815One can then just apply the template on its project which make it easier to
Michael Prokop526926a2013-10-24 16:16:57 +0200816update several similar projects. As an example::
Antoine Musso80edd5a2013-02-13 15:37:53 +0100817
818 project-templates:
819 # Name of the template
820 - name: plugin-triggering
821 # Definition of pipelines just like for a `project`
822 check:
823 - '{jobprefix}-merge':
824 - '{jobprefix}-pep8'
825 - '{jobprefix}-pyflakes'
826 gate:
827 - '{jobprefix}-merge':
828 - '{jobprefix}-unittest'
829 - '{jobprefix}-pep8'
830 - '{jobprefix}-pyflakes'
831
832In your projects definition, you will then apply the template using the template
833key::
834
835 projects:
836 - name: plugin/foobar
837 template:
838 - name: plugin-triggering
839 jobprefix: plugin-foobar
840
James E. Blairaea6cf62013-12-16 15:38:12 -0800841You can pass several parameters to a template. A ``parameter`` value
842will be used for expansion of ``{parameter}`` in the template
843strings. The parameter ``name`` will be automatically provided and
844will contain the short name of the project, that is the portion of the
845project name after the last ``/`` character.
James E. Blaircdd00072012-06-08 19:17:28 -0700846
James E. Blair3e98c022013-12-16 15:25:38 -0800847Multiple templates can be combined in a project, and the jobs from all
848of those templates will be added to the project. Individual jobs may
849also be added::
850
851 projects:
852 - name: plugin/foobar
853 template:
854 - name: plugin-triggering
855 jobprefix: plugin-foobar
856 - name: plugin-extras
857 jobprefix: plugin-foobar
858 check:
859 - foobar-extra-special-job
860
Steven Dake21ef9ad2014-08-25 23:08:14 -0700861Individual jobs may optionally be added to pipelines (e.g. check,
Atsushi SAKAI5d7e93b2015-07-28 22:15:48 +0900862gate, et cetera) for a project, in addition to those provided by
Steven Dake21ef9ad2014-08-25 23:08:14 -0700863templates.
864
James E. Blair3e98c022013-12-16 15:25:38 -0800865The order of the jobs listed in the project (which only affects the
866order of jobs listed on the report) will be the jobs from each
867template in the order listed, followed by any jobs individually listed
868for the project.
869
870Note that if multiple templates are used for a project and one
871template specifies a job that is also specified in another template,
James E. Blair12a92b12014-03-26 11:54:53 -0700872or specified in the project itself, the configuration defined by
873either the last template or the project itself will take priority.
James E. Blair3e98c022013-12-16 15:25:38 -0800874
Tobias Henkel9a0e1942017-03-20 16:16:02 +0100875
876Semaphores
877""""""""""
878
879When using semaphores the maximum value of each one can be specified in their
880respective config repositories. Unspecified semaphores default to 1::
881
882 - semaphore:
883 name: semaphore-foo
884 max: 5
885 - semaphore:
886 name: semaphore-bar
887 max: 3
888
889
James E. Blaircdd00072012-06-08 19:17:28 -0700890logging.conf
891~~~~~~~~~~~~
892This file is optional. If provided, it should be a standard
893:mod:`logging.config` module configuration file. If not present, Zuul will
894output all log messages of DEBUG level or higher to the console.
895
896Starting Zuul
897-------------
898
899To start Zuul, run **zuul-server**::
900
Antoine Mussob3aa8282013-04-19 15:16:59 +0200901 usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version]
James E. Blaircdd00072012-06-08 19:17:28 -0700902
903 Project gating system.
904
905 optional arguments:
906 -h, --help show this help message and exit
907 -c CONFIG specify the config file
Antoine Mussob3aa8282013-04-19 15:16:59 +0200908 -l LAYOUT specify the layout file
James E. Blaircdd00072012-06-08 19:17:28 -0700909 -d do not run as a daemon
Antoine Mussob3aa8282013-04-19 15:16:59 +0200910 -t validate layout file syntax
911 --version show zuul version
James E. Blaircdd00072012-06-08 19:17:28 -0700912
913You may want to use the ``-d`` argument while you are initially setting
914up Zuul so you can detect any configuration errors quickly. Under
915normal operation, omit ``-d`` and let Zuul run as a daemon.
916
917If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will
918stop executing new jobs, wait until all executing jobs are finished,
Joshua Heskethc4997152016-02-17 21:04:18 +1100919reload its layout.yaml, and resume. Changes to any connections or
920the PID file will be ignored until Zuul is restarted.
Clark Boylanf231fa22013-02-08 12:28:53 -0800921
922If you send a SIGUSR1 to the zuul-server process, Zuul will stop
923executing new jobs, wait until all executing jobs are finished,
924then exit. While waiting to exit Zuul will queue Gerrit events and
925save these events prior to exiting. When Zuul starts again it will
926read these saved events and act on them.
Jeremy Stanley93e05f42013-03-08 17:29:17 +0000927
Michael Prokop526926a2013-10-24 16:16:57 +0200928If you need to abort Zuul and intend to manually requeue changes for
Jeremy Stanley93e05f42013-03-08 17:29:17 +0000929jobs which were running in its pipelines, prior to terminating you can
930use the zuul-changes.py tool script to simplify the process. For
Ramy Asselindda8e6a2015-03-31 14:59:39 -0700931example, this would give you a list of zuul-enqueue commands to requeue
932changes for the gate and check pipelines respectively::
Jeremy Stanley93e05f42013-03-08 17:29:17 +0000933
Ramy Asselindda8e6a2015-03-31 14:59:39 -0700934 ./tools/zuul-changes.py http://zuul.openstack.org/ gate
935 ./tools/zuul-changes.py http://zuul.openstack.org/ check
Clark Boylanfba9b242013-08-20 10:11:17 -0700936
Antoine Musso29eab012014-10-28 21:35:22 +0100937If you send a SIGUSR2 to the zuul-server process, or the forked process
938that runs the Gearman daemon, Zuul will dump a stack trace for each
939running thread into its debug log. It is written under the log bucket
940``zuul.stack_dump``. This is useful for tracking down deadlock or
941otherwise slow threads.
Antoine Mussod0f06262014-06-04 09:54:24 +0200942
943When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python
944Profiler) is available, additional functions' and threads' stats are
945emitted as well. The first SIGUSR2 will enable yappi, on the second
946SIGUSR2 it dumps the information collected, resets all yappi state and
947stops profiling. This is to minimize the impact of yappi on a running
948system.