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