James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 1 | :title: Zuul |
| 2 | |
| 3 | Zuul |
| 4 | ==== |
| 5 | |
| 6 | Configuration |
| 7 | ------------- |
| 8 | |
| 9 | Zuul has three configuration files: |
| 10 | |
| 11 | **zuul.conf** |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 12 | Connection information for Gerrit and Gearman, locations of the |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 13 | other config files. (required) |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 14 | **layout.yaml** |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 15 | Project and pipeline configuration -- what Zuul does. (required) |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 16 | **logging.conf** |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 17 | Python logging config. (optional) |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 18 | |
| 19 | Examples of each of the three files can be found in the etc/ directory |
| 20 | of the source distribution. |
| 21 | |
James E. Blair | 6aea36d | 2012-12-17 13:03:24 -0800 | [diff] [blame] | 22 | .. _zuulconf: |
| 23 | |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 24 | zuul.conf |
| 25 | ~~~~~~~~~ |
| 26 | |
| 27 | Zuul will look for ``/etc/zuul/zuul.conf`` or ``~/zuul.conf`` to |
| 28 | bootstrap its configuration. Alternately, you may specify ``-c |
| 29 | /path/to/zuul.conf`` on the command line. |
| 30 | |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 31 | Gerrit and Gearman connection information are each described in a |
| 32 | section of zuul.conf. The location of the other two configuration |
| 33 | files (as well as the location of the PID file when running Zuul as a |
| 34 | server) are specified in a third section. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 35 | |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 36 | The three sections of this config and their options are documented below. |
| 37 | You can also find an example zuul.conf file in the git |
| 38 | `repository |
Andreas Jaeger | bcfbf93 | 2014-09-29 20:21:44 +0200 | [diff] [blame] | 39 | <https://git.openstack.org/cgit/openstack-infra/zuul/tree/etc/zuul.conf-sample>`_ |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 40 | |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 41 | gearman |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 42 | """"""" |
| 43 | |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 44 | Client connection information for gearman. If using Zuul's builtin gearmand |
| 45 | server just set **server** to 127.0.0.1. |
| 46 | |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 47 | **server** |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 48 | Hostname or IP address of the Gearman server. |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 49 | ``server=gearman.example.com`` (required) |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 50 | |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 51 | **port** |
Łukasz Jernaś | 048acb4 | 2014-03-02 18:49:41 +0100 | [diff] [blame] | 52 | Port on which the Gearman server is listening. |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 53 | ``port=4730`` (optional) |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 54 | |
Paul Belanger | 9208dc1 | 2016-06-08 16:43:55 -0400 | [diff] [blame] | 55 | **check_job_registration** |
| 56 | Check to see if job is registered with Gearman or not. When True |
| 57 | a build result of NOT_REGISTERED will be return if job is not found. |
| 58 | ``check_job_registration=True`` |
| 59 | |
James E. Blair | 77cc7b8 | 2013-07-15 13:22:37 -0700 | [diff] [blame] | 60 | gearman_server |
| 61 | """""""""""""" |
| 62 | |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 63 | The builtin gearman server. Zuul can fork a gearman process from itself rather |
| 64 | than connecting to an external one. |
| 65 | |
James E. Blair | 77cc7b8 | 2013-07-15 13:22:37 -0700 | [diff] [blame] | 66 | **start** |
| 67 | Whether to start the internal Gearman server (default: False). |
| 68 | ``start=true`` |
| 69 | |
James E. Blair | 0ac452e | 2015-07-22 09:05:16 -0700 | [diff] [blame] | 70 | **listen_address** |
| 71 | IP address or domain name on which to listen (default: all addresses). |
| 72 | ``listen_address=127.0.0.1`` |
| 73 | |
James E. Blair | 77cc7b8 | 2013-07-15 13:22:37 -0700 | [diff] [blame] | 74 | **log_config** |
| 75 | Path to log config file for internal Gearman server. |
| 76 | ``log_config=/etc/zuul/gearman-logging.yaml`` |
| 77 | |
Paul Belanger | 88ef0ea | 2015-12-23 11:57:02 -0500 | [diff] [blame] | 78 | webapp |
| 79 | """""" |
| 80 | |
| 81 | **listen_address** |
| 82 | IP address or domain name on which to listen (default: 0.0.0.0). |
| 83 | ``listen_address=127.0.0.1`` |
| 84 | |
| 85 | **port** |
| 86 | Port on which the webapp is listening (default: 8001). |
| 87 | ``port=8008`` |
| 88 | |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 89 | zuul |
| 90 | """" |
| 91 | |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 92 | Zuul's main configuration section. At minimum zuul must be able to find |
| 93 | layout.yaml to be useful. |
| 94 | |
| 95 | .. note:: Must be provided when running zuul-server |
| 96 | |
Antoine Musso | 9adc6d4 | 2014-11-14 15:37:48 +0100 | [diff] [blame] | 97 | .. _layout_config: |
| 98 | |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 99 | **layout_config** |
James E. Blair | 4076e2b | 2014-01-28 12:42:20 -0800 | [diff] [blame] | 100 | Path to layout config file. Used by zuul-server only. |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 101 | ``layout_config=/etc/zuul/layout.yaml`` |
| 102 | |
| 103 | **log_config** |
James E. Blair | a443013 | 2014-02-17 08:32:07 -0800 | [diff] [blame] | 104 | Path to log config file. Used by zuul-server only. |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 105 | ``log_config=/etc/zuul/logging.yaml`` |
| 106 | |
| 107 | **pidfile** |
James E. Blair | a443013 | 2014-02-17 08:32:07 -0800 | [diff] [blame] | 108 | Path to PID lock file. Used by zuul-server only. |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 109 | ``pidfile=/var/run/zuul/zuul.pid`` |
| 110 | |
| 111 | **state_dir** |
James E. Blair | 4076e2b | 2014-01-28 12:42:20 -0800 | [diff] [blame] | 112 | Path to directory that Zuul should save state to. Used by all Zuul |
| 113 | commands. |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 114 | ``state_dir=/var/lib/zuul`` |
| 115 | |
James E. Blair | 4076e2b | 2014-01-28 12:42:20 -0800 | [diff] [blame] | 116 | **report_times** |
| 117 | Boolean value (``true`` or ``false``) that determines if Zuul should |
| 118 | include elapsed times for each job in the textual report. Used by |
| 119 | zuul-server only. |
| 120 | ``report_times=true`` |
| 121 | |
| 122 | **status_url** |
| 123 | URL that will be posted in Zuul comments made to Gerrit changes when |
| 124 | starting jobs for a change. Used by zuul-server only. |
| 125 | ``status_url=https://zuul.example.com/status`` |
| 126 | |
Clark Boylan | e0b4bdb | 2014-06-03 17:01:25 -0700 | [diff] [blame] | 127 | **status_expiry** |
| 128 | Zuul will cache the status.json file for this many seconds. This is an |
| 129 | optional value and ``1`` is used by default. |
| 130 | ``status_expiry=1`` |
| 131 | |
James E. Blair | 4076e2b | 2014-01-28 12:42:20 -0800 | [diff] [blame] | 132 | **url_pattern** |
| 133 | If you are storing build logs external to the system that originally |
| 134 | ran jobs and wish to link to those logs when Zuul makes comments on |
| 135 | Gerrit changes for completed jobs this setting configures what the |
| 136 | URLs for those links should be. Used by zuul-server only. |
| 137 | ``http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}`` |
| 138 | |
| 139 | **job_name_in_report** |
| 140 | Boolean value (``true`` or ``false``) that indicates whether the |
| 141 | job name should be included in the report (normally only the URL |
| 142 | is included). Defaults to ``false``. Used by zuul-server only. |
| 143 | ``job_name_in_report=true`` |
| 144 | |
| 145 | merger |
| 146 | """""" |
| 147 | |
Thanh Ha | 266cbb8 | 2016-01-24 20:57:59 -0500 | [diff] [blame] | 148 | The zuul-merger process configuration. Detailed documentation on this process |
| 149 | can be found on the :doc:`merger` page. |
| 150 | |
| 151 | .. note:: Must be provided when running zuul-merger. Both services may share the |
| 152 | same configuration (and even host) or otherwise have an individual |
| 153 | zuul.conf. |
| 154 | |
Clark Boylan | 9b67090 | 2012-09-28 13:47:56 -0700 | [diff] [blame] | 155 | **git_dir** |
| 156 | Directory that Zuul should clone local git repositories to. |
| 157 | ``git_dir=/var/lib/zuul/git`` |
| 158 | |
Paul Belanger | b67aba1 | 2013-05-13 19:22:14 -0400 | [diff] [blame] | 159 | **git_user_email** |
| 160 | Optional: Value to pass to `git config user.email`. |
| 161 | ``git_user_email=zuul@example.com`` |
| 162 | |
| 163 | **git_user_name** |
| 164 | Optional: Value to pass to `git config user.name`. |
| 165 | ``git_user_name=zuul`` |
| 166 | |
Arx Cruz | b1b010d | 2013-10-28 19:49:59 -0200 | [diff] [blame] | 167 | **zuul_url** |
James E. Blair | 4076e2b | 2014-01-28 12:42:20 -0800 | [diff] [blame] | 168 | URL of this merger's git repos, accessible to test workers. Usually |
| 169 | "http://zuul.example.com/p" or "http://zuul-merger01.example.com/p" |
| 170 | depending on whether the merger is co-located with the Zuul server. |
Arx Cruz | b1b010d | 2013-10-28 19:49:59 -0200 | [diff] [blame] | 171 | |
James E. Blair | a443013 | 2014-02-17 08:32:07 -0800 | [diff] [blame] | 172 | **log_config** |
| 173 | Path to log config file for the merger process. |
| 174 | ``log_config=/etc/zuul/logging.yaml`` |
| 175 | |
| 176 | **pidfile** |
| 177 | Path to PID lock file for the merger process. |
| 178 | ``pidfile=/var/run/zuul-merger/merger.pid`` |
| 179 | |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 180 | .. _swift: |
| 181 | |
| 182 | swift |
| 183 | """"" |
| 184 | |
| 185 | To send (optional) swift upload instructions this section must be |
Antoine Musso | 62fa2d4 | 2014-06-04 22:55:23 +0200 | [diff] [blame] | 186 | present. Multiple destinations can be defined in the :ref:`jobs` section |
| 187 | of the layout. |
| 188 | |
| 189 | If you are sending the temp-url-key or fetching the x-storage-url, you |
| 190 | will need the python-swiftclient module installed. |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 191 | |
Joshua Hesketh | c496750 | 2014-05-15 06:39:14 -0700 | [diff] [blame] | 192 | **X-Account-Meta-Temp-Url-Key** (optional) |
| 193 | This is the key used to sign the HMAC message. If you do not set a |
| 194 | key Zuul will generate one automatically. |
| 195 | |
| 196 | **Send-Temp-Url-Key** (optional) |
| 197 | Zuul can send the X-Account-Meta-Temp-Url-Key to swift for you if |
| 198 | you have set up the appropriate credentials in ``authurl`` below. |
| 199 | This isn't necessary if you know and have set your |
| 200 | X-Account-Meta-Temp-Url-Key. |
Antoine Musso | 62fa2d4 | 2014-06-04 22:55:23 +0200 | [diff] [blame] | 201 | If set, Zuul requires the python-swiftclient module. |
Joshua Hesketh | c496750 | 2014-05-15 06:39:14 -0700 | [diff] [blame] | 202 | ``default: true`` |
| 203 | |
| 204 | **X-Storage-Url** (optional) |
| 205 | The storage URL is the destination to upload files into. If you do |
| 206 | not set this the ``authurl`` credentials are used to fetch the url |
Antoine Musso | 62fa2d4 | 2014-06-04 22:55:23 +0200 | [diff] [blame] | 207 | from swift and Zuul will requires the python-swiftclient module. |
Joshua Hesketh | c496750 | 2014-05-15 06:39:14 -0700 | [diff] [blame] | 208 | |
| 209 | **authurl** (optional) |
| 210 | The (keystone) Auth URL for swift. |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 211 | ``For example, https://identity.api.rackspacecloud.com/v2.0/`` |
Joshua Hesketh | c496750 | 2014-05-15 06:39:14 -0700 | [diff] [blame] | 212 | This is required if you have Send-Temp-Url-Key set to ``True`` or |
| 213 | if you have not supplied the X-Storage-Url. |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 214 | |
| 215 | Any of the `swiftclient connection parameters`_ can also be defined |
| 216 | here by the same name. Including the os_options by their key name ( |
| 217 | ``for example tenant_id``) |
| 218 | |
| 219 | .. _swiftclient connection parameters: http://docs.openstack.org/developer/python-swiftclient/swiftclient.html#module-swiftclient.client |
| 220 | |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 221 | **region_name** (optional) |
| 222 | The region name holding the swift container |
| 223 | ``For example, SYD`` |
| 224 | |
| 225 | Each destination defined by the :ref:`jobs` will have the following |
| 226 | default values that it may overwrite. |
| 227 | |
| 228 | **default_container** (optional) |
| 229 | Container name to place the log into |
| 230 | ``For example, logs`` |
| 231 | |
| 232 | **default_expiry** (optional) |
| 233 | How long the signed destination should be available for |
| 234 | ``default: 7200 (2hrs)`` |
| 235 | |
| 236 | **default_max_file_size** (optional) |
| 237 | The maximum size of an individual file |
| 238 | ``default: 104857600 (100MB)`` |
| 239 | |
| 240 | **default_max_file_count** (optional) |
| 241 | The maximum number of separate files to allow |
| 242 | ``default: 10`` |
| 243 | |
| 244 | **default_logserver_prefix** |
| 245 | Provide a URL to the CDN or logserver app so that a worker knows |
| 246 | what URL to return. The worker should return the logserver_prefix |
| 247 | url and the object path. |
| 248 | ``For example: http://logs.example.org/server.app?obj=`` |
| 249 | |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 250 | .. _connection: |
| 251 | |
| 252 | connection ArbitraryName |
| 253 | """""""""""""""""""""""" |
| 254 | |
| 255 | A connection can be listed with any arbitrary name. The required |
| 256 | parameters are specified in the :ref:`connections` documentation |
| 257 | depending on what driver you are using. |
| 258 | |
| 259 | .. _layoutyaml: |
| 260 | |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 261 | layout.yaml |
| 262 | ~~~~~~~~~~~ |
| 263 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 264 | This is the main configuration file for Zuul, where all of the pipelines |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 265 | and projects are defined, what tests should be run, and what actions |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 266 | Zuul should perform. There are three sections: pipelines, jobs, and |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 267 | projects. |
| 268 | |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 269 | .. _includes: |
| 270 | |
| 271 | Includes |
| 272 | """""""" |
| 273 | |
| 274 | Custom functions to be used in Zuul's configuration may be provided |
| 275 | using the ``includes`` directive. It accepts a list of files to |
| 276 | include, and currently supports one type of inclusion, a python file:: |
| 277 | |
| 278 | includes: |
| 279 | - python-file: local_functions.py |
| 280 | |
| 281 | **python-file** |
Antoine Musso | 9adc6d4 | 2014-11-14 15:37:48 +0100 | [diff] [blame] | 282 | The path to a python file (either an absolute path or relative to the |
| 283 | directory name of :ref:`layout_config <layout_config>`). The |
| 284 | file will be loaded and objects that it defines will be placed in a |
| 285 | special environment which can be referenced in the Zuul configuration. |
| 286 | Currently only the parameter-function attribute of a Job uses this |
| 287 | feature. |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 288 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 289 | Pipelines |
| 290 | """"""""" |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 291 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 292 | Zuul can have any number of independent pipelines. Whenever a matching |
| 293 | Gerrit event is found for a pipeline, that event is added to the |
| 294 | pipeline, and the jobs specified for that pipeline are run. When all |
| 295 | jobs specified for the pipeline that were triggered by an event are |
| 296 | completed, Zuul reports back to Gerrit the results. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 297 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 298 | There are no pre-defined pipelines in Zuul, rather you can define |
| 299 | whatever pipelines you need in the layout file. This is a very flexible |
| 300 | system that can accommodate many kinds of workflows. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 301 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 302 | Here is a quick example of a pipeline definition followed by an |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 303 | explanation of each of the parameters:: |
| 304 | |
| 305 | - name: check |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 306 | manager: IndependentPipelineManager |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 307 | source: my_gerrit |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 308 | trigger: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 309 | my_gerrit: |
James E. Blair | 6c358e7 | 2013-07-29 17:06:47 -0700 | [diff] [blame] | 310 | - event: patchset-created |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 311 | success: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 312 | my_gerrit: |
| 313 | verified: 1 |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 314 | failure: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 315 | my_gerrit |
| 316 | verified: -1 |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 317 | |
| 318 | **name** |
| 319 | This is used later in the project definition to indicate what jobs |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 320 | should be run for events in the pipeline. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 321 | |
James E. Blair | 8dbd56a | 2012-12-22 10:55:10 -0800 | [diff] [blame] | 322 | **description** |
| 323 | This is an optional field that may be used to provide a textual |
| 324 | description of the pipeline. |
| 325 | |
James E. Blair | c0dedf8 | 2014-08-06 09:37:52 -0700 | [diff] [blame] | 326 | **source** |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 327 | A required field that specifies a connection that provides access to |
| 328 | the change objects that this pipeline operates on. The name of the |
| 329 | connection as per the zuul.conf should be specified. The driver used |
| 330 | for the connection named will be the source. Currently only ``gerrit`` |
| 331 | drivers are supported. |
James E. Blair | c0dedf8 | 2014-08-06 09:37:52 -0700 | [diff] [blame] | 332 | |
James E. Blair | 5637019 | 2013-01-14 15:47:28 -0800 | [diff] [blame] | 333 | **success-message** |
| 334 | An optional field that supplies the introductory text in message |
| 335 | reported back to Gerrit when all the voting builds are successful. |
| 336 | Defaults to "Build successful." |
| 337 | |
| 338 | **failure-message** |
| 339 | An optional field that supplies the introductory text in message |
| 340 | reported back to Gerrit when at least one voting build fails. |
| 341 | Defaults to "Build failed." |
| 342 | |
Joshua Hesketh | b717977 | 2014-01-30 23:30:46 +1100 | [diff] [blame] | 343 | **merge-failure-message** |
| 344 | An optional field that supplies the introductory text in message |
| 345 | reported back to Gerrit when a change fails to merge with the |
| 346 | current state of the repository. |
| 347 | Defaults to "Merge failed." |
| 348 | |
Joshua Hesketh | 3979e3e | 2014-03-04 11:21:10 +1100 | [diff] [blame] | 349 | **footer-message** |
| 350 | An optional field to supply additional information after test results. |
| 351 | Useful for adding information about the CI system such as debugging |
| 352 | and contact details. |
| 353 | |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 354 | **manager** |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 355 | There are currently two schemes for managing pipelines: |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 356 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 357 | *IndependentPipelineManager* |
| 358 | Every event in this pipeline should be treated as independent of |
| 359 | other events in the pipeline. This is appropriate when the order of |
| 360 | events in the pipeline doesn't matter because the results of the |
| 361 | actions this pipeline performs can not affect other events in the |
| 362 | pipeline. For example, when a change is first uploaded for review, |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 363 | you may want to run tests on that change to provide early feedback |
| 364 | to reviewers. At the end of the tests, the change is not going to |
| 365 | be merged, so it is safe to run these tests in parallel without |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 366 | regard to any other changes in the pipeline. They are independent. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 367 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 368 | Another type of pipeline that is independent is a post-merge |
| 369 | pipeline. In that case, the changes have already merged, so the |
| 370 | results can not affect any other events in the pipeline. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 371 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 372 | *DependentPipelineManager* |
| 373 | The dependent pipeline manager is designed for gating. It ensures |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 374 | that every change is tested exactly as it is going to be merged |
| 375 | into the repository. An ideal gating system would test one change |
| 376 | at a time, applied to the tip of the repository, and only if that |
| 377 | change passed tests would it be merged. Then the next change in |
| 378 | line would be tested the same way. In order to achieve parallel |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 379 | testing of changes, the dependent pipeline manager performs |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 380 | speculative execution on changes. It orders changes based on |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 381 | their entry into the pipeline. It begins testing all changes in |
| 382 | parallel, assuming that each change ahead in the pipeline will pass |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 383 | its tests. If they all succeed, all the changes can be tested and |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 384 | merged in parallel. If a change near the front of the pipeline |
| 385 | fails its tests, each change behind it ignores whatever tests have |
| 386 | been completed and are tested again without the change in front. |
| 387 | This way gate tests may run in parallel but still be tested |
| 388 | correctly, exactly as they will appear in the repository when |
| 389 | merged. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 390 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 391 | One important characteristic of the DependentPipelineManager is that |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 392 | it analyzes the jobs that are triggered by different projects, and |
| 393 | if those projects have jobs in common, it treats those projects as |
| 394 | related, and they share a single virtual queue of changes. Thus, |
| 395 | if there is a job that performs integration testing on two |
| 396 | projects, those two projects will automatically share a virtual |
| 397 | change queue. If a third project does not invoke that job, it |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 398 | will be part of a separate virtual change queue, and changes to |
| 399 | it will not depend on changes to the first two jobs. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 400 | |
| 401 | For more detail on the theory and operation of Zuul's |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 402 | DependentPipelineManager, see: :doc:`gating`. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 403 | |
| 404 | **trigger** |
James E. Blair | c494d54 | 2014-08-06 09:23:52 -0700 | [diff] [blame] | 405 | At least one trigger source must be supplied for each pipeline. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 406 | Triggers are not exclusive -- matching events may be placed in |
James E. Blair | 6c358e7 | 2013-07-29 17:06:47 -0700 | [diff] [blame] | 407 | multiple pipelines, and they will behave independently in each of |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 408 | the pipelines they match. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 409 | |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 410 | Triggers are loaded from their connection name. The driver type of |
| 411 | the connection will dictate which options are available. |
| 412 | See :doc:`triggers`. |
James E. Blair | c494d54 | 2014-08-06 09:23:52 -0700 | [diff] [blame] | 413 | |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 414 | **require** |
| 415 | If this section is present, it established pre-requisites for any |
| 416 | kind of item entering the Pipeline. Regardless of how the item is |
| 417 | to be enqueued (via any trigger or automatic dependency resolution), |
| 418 | the conditions specified here must be met or the item will not be |
| 419 | enqueued. |
| 420 | |
Antoine Musso | 27ab0d5 | 2014-10-22 14:20:17 +0200 | [diff] [blame] | 421 | .. _pipeline-require-approval: |
| 422 | |
James E. Blair | 5bf78a3 | 2015-07-30 18:08:24 +0000 | [diff] [blame] | 423 | **approval** |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 424 | This requires that a certain kind of approval be present for the |
| 425 | current patchset of the change (the approval could be added by the |
| 426 | event in question). It takes several sub-parameters, all of which |
| 427 | are optional and are combined together so that there must be an |
| 428 | approval matching all specified requirements. |
| 429 | |
| 430 | *username* |
James E. Blair | b01ec54 | 2016-06-16 09:46:49 -0700 | [diff] [blame] | 431 | If present, an approval from this username is required. It is |
| 432 | treated as a regular expression. |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 433 | |
James E. Blair | 1fbfceb | 2014-06-23 14:42:53 -0700 | [diff] [blame] | 434 | *email* |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 435 | If present, an approval with this email address is required. It |
James E. Blair | b01ec54 | 2016-06-16 09:46:49 -0700 | [diff] [blame] | 436 | is treated as a regular expression. |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 437 | |
James E. Blair | 1fbfceb | 2014-06-23 14:42:53 -0700 | [diff] [blame] | 438 | *email-filter* (deprecated) |
| 439 | A deprecated alternate spelling of *email*. Only one of *email* or |
| 440 | *email_filter* should be used. |
| 441 | |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 442 | *older-than* |
| 443 | If present, the approval must be older than this amount of time |
| 444 | to match. Provide a time interval as a number with a suffix of |
| 445 | "w" (weeks), "d" (days), "h" (hours), "m" (minutes), "s" |
| 446 | (seconds). Example ``48h`` or ``2d``. |
| 447 | |
| 448 | *newer-than* |
| 449 | If present, the approval must be newer than this amount of time |
| 450 | to match. Same format as "older-than". |
| 451 | |
| 452 | Any other field is interpreted as a review category and value |
| 453 | pair. For example ``verified: 1`` would require that the approval |
James E. Blair | 9c17dbf | 2014-06-23 14:21:58 -0700 | [diff] [blame] | 454 | be for a +1 vote in the "Verified" column. The value may either |
| 455 | be a single value or a list: ``verified: [1, 2]`` would match |
| 456 | either a +1 or +2 vote. |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 457 | |
| 458 | **open** |
| 459 | A boolean value (``true`` or ``false``) that indicates whether the change |
| 460 | must be open or closed in order to be enqueued. |
| 461 | |
Clark Boylan | a9702ad | 2014-05-08 17:17:24 -0700 | [diff] [blame] | 462 | **current-patchset** |
| 463 | A boolean value (``true`` or ``false``) that indicates whether the change |
| 464 | must be the current patchset in order to be enqueued. |
| 465 | |
James E. Blair | 11041d2 | 2014-05-02 14:49:53 -0700 | [diff] [blame] | 466 | **status** |
| 467 | A string value that corresponds with the status of the change |
| 468 | reported by the trigger. For example, when using the Gerrit |
| 469 | trigger, status values such as ``NEW`` or ``MERGED`` may be useful. |
James E. Blair | 63bb0ef | 2013-07-29 17:14:51 -0700 | [diff] [blame] | 470 | |
Joshua Hesketh | 66c8e52 | 2014-06-26 15:30:08 +1000 | [diff] [blame] | 471 | **reject** |
| 472 | If this section is present, it establishes pre-requisites that can |
| 473 | block an item from being enqueued. It can be considered a negative |
| 474 | version of **require**. |
| 475 | |
| 476 | **approval** |
| 477 | This takes a list of approvals. If an approval matches the provided |
| 478 | criteria the change can not be entered into the pipeline. It follows |
| 479 | the same syntax as the :ref:`"require approval" pipeline above |
| 480 | <pipeline-require-approval>`. |
| 481 | |
| 482 | Example to reject a change with any negative vote:: |
| 483 | |
| 484 | reject: |
| 485 | approval: |
| 486 | - code-review: [-1, -2] |
| 487 | |
James E. Blair | 2fa5096 | 2013-01-30 21:50:41 -0800 | [diff] [blame] | 488 | **dequeue-on-new-patchset** |
| 489 | Normally, if a new patchset is uploaded to a change that is in a |
| 490 | pipeline, the existing entry in the pipeline will be removed (with |
| 491 | jobs canceled and any dependent changes that can no longer merge as |
| 492 | well. To suppress this behavior (and allow jobs to continue |
| 493 | running), set this to ``false``. Default: ``true``. |
| 494 | |
James E. Blair | 17dd677 | 2015-02-09 14:45:18 -0800 | [diff] [blame] | 495 | **ignore-dependencies** |
| 496 | In any kind of pipeline (dependent or independent), Zuul will |
| 497 | attempt to enqueue all dependencies ahead of the current change so |
| 498 | that they are tested together (independent pipelines report the |
| 499 | results of each change regardless of the results of changes ahead). |
| 500 | To ignore dependencies completely in an independent pipeline, set |
| 501 | this to ``true``. This option is ignored by dependent pipelines. |
| 502 | The default is: ``false``. |
| 503 | |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 504 | **success** |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 505 | Describes where Zuul should report to if all the jobs complete |
| 506 | successfully. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 507 | This section is optional; if it is omitted, Zuul will run jobs and |
| 508 | do nothing on success; it will not even report a message to Gerrit. |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 509 | If the section is present, the listed reporter plugins will be |
| 510 | asked to report on the jobs. |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 511 | The reporters are listed by their connection name. The options |
| 512 | available depend on the driver for the supplied connection. |
| 513 | See :doc:`reporters` for more details. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 514 | |
Mathieu Gagné | d6d2a64 | 2013-06-11 20:59:58 -0400 | [diff] [blame] | 515 | **failure** |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 516 | Uses the same syntax as **success**, but describes what Zuul should |
| 517 | do if at least one job fails. |
James E. Blair | dc25386 | 2012-06-13 17:12:42 -0700 | [diff] [blame] | 518 | |
Joshua Hesketh | b717977 | 2014-01-30 23:30:46 +1100 | [diff] [blame] | 519 | **merge-failure** |
| 520 | Uses the same syntax as **success**, but describes what Zuul should |
| 521 | do if it is unable to merge in the patchset. If no merge-failure |
| 522 | reporters are listed then the ``failure`` reporters will be used to |
| 523 | notify of unsuccessful merges. |
| 524 | |
Mathieu Gagné | d6d2a64 | 2013-06-11 20:59:58 -0400 | [diff] [blame] | 525 | **start** |
James E. Blair | dc25386 | 2012-06-13 17:12:42 -0700 | [diff] [blame] | 526 | Uses the same syntax as **success**, but describes what Zuul should |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 527 | do when a change is added to the pipeline manager. This can be used, |
James E. Blair | dc25386 | 2012-06-13 17:12:42 -0700 | [diff] [blame] | 528 | for example, to reset the value of the Verified review category. |
Mathieu Gagné | d6d2a64 | 2013-06-11 20:59:58 -0400 | [diff] [blame] | 529 | |
Joshua Hesketh | 89e829d | 2015-02-10 16:29:45 +1100 | [diff] [blame] | 530 | **disabled** |
| 531 | Uses the same syntax as **success**, but describes what Zuul should |
| 532 | do when a pipeline is disabled. |
| 533 | See ``disable-after-consecutive-failures``. |
| 534 | |
| 535 | **disable-after-consecutive-failures** |
| 536 | If set, a pipeline can enter a ''disabled'' state if too many changes |
| 537 | in a row fail. When this value is exceeded the pipeline will stop |
| 538 | reporting to any of the ``success``, ``failure`` or ``merge-failure`` |
| 539 | reporters and instead only report to the ``disabled`` reporters. |
| 540 | (No ``start`` reports are made when a pipeline is disabled). |
| 541 | |
James E. Blair | 64ed6f2 | 2013-07-10 14:07:23 -0700 | [diff] [blame] | 542 | **precedence** |
| 543 | Indicates how the build scheduler should prioritize jobs for |
| 544 | different pipelines. Each pipeline may have one precedence, jobs |
| 545 | for pipelines with a higher precedence will be run before ones with |
| 546 | lower. The value should be one of ``high``, ``normal``, or ``low``. |
| 547 | Default: ``normal``. |
| 548 | |
Clark Boylan | c2d19e4 | 2014-01-23 14:08:58 -0800 | [diff] [blame] | 549 | **window** |
| 550 | DependentPipelineManagers only. Zuul can rate limit |
| 551 | DependentPipelineManagers in a manner similar to TCP flow control. |
| 552 | Jobs are only started for changes in the queue if they sit in the |
| 553 | actionable window for the pipeline. The initial length of this window |
| 554 | is configurable with this value. The value given should be a positive |
| 555 | integer value. A value of ``0`` disables rate limiting on the |
| 556 | DependentPipelineManager. |
| 557 | Default: ``20``. |
| 558 | |
| 559 | **window-floor** |
| 560 | DependentPipelineManagers only. This is the minimum value for the |
| 561 | window described above. Should be a positive non zero integer value. |
| 562 | Default: ``3``. |
| 563 | |
| 564 | **window-increase-type** |
| 565 | DependentPipelineManagers only. This value describes how the window |
| 566 | should grow when changes are successfully merged by zuul. A value of |
| 567 | ``linear`` indicates that ``window-increase-factor`` should be added |
| 568 | to the previous window value. A value of ``exponential`` indicates |
| 569 | that ``window-increase-factor`` should be multiplied against the |
| 570 | previous window value and the result will become the window size. |
| 571 | Default: ``linear``. |
| 572 | |
| 573 | **window-increase-factor** |
Clint Adams | 041ae51 | 2015-06-16 20:02:29 -0400 | [diff] [blame] | 574 | DependentPipelineManagers only. The value to be added or multiplied |
Clark Boylan | c2d19e4 | 2014-01-23 14:08:58 -0800 | [diff] [blame] | 575 | against the previous window value to determine the new window after |
| 576 | successful change merges. |
| 577 | Default: ``1``. |
| 578 | |
| 579 | **window-decrease-type** |
| 580 | DependentPipelineManagers only. This value describes how the window |
| 581 | should shrink when changes are not able to be merged by Zuul. A value |
| 582 | of ``linear`` indicates that ``window-decrease-factor`` should be |
| 583 | subtracted from the previous window value. A value of ``exponential`` |
| 584 | indicates that ``window-decrease-factor`` should be divided against |
| 585 | the previous window value and the result will become the window size. |
| 586 | Default: ``exponential``. |
| 587 | |
| 588 | **window-decrease-factor** |
| 589 | DependentPipelineManagers only. The value to be subtracted or divided |
| 590 | against the previous window value to determine the new window after |
| 591 | unsuccessful change merges. |
| 592 | Default: ``2``. |
| 593 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 594 | Some example pipeline configurations are included in the sample layout |
| 595 | file. The first is called a *check* pipeline:: |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 596 | |
| 597 | - name: check |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 598 | manager: IndependentPipelineManager |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 599 | trigger: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 600 | my_gerrit: |
| 601 | - event: patchset-created |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 602 | success: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 603 | my_gerrit: |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 604 | verified: 1 |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 605 | failure: |
Thomas Bechtold | a8c0dbd | 2015-12-10 07:16:54 +0100 | [diff] [blame] | 606 | my_gerrit: |
| 607 | verified: -1 |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 608 | |
| 609 | This will trigger jobs each time a new patchset (or change) is |
| 610 | uploaded to Gerrit, and report +/-1 values to Gerrit in the |
| 611 | ``verified`` review category. :: |
| 612 | |
| 613 | - name: gate |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 614 | manager: DependentPipelineManager |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 615 | trigger: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 616 | my_gerrit: |
| 617 | - event: comment-added |
| 618 | approval: |
| 619 | - approved: 1 |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 620 | success: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 621 | my_gerrit: |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 622 | verified: 2 |
| 623 | submit: true |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 624 | failure: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 625 | my_gerrit: |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 626 | verified: -2 |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 627 | |
| 628 | This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the |
| 629 | ``approved`` review category in Gerrit (a non-standard category). |
| 630 | Changes will be tested in such a way as to guarantee that they will be |
| 631 | merged exactly as tested, though that will happen in parallel by |
| 632 | creating a virtual queue of dependent changes and performing |
| 633 | speculative execution of jobs. :: |
| 634 | |
| 635 | - name: post |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 636 | manager: IndependentPipelineManager |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 637 | trigger: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 638 | my_gerrit: |
| 639 | - event: ref-updated |
| 640 | ref: ^(?!refs/).*$ |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 641 | |
| 642 | This will trigger jobs whenever a change is merged to a named branch |
| 643 | (e.g., ``master``). No output will be reported to Gerrit. This is |
| 644 | useful for side effects such as creating per-commit tarballs. :: |
| 645 | |
| 646 | - name: silent |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 647 | manager: IndependentPipelineManager |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 648 | trigger: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 649 | my_gerrit: |
| 650 | - event: patchset-created |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 651 | |
| 652 | This also triggers jobs when changes are uploaded to Gerrit, but no |
| 653 | results are reported to Gerrit. This is useful for jobs that are in |
Antoine Musso | ce33384 | 2012-10-16 14:42:35 +0200 | [diff] [blame] | 654 | development and not yet ready to be presented to developers. :: |
| 655 | |
| 656 | pipelines: |
| 657 | - name: post-merge |
| 658 | manager: IndependentPipelineManager |
| 659 | trigger: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 660 | my_gerrit: |
| 661 | - event: change-merged |
Antoine Musso | ce33384 | 2012-10-16 14:42:35 +0200 | [diff] [blame] | 662 | success: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 663 | my_gerrit: |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 664 | force-message: True |
Antoine Musso | ce33384 | 2012-10-16 14:42:35 +0200 | [diff] [blame] | 665 | failure: |
Joshua Hesketh | fe485c6 | 2015-08-11 23:42:34 +1000 | [diff] [blame] | 666 | my_gerrit: |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 667 | force-message: True |
Antoine Musso | ce33384 | 2012-10-16 14:42:35 +0200 | [diff] [blame] | 668 | |
| 669 | The ``change-merged`` events happen when a change has been merged in the git |
| 670 | repository. The change is thus closed and Gerrit will not accept modifications |
| 671 | to the review scoring such as ``code-review`` or ``verified``. By using the |
| 672 | ``force-message: True`` parameter, Zuul will pass ``--force-message`` to the |
| 673 | ``gerrit review`` command, thus making sure the message is actually |
| 674 | sent back to Gerrit regardless of approval scores. |
| 675 | That kind of pipeline is nice to run regression or performance tests. |
| 676 | |
| 677 | .. note:: |
| 678 | The ``change-merged`` event does not include the commit sha1 which can be |
| 679 | hazardous, it would let you report back to Gerrit though. If you were to |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 680 | build a tarball for a specific commit, you should consider instead using |
Łukasz Jernaś | 048acb4 | 2014-03-02 18:49:41 +0100 | [diff] [blame] | 681 | the ``ref-updated`` event which does include the commit sha1 (but lacks the |
Antoine Musso | ce33384 | 2012-10-16 14:42:35 +0200 | [diff] [blame] | 682 | Gerrit change number). |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 683 | |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 684 | |
| 685 | .. _jobs: |
| 686 | |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 687 | Jobs |
| 688 | """" |
| 689 | |
| 690 | The jobs section is optional, and can be used to set attributes of |
| 691 | jobs that are independent of their association with a project. For |
| 692 | example, if a job should return a customized message on failure, that |
| 693 | may be specified here. Otherwise, Zuul does not need to be told about |
| 694 | each job as it builds a list from the project specification. |
| 695 | |
| 696 | **name** |
| 697 | The name of the job. This field is treated as a regular expression |
| 698 | and will be applied to each job that matches. |
| 699 | |
James E. Blair | c8a1e05 | 2014-02-25 09:29:26 -0800 | [diff] [blame] | 700 | **queue-name (optional)** |
| 701 | Zuul will automatically combine projects that share a job into |
| 702 | shared change queues for dependent pipeline managers. In order to |
| 703 | report statistics about these queues, it is convenient for them to |
| 704 | have names. Zuul can automatically name change queues, however |
| 705 | these can grow quite long and are prone to changing as projects in |
| 706 | the queue change. If you assign a queue-name to a job, Zuul will |
| 707 | use that as the name for the shared change queue that contains that |
| 708 | job instead of the automatically generated one. It is an error for |
| 709 | a shared change queue to have more than one job with a queue-name if |
| 710 | they are not the same. |
| 711 | |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 712 | **failure-message (optional)** |
| 713 | The message that should be reported to Gerrit if the job fails. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 714 | |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 715 | **success-message (optional)** |
| 716 | The message that should be reported to Gerrit if the job fails. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 717 | |
James E. Blair | 6aea36d | 2012-12-17 13:03:24 -0800 | [diff] [blame] | 718 | **failure-pattern (optional)** |
| 719 | The URL that should be reported to Gerrit if the job fails. |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 720 | Defaults to the build URL or the url_pattern configured in |
James E. Blair | 6aea36d | 2012-12-17 13:03:24 -0800 | [diff] [blame] | 721 | zuul.conf. May be supplied as a string pattern with substitutions |
| 722 | as described in url_pattern in :ref:`zuulconf`. |
| 723 | |
| 724 | **success-pattern (optional)** |
| 725 | The URL that should be reported to Gerrit if the job succeeds. |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 726 | Defaults to the build URL or the url_pattern configured in |
James E. Blair | 6aea36d | 2012-12-17 13:03:24 -0800 | [diff] [blame] | 727 | zuul.conf. May be supplied as a string pattern with substitutions |
| 728 | as described in url_pattern in :ref:`zuulconf`. |
| 729 | |
James E. Blair | 222d498 | 2012-07-16 09:31:19 -0700 | [diff] [blame] | 730 | **hold-following-changes (optional)** |
| 731 | This is a boolean that indicates that changes that follow this |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 732 | change in a dependent change pipeline should wait until this job |
James E. Blair | 222d498 | 2012-07-16 09:31:19 -0700 | [diff] [blame] | 733 | succeeds before launching. If this is applied to a very short job |
| 734 | that can predict whether longer jobs will fail early, this can be |
| 735 | used to reduce the number of jobs that Zuul will launch and |
| 736 | ultimately have to cancel. In that case, a small amount of |
Mathieu Gagné | d6d2a64 | 2013-06-11 20:59:58 -0400 | [diff] [blame] | 737 | parallelization of jobs is traded for more efficient use of testing |
James E. Blair | 222d498 | 2012-07-16 09:31:19 -0700 | [diff] [blame] | 738 | resources. On the other hand, to apply this to a long running job |
| 739 | would largely defeat the parallelization of dependent change testing |
Mathieu Gagné | d6d2a64 | 2013-06-11 20:59:58 -0400 | [diff] [blame] | 740 | that is the main feature of Zuul. Default: ``false``. |
James E. Blair | 222d498 | 2012-07-16 09:31:19 -0700 | [diff] [blame] | 741 | |
James E. Blair | af17a97 | 2016-02-03 15:07:18 -0800 | [diff] [blame] | 742 | **mutex (optional)** |
| 743 | This is a string that names a mutex that should be observed by this |
| 744 | job. Only one build of any job that references the same named mutex |
| 745 | will be enqueued at a time. This applies across all pipelines. |
| 746 | |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 747 | **branch (optional)** |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 748 | This job should only be run on matching branches. This field is |
| 749 | treated as a regular expression and multiple branches may be |
| 750 | listed. |
| 751 | |
James E. Blair | 70c7158 | 2013-03-06 08:50:50 -0800 | [diff] [blame] | 752 | **files (optional)** |
| 753 | This job should only be run if at least one of the files involved in |
| 754 | the change (added, deleted, or modified) matches at least one of the |
| 755 | file patterns listed here. This field is treated as a regular |
| 756 | expression and multiple expressions may be listed. |
| 757 | |
Maru Newby | 3fe5f85 | 2015-01-13 04:22:14 +0000 | [diff] [blame] | 758 | **skip-if (optional)** |
| 759 | |
| 760 | This job should not be run if all the patterns specified by the |
| 761 | optional fields listed below match on their targets. When multiple |
| 762 | sets of parameters are provided, this job will be skipped if any set |
| 763 | matches. For example: :: |
| 764 | |
| 765 | jobs: |
| 766 | - name: check-tempest-dsvm-neutron |
| 767 | skip-if: |
| 768 | - project: ^openstack/neutron$ |
| 769 | branch: ^stable/juno$ |
| 770 | all-files-match-any: |
| 771 | - ^neutron/tests/.*$ |
| 772 | - ^tools/.*$ |
| 773 | - all-files-match-any: |
| 774 | - ^doc/.*$ |
| 775 | - ^.*\.rst$ |
| 776 | |
| 777 | With this configuration, the job would be skipped for a neutron |
| 778 | patchset for the stable/juno branch provided that every file in the |
| 779 | change matched at least one of the specified file regexes. The job |
| 780 | will also be skipped for any patchset that modified only the doc |
| 781 | tree or rst files. |
| 782 | |
| 783 | *project* (optional) |
| 784 | The regular expression to match against the project of the change. |
| 785 | |
| 786 | *branch* (optional) |
| 787 | The regular expression to match against the branch or ref of the |
| 788 | change. |
| 789 | |
| 790 | *all-files-match-any* (optional) |
| 791 | A list of regular expressions intended to match the files involved |
| 792 | in the change. This parameter will be considered matching a |
| 793 | change only if all files in a change match at least one of these |
| 794 | expressions. |
| 795 | |
| 796 | The pattern for '/COMMIT_MSG' is always matched on and does not |
Alexander Evseev | dbe6fab | 2015-11-19 12:46:34 +0300 | [diff] [blame] | 797 | have to be included. Exception is merge commits (without modified |
| 798 | files), in this case '/COMMIT_MSG' is not matched, and job is not |
| 799 | skipped. In case of merge commits it's assumed that list of modified |
| 800 | files isn't predictible and CI should be run. |
Maru Newby | 3fe5f85 | 2015-01-13 04:22:14 +0000 | [diff] [blame] | 801 | |
Mathieu Gagné | d6d2a64 | 2013-06-11 20:59:58 -0400 | [diff] [blame] | 802 | **voting (optional)** |
| 803 | Boolean value (``true`` or ``false``) that indicates whatever |
| 804 | a job is voting or not. Default: ``true``. |
| 805 | |
Paul Belanger | 71d9817 | 2016-11-08 10:56:31 -0500 | [diff] [blame] | 806 | **attempts (optional)** |
| 807 | Number of attempts zuul will launch a job. Once reached, zuul will report |
| 808 | RETRY_LIMIT as the job result. |
| 809 | Defaults to 3. |
| 810 | |
James E. Blair | 456f2fb | 2016-02-09 09:29:33 -0800 | [diff] [blame] | 811 | **tags (optional)** |
| 812 | A list of arbitrary strings which will be associated with the job. |
| 813 | Can be used by the parameter-function to alter behavior based on |
| 814 | their presence on a job. If the job name is a regular expression, |
| 815 | tags will accumulate on jobs that match. |
| 816 | |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 817 | **parameter-function (optional)** |
| 818 | Specifies a function that should be applied to the parameters before |
| 819 | the job is launched. The function should be defined in a python file |
| 820 | included with the :ref:`includes` directive. The function |
| 821 | should have the following signature: |
| 822 | |
James E. Blair | d047097 | 2013-07-29 10:05:43 -0700 | [diff] [blame] | 823 | .. function:: parameters(item, job, parameters) |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 824 | |
| 825 | Manipulate the parameters passed to a job before a build is |
| 826 | launched. The ``parameters`` dictionary will already contain the |
| 827 | standard Zuul job parameters, and is expected to be modified |
| 828 | in-place. |
| 829 | |
James E. Blair | d78576a | 2013-07-09 10:39:17 -0700 | [diff] [blame] | 830 | :param item: the current queue item |
| 831 | :type item: zuul.model.QueueItem |
James E. Blair | d047097 | 2013-07-29 10:05:43 -0700 | [diff] [blame] | 832 | :param job: the job about to be run |
| 833 | :type job: zuul.model.Job |
James E. Blair | e5a847f | 2012-07-10 15:29:14 -0700 | [diff] [blame] | 834 | :param parameters: parameters to be passed to the job |
| 835 | :type parameters: dict |
| 836 | |
James E. Blair | 1f4c2bb | 2013-04-26 08:40:46 -0700 | [diff] [blame] | 837 | If the parameter **ZUUL_NODE** is set by this function, then it will |
| 838 | be used to specify on what node (or class of node) the job should be |
| 839 | run. |
| 840 | |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 841 | **swift** |
| 842 | If :ref:`swift` is configured then each job can define a destination |
| 843 | container for the builder to place logs and/or assets into. Multiple |
| 844 | containers can be listed for each job by providing a unique ``name``. |
| 845 | |
| 846 | *name* |
| 847 | Set an identifying name for the container. This is used in the |
| 848 | parameter key sent to the builder. For example if it ``logs`` then |
| 849 | one of the parameters sent will be ``SWIFT_logs_CONTAINER`` |
| 850 | (case-sensitive). |
| 851 | |
| 852 | Each of the defaults defined in :ref:`swift` can be overwritten as: |
| 853 | |
| 854 | *container* (optional) |
| 855 | Container name to place the log into |
| 856 | ``For example, logs`` |
| 857 | |
| 858 | *expiry* (optional) |
| 859 | How long the signed destination should be available for |
| 860 | |
James E. Blair | d650023 | 2014-06-23 15:05:48 -0700 | [diff] [blame] | 861 | *max-file-size** (optional) |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 862 | The maximum size of an individual file |
| 863 | |
James E. Blair | d650023 | 2014-06-23 15:05:48 -0700 | [diff] [blame] | 864 | *max_file_size** (optional, deprecated) |
| 865 | A deprecated alternate spelling of *max-file-size*. |
| 866 | |
| 867 | *max-file-count* (optional) |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 868 | The maximum number of separate files to allow |
| 869 | |
James E. Blair | d650023 | 2014-06-23 15:05:48 -0700 | [diff] [blame] | 870 | *max_file_count* (optional, deprecated) |
| 871 | A deprecated alternate spelling of *max-file-count*. |
| 872 | |
| 873 | *logserver-prefix* |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 874 | Provide a URL to the CDN or logserver app so that a worker knows |
| 875 | what URL to return. |
| 876 | ``For example: http://logs.example.org/server.app?obj=`` |
James E. Blair | d650023 | 2014-06-23 15:05:48 -0700 | [diff] [blame] | 877 | The worker should return the logserver-prefix url and the object |
Joshua Hesketh | 36c3fa5 | 2014-01-22 11:40:52 +1100 | [diff] [blame] | 878 | path as the URL in the results data packet. |
| 879 | |
James E. Blair | d650023 | 2014-06-23 15:05:48 -0700 | [diff] [blame] | 880 | *logserver_prefix* (deprecated) |
| 881 | A deprecated alternate spelling of *logserver-prefix*. |
| 882 | |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 883 | Here is an example of setting the failure message for jobs that check |
| 884 | whether a change merges cleanly:: |
| 885 | |
| 886 | - name: ^.*-merge$ |
Jeremy Stanley | 1c2c3c2 | 2015-06-15 21:23:19 +0000 | [diff] [blame] | 887 | failure-message: This change or one of its cross-repo dependencies |
| 888 | was unable to be automatically merged with the current state of |
| 889 | its repository. Please rebase the change and upload a new |
| 890 | patchset. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 891 | |
| 892 | Projects |
| 893 | """""""" |
| 894 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 895 | The projects section indicates what jobs should be run in each pipeline |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 896 | for events associated with each project. It contains a list of |
| 897 | projects. Here is an example:: |
| 898 | |
| 899 | - name: example/project |
| 900 | check: |
| 901 | - project-merge: |
| 902 | - project-unittest |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 903 | - project-pep8 |
| 904 | - project-pyflakes |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 905 | gate: |
| 906 | - project-merge: |
| 907 | - project-unittest |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 908 | - project-pep8 |
| 909 | - project-pyflakes |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 910 | post: |
| 911 | - project-publish |
| 912 | |
| 913 | **name** |
| 914 | The name of the project (as known by Gerrit). |
| 915 | |
James E. Blair | 19deff2 | 2013-08-25 13:17:35 -0700 | [diff] [blame] | 916 | **merge-mode (optional)** |
| 917 | An optional value that indicates what strategy should be used to |
| 918 | merge changes to this project. Supported values are: |
| 919 | |
| 920 | ** merge-resolve ** |
| 921 | Equivalent to 'git merge -s resolve'. This corresponds closely to |
| 922 | what Gerrit performs (using JGit) for a project if the "Merge if |
| 923 | necessary" merge mode is selected and "Automatically resolve |
| 924 | conflicts" is checked. This is the default. |
| 925 | |
| 926 | ** merge ** |
| 927 | Equivalent to 'git merge'. |
| 928 | |
| 929 | ** cherry-pick ** |
| 930 | Equivalent to 'git cherry-pick'. |
| 931 | |
Clark Boylan | 00635dc | 2012-09-19 14:03:08 -0700 | [diff] [blame] | 932 | This is followed by a section for each of the pipelines defined above. |
| 933 | Pipelines may be omitted if no jobs should run for this project in a |
| 934 | given pipeline. Within the pipeline section, the jobs that should be |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 935 | executed are listed. If a job is entered as a dictionary key, then |
| 936 | jobs contained within that key are only executed if the key job |
| 937 | succeeds. In the above example, project-unittest, project-pep8, and |
| 938 | project-pyflakes are only executed if project-merge succeeds. This |
| 939 | can help avoid running unnecessary jobs. |
| 940 | |
James E. Blair | 18c6444 | 2014-03-18 10:14:45 -0700 | [diff] [blame] | 941 | The special job named ``noop`` is internal to Zuul and will always |
| 942 | return ``SUCCESS`` immediately. This can be useful if you require |
| 943 | that all changes be processed by a pipeline but a project has no jobs |
| 944 | that can be run on it. |
| 945 | |
Andreas Jaeger | bcfbf93 | 2014-09-29 20:21:44 +0200 | [diff] [blame] | 946 | .. seealso:: The OpenStack Zuul configuration for a comprehensive example: https://git.openstack.org/cgit/openstack-infra/project-config/tree/zuul/layout.yaml |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 947 | |
Antoine Musso | 80edd5a | 2013-02-13 15:37:53 +0100 | [diff] [blame] | 948 | Project Templates |
| 949 | """"""""""""""""" |
| 950 | |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 951 | Whenever you have lot of similar projects (such as plugins for a project) you |
Antoine Musso | 80edd5a | 2013-02-13 15:37:53 +0100 | [diff] [blame] | 952 | will most probably want to use the same pipeline configurations. The |
| 953 | project templates let you define pipelines and job name templates to trigger. |
| 954 | One can then just apply the template on its project which make it easier to |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 955 | update several similar projects. As an example:: |
Antoine Musso | 80edd5a | 2013-02-13 15:37:53 +0100 | [diff] [blame] | 956 | |
| 957 | project-templates: |
| 958 | # Name of the template |
| 959 | - name: plugin-triggering |
| 960 | # Definition of pipelines just like for a `project` |
| 961 | check: |
| 962 | - '{jobprefix}-merge': |
| 963 | - '{jobprefix}-pep8' |
| 964 | - '{jobprefix}-pyflakes' |
| 965 | gate: |
| 966 | - '{jobprefix}-merge': |
| 967 | - '{jobprefix}-unittest' |
| 968 | - '{jobprefix}-pep8' |
| 969 | - '{jobprefix}-pyflakes' |
| 970 | |
| 971 | In your projects definition, you will then apply the template using the template |
| 972 | key:: |
| 973 | |
| 974 | projects: |
| 975 | - name: plugin/foobar |
| 976 | template: |
| 977 | - name: plugin-triggering |
| 978 | jobprefix: plugin-foobar |
| 979 | |
James E. Blair | aea6cf6 | 2013-12-16 15:38:12 -0800 | [diff] [blame] | 980 | You can pass several parameters to a template. A ``parameter`` value |
| 981 | will be used for expansion of ``{parameter}`` in the template |
| 982 | strings. The parameter ``name`` will be automatically provided and |
| 983 | will contain the short name of the project, that is the portion of the |
| 984 | project name after the last ``/`` character. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 985 | |
James E. Blair | 3e98c02 | 2013-12-16 15:25:38 -0800 | [diff] [blame] | 986 | Multiple templates can be combined in a project, and the jobs from all |
| 987 | of those templates will be added to the project. Individual jobs may |
| 988 | also be added:: |
| 989 | |
| 990 | projects: |
| 991 | - name: plugin/foobar |
| 992 | template: |
| 993 | - name: plugin-triggering |
| 994 | jobprefix: plugin-foobar |
| 995 | - name: plugin-extras |
| 996 | jobprefix: plugin-foobar |
| 997 | check: |
| 998 | - foobar-extra-special-job |
| 999 | |
Steven Dake | 21ef9ad | 2014-08-25 23:08:14 -0700 | [diff] [blame] | 1000 | Individual jobs may optionally be added to pipelines (e.g. check, |
Atsushi SAKAI | 5d7e93b | 2015-07-28 22:15:48 +0900 | [diff] [blame] | 1001 | gate, et cetera) for a project, in addition to those provided by |
Steven Dake | 21ef9ad | 2014-08-25 23:08:14 -0700 | [diff] [blame] | 1002 | templates. |
| 1003 | |
James E. Blair | 3e98c02 | 2013-12-16 15:25:38 -0800 | [diff] [blame] | 1004 | The order of the jobs listed in the project (which only affects the |
| 1005 | order of jobs listed on the report) will be the jobs from each |
| 1006 | template in the order listed, followed by any jobs individually listed |
| 1007 | for the project. |
| 1008 | |
| 1009 | Note that if multiple templates are used for a project and one |
| 1010 | template specifies a job that is also specified in another template, |
James E. Blair | 12a92b1 | 2014-03-26 11:54:53 -0700 | [diff] [blame] | 1011 | or specified in the project itself, the configuration defined by |
| 1012 | either the last template or the project itself will take priority. |
James E. Blair | 3e98c02 | 2013-12-16 15:25:38 -0800 | [diff] [blame] | 1013 | |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 1014 | logging.conf |
| 1015 | ~~~~~~~~~~~~ |
| 1016 | This file is optional. If provided, it should be a standard |
| 1017 | :mod:`logging.config` module configuration file. If not present, Zuul will |
| 1018 | output all log messages of DEBUG level or higher to the console. |
| 1019 | |
| 1020 | Starting Zuul |
| 1021 | ------------- |
| 1022 | |
| 1023 | To start Zuul, run **zuul-server**:: |
| 1024 | |
Antoine Musso | b3aa828 | 2013-04-19 15:16:59 +0200 | [diff] [blame] | 1025 | usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version] |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 1026 | |
| 1027 | Project gating system. |
| 1028 | |
| 1029 | optional arguments: |
| 1030 | -h, --help show this help message and exit |
| 1031 | -c CONFIG specify the config file |
Antoine Musso | b3aa828 | 2013-04-19 15:16:59 +0200 | [diff] [blame] | 1032 | -l LAYOUT specify the layout file |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 1033 | -d do not run as a daemon |
Antoine Musso | b3aa828 | 2013-04-19 15:16:59 +0200 | [diff] [blame] | 1034 | -t validate layout file syntax |
| 1035 | --version show zuul version |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 1036 | |
| 1037 | You may want to use the ``-d`` argument while you are initially setting |
| 1038 | up Zuul so you can detect any configuration errors quickly. Under |
| 1039 | normal operation, omit ``-d`` and let Zuul run as a daemon. |
| 1040 | |
| 1041 | If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will |
| 1042 | stop executing new jobs, wait until all executing jobs are finished, |
Joshua Hesketh | c499715 | 2016-02-17 21:04:18 +1100 | [diff] [blame] | 1043 | reload its layout.yaml, and resume. Changes to any connections or |
| 1044 | the PID file will be ignored until Zuul is restarted. |
Clark Boylan | f231fa2 | 2013-02-08 12:28:53 -0800 | [diff] [blame] | 1045 | |
| 1046 | If you send a SIGUSR1 to the zuul-server process, Zuul will stop |
| 1047 | executing new jobs, wait until all executing jobs are finished, |
| 1048 | then exit. While waiting to exit Zuul will queue Gerrit events and |
| 1049 | save these events prior to exiting. When Zuul starts again it will |
| 1050 | read these saved events and act on them. |
Jeremy Stanley | 93e05f4 | 2013-03-08 17:29:17 +0000 | [diff] [blame] | 1051 | |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 1052 | If you need to abort Zuul and intend to manually requeue changes for |
Jeremy Stanley | 93e05f4 | 2013-03-08 17:29:17 +0000 | [diff] [blame] | 1053 | jobs which were running in its pipelines, prior to terminating you can |
| 1054 | use the zuul-changes.py tool script to simplify the process. For |
Ramy Asselin | dda8e6a | 2015-03-31 14:59:39 -0700 | [diff] [blame] | 1055 | example, this would give you a list of zuul-enqueue commands to requeue |
| 1056 | changes for the gate and check pipelines respectively:: |
Jeremy Stanley | 93e05f4 | 2013-03-08 17:29:17 +0000 | [diff] [blame] | 1057 | |
Ramy Asselin | dda8e6a | 2015-03-31 14:59:39 -0700 | [diff] [blame] | 1058 | ./tools/zuul-changes.py http://zuul.openstack.org/ gate |
| 1059 | ./tools/zuul-changes.py http://zuul.openstack.org/ check |
Clark Boylan | fba9b24 | 2013-08-20 10:11:17 -0700 | [diff] [blame] | 1060 | |
Antoine Musso | 29eab01 | 2014-10-28 21:35:22 +0100 | [diff] [blame] | 1061 | If you send a SIGUSR2 to the zuul-server process, or the forked process |
| 1062 | that runs the Gearman daemon, Zuul will dump a stack trace for each |
| 1063 | running thread into its debug log. It is written under the log bucket |
| 1064 | ``zuul.stack_dump``. This is useful for tracking down deadlock or |
| 1065 | otherwise slow threads. |
Antoine Musso | d0f0626 | 2014-06-04 09:54:24 +0200 | [diff] [blame] | 1066 | |
| 1067 | When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python |
| 1068 | Profiler) is available, additional functions' and threads' stats are |
| 1069 | emitted as well. The first SIGUSR2 will enable yappi, on the second |
| 1070 | SIGUSR2 it dumps the information collected, resets all yappi state and |
| 1071 | stops profiling. This is to minimize the impact of yappi on a running |
| 1072 | system. |