James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 1 | :title: Components |
| 2 | |
| 3 | .. _components: |
| 4 | |
| 5 | Components |
| 6 | ========== |
| 7 | |
| 8 | Zuul is a distributed system consisting of several components, each of |
James E. Blair | e86abe1 | 2017-08-04 14:46:00 -0700 | [diff] [blame] | 9 | which is described below. |
| 10 | |
James E. Blair | e86abe1 | 2017-08-04 14:46:00 -0700 | [diff] [blame] | 11 | .. graphviz:: |
| 12 | :align: center |
| 13 | |
| 14 | graph { |
| 15 | node [shape=box] |
| 16 | Gearman [shape=ellipse] |
| 17 | Gerrit [fontcolor=grey] |
| 18 | Zookeeper [shape=ellipse] |
| 19 | Nodepool |
| 20 | GitHub [fontcolor=grey] |
| 21 | |
| 22 | Merger -- Gearman |
| 23 | Executor -- Gearman |
| 24 | Web -- Gearman |
| 25 | |
| 26 | Gearman -- Scheduler; |
| 27 | Scheduler -- Gerrit; |
| 28 | Scheduler -- Zookeeper; |
| 29 | Zookeeper -- Nodepool; |
| 30 | Scheduler -- GitHub; |
| 31 | } |
| 32 | |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 33 | Each of the Zuul processes may run on the same host, or different |
| 34 | hosts. Within Zuul, the components communicate with the scheduler via |
| 35 | the Gearman protocol, so each Zuul component needs to be able to |
| 36 | connect to the host running the Gearman server (the scheduler has a |
| 37 | built-in Gearman server which is recommended) on the Gearman port -- |
| 38 | TCP port 4730 by default. |
James E. Blair | e86abe1 | 2017-08-04 14:46:00 -0700 | [diff] [blame] | 39 | |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 40 | The Zuul scheduler communicates with Nodepool via the ZooKeeper |
| 41 | protocol. Nodepool requires an external ZooKeeper cluster, and the |
| 42 | Zuul scheduler needs to be able to connect to the hosts in that |
| 43 | cluster on TCP port 2181. |
| 44 | |
| 45 | Both the Nodepool launchers and Zuul executors need to be able to |
| 46 | communicate with the hosts which nodepool provides. If these are on |
| 47 | private networks, the Executors will need to be able to route traffic |
| 48 | to them. |
| 49 | |
| 50 | If statsd is enabled, every service needs to be able to emit data to |
| 51 | statsd. Statsd can be configured to run on each host and forward |
| 52 | data, or services may emit to a centralized statsd collector. Statsd |
| 53 | listens on UDP port 8125 by default. |
James E. Blair | e86abe1 | 2017-08-04 14:46:00 -0700 | [diff] [blame] | 54 | |
| 55 | All Zuul processes read the ``/etc/zuul/zuul.conf`` file (an alternate |
| 56 | location may be supplied on the command line) which uses an INI file |
| 57 | syntax. Each component may have its own configuration file, though |
| 58 | you may find it simpler to use the same file for all components. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 59 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 60 | An example ``zuul.conf``: |
| 61 | |
| 62 | .. code-block:: ini |
| 63 | |
| 64 | [gearman] |
| 65 | server=localhost |
| 66 | |
| 67 | [gearman_server] |
| 68 | start=true |
| 69 | log_config=/etc/zuul/gearman-logging.yaml |
| 70 | |
| 71 | [zookeeper] |
| 72 | hosts=zk1.example.com,zk2.example.com,zk3.example.com |
| 73 | |
Tobias Henkel | 940da00 | 2018-01-23 12:17:27 +0100 | [diff] [blame] | 74 | [web] |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 75 | status_url=https://zuul.example.com/status |
| 76 | |
| 77 | [scheduler] |
| 78 | log_config=/etc/zuul/scheduler-logging.yaml |
| 79 | |
| 80 | A minimal Zuul system may consist of a :ref:`scheduler` and |
| 81 | :ref:`executor` both running on the same host. Larger installations |
| 82 | should consider running multiple executors, each on a dedicated host, |
| 83 | and running mergers on dedicated hosts as well. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 84 | |
| 85 | Common |
| 86 | ------ |
| 87 | |
| 88 | The following applies to all Zuul components. |
| 89 | |
| 90 | Configuration |
| 91 | ~~~~~~~~~~~~~ |
| 92 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 93 | The following sections of ``zuul.conf`` are used by all Zuul components: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 94 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 95 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 96 | .. attr:: gearman |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 97 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 98 | Client connection information for Gearman. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 99 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 100 | .. attr:: server |
| 101 | :required: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 102 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 103 | Hostname or IP address of the Gearman server. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 104 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 105 | .. attr:: port |
| 106 | :default: 4730 |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 107 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 108 | Port on which the Gearman server is listening. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 109 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 110 | .. attr:: ssl_ca |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 111 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 112 | An openssl file containing a set of concatenated “certification |
| 113 | authority” certificates in PEM formet. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 114 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 115 | .. attr:: ssl_cert |
| 116 | |
| 117 | An openssl file containing the client public certificate in PEM format. |
| 118 | |
| 119 | .. attr:: ssl_key |
| 120 | |
| 121 | An openssl file containing the client private key in PEM format. |
James E. Blair | fdb111d | 2017-06-23 20:56:05 +0100 | [diff] [blame] | 122 | |
James E. Blair | ded241e | 2017-10-10 13:22:40 -0700 | [diff] [blame] | 123 | .. attr:: statsd |
| 124 | |
| 125 | Information about the optional statsd server. If the ``statsd`` |
| 126 | python module is installed and this section is configured, |
| 127 | statistics will be reported to statsd. See :ref:`statsd` for more |
| 128 | information. |
| 129 | |
| 130 | .. attr:: server |
| 131 | |
| 132 | Hostname or IP address of the statsd server. |
| 133 | |
| 134 | .. attr:: port |
| 135 | :default: 8125 |
| 136 | |
| 137 | The UDP port on which the statsd server is listening. |
| 138 | |
| 139 | .. attr:: prefix |
| 140 | |
| 141 | If present, this will be prefixed to all of the keys before |
| 142 | transmitting to the statsd server. |
| 143 | |
James E. Blair | 4f3e622 | 2017-07-05 14:52:08 -0700 | [diff] [blame] | 144 | .. NOTE: this is a white lie at this point, since only the scheduler |
| 145 | uses this, however, we expect other components to use it later, so |
| 146 | it's reasonable for admins to plan for this now. |
| 147 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 148 | .. attr:: zookeeper |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 149 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 150 | Client connection information for ZooKeeper |
James E. Blair | fdb111d | 2017-06-23 20:56:05 +0100 | [diff] [blame] | 151 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 152 | .. attr:: hosts |
| 153 | :required: |
| 154 | |
| 155 | A list of zookeeper hosts for Zuul to use when communicating |
| 156 | with Nodepool. |
| 157 | |
James E. Blair | e2f0a87 | 2017-09-28 10:35:12 -0700 | [diff] [blame] | 158 | .. attr:: session_timeout |
| 159 | :default: 10.0 |
| 160 | |
| 161 | The ZooKeeper session timeout, in seconds. |
| 162 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 163 | |
| 164 | .. _scheduler: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 165 | |
| 166 | Scheduler |
| 167 | --------- |
| 168 | |
| 169 | The scheduler is the primary component of Zuul. The scheduler is not |
| 170 | a scalable component; one, and only one, scheduler must be running at |
| 171 | all times for Zuul to be operational. It receives events from any |
| 172 | connections to remote systems which have been configured, enqueues |
| 173 | items into pipelines, distributes jobs to executors, and reports |
| 174 | results. |
| 175 | |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 176 | The scheduler includes a Gearman server which is used to communicate |
| 177 | with other components of Zuul. It is possible to use an external |
| 178 | Gearman server, but the built-in server is well-tested and |
| 179 | recommended. If the built-in server is used, other Zuul hosts will |
| 180 | need to be able to connect to the scheduler on the Gearman port, TCP |
| 181 | port 4730. It is also strongly recommended to use SSL certs with |
| 182 | Gearman, as secrets are transferred from the scheduler to executors |
| 183 | over this link. |
| 184 | |
| 185 | The scheduler must be able to connect to the ZooKeeper cluster used by |
| 186 | Nodepool in order to request nodes. It does not need to connect |
| 187 | directly to the nodes themselves, however -- that function is handled |
| 188 | by the Executors. |
| 189 | |
| 190 | It must also be able to connect to any services for which connections |
| 191 | are configured (Gerrit, GitHub, etc). |
| 192 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 193 | Configuration |
| 194 | ~~~~~~~~~~~~~ |
| 195 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 196 | The following sections of ``zuul.conf`` are used by the scheduler: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 197 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 198 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 199 | .. attr:: gearman_server |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 200 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 201 | The builtin gearman server. Zuul can fork a gearman process from |
| 202 | itself rather than connecting to an external one. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 203 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 204 | .. attr:: start |
| 205 | :default: false |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 206 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 207 | Whether to start the internal Gearman server. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 208 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 209 | .. attr:: listen_address |
| 210 | :default: all addresses |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 211 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 212 | IP address or domain name on which to listen. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 213 | |
Tristan Cacqueray | a7586c9 | 2017-08-29 10:10:08 +0000 | [diff] [blame] | 214 | .. attr:: port |
| 215 | :default: 4730 |
| 216 | |
| 217 | TCP port on which to listen. |
| 218 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 219 | .. attr:: log_config |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 220 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 221 | Path to log config file for internal Gearman server. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 222 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 223 | .. attr:: ssl_ca |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 224 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 225 | An openssl file containing a set of concatenated “certification |
| 226 | authority” certificates in PEM formet. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 227 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 228 | .. attr:: ssl_cert |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 229 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 230 | An openssl file containing the server public certificate in PEM |
| 231 | format. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 232 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 233 | .. attr:: ssl_key |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 234 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 235 | An openssl file containing the server private key in PEM format. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 236 | |
Tobias Henkel | 940da00 | 2018-01-23 12:17:27 +0100 | [diff] [blame] | 237 | .. attr:: web |
| 238 | |
| 239 | .. attr:: status_url |
| 240 | |
| 241 | URL that will be posted in Zuul comments made to changes when |
| 242 | starting jobs for a change. |
| 243 | |
| 244 | .. TODO: is this effectively required? |
| 245 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 246 | .. attr:: scheduler |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 247 | |
Paul Belanger | 40d3ce6 | 2017-11-28 11:49:55 -0500 | [diff] [blame] | 248 | .. attr:: command_socket |
| 249 | :default: /var/lib/zuul/scheduler.socket |
| 250 | |
| 251 | Path to command socket file for the scheduler process. |
| 252 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 253 | .. attr:: tenant_config |
| 254 | :required: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 255 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 256 | Path to :ref:`tenant-config` file. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 257 | |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 258 | .. attr:: log_config |
| 259 | |
| 260 | Path to log config file. |
| 261 | |
| 262 | .. attr:: pidfile |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 263 | :default: /var/run/zuul-schedurecr/zuul-scheduler.pid |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 264 | |
| 265 | Path to PID lock file. |
| 266 | |
| 267 | .. attr:: state_dir |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 268 | :default: /var/lib/zuul |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 269 | |
| 270 | Path to directory in which Zuul should save its state. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 271 | |
| 272 | Operation |
| 273 | ~~~~~~~~~ |
| 274 | |
| 275 | To start the scheduler, run ``zuul-scheduler``. To stop it, kill the |
| 276 | PID which was saved in the pidfile specified in the configuration. |
| 277 | |
| 278 | Most of Zuul's configuration is automatically updated as changes to |
| 279 | the repositories which contain it are merged. However, Zuul must be |
| 280 | explicitly notified of changes to the tenant config file, since it is |
| 281 | not read from a git repository. To do so, send the scheduler PID |
James E. Blair | 9794019 | 2017-08-03 14:47:47 -0700 | [diff] [blame] | 282 | (saved in the pidfile specified in the configuration) a `SIGHUP` |
| 283 | signal. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 284 | |
| 285 | Merger |
| 286 | ------ |
| 287 | |
| 288 | Mergers are an optional Zuul service; they are not required for Zuul |
| 289 | to operate, but some high volume sites may benefit from running them. |
| 290 | Zuul performs quite a lot of git operations in the course of its work. |
| 291 | Each change that is to be tested must be speculatively merged with the |
| 292 | current state of its target branch to ensure that it can merge, and to |
| 293 | ensure that the tests that Zuul perform accurately represent the |
| 294 | outcome of merging the change. Because Zuul's configuration is stored |
| 295 | in the git repos it interacts with, and is dynamically evaluated, Zuul |
| 296 | often needs to perform a speculative merge in order to determine |
| 297 | whether it needs to perform any further actions. |
| 298 | |
| 299 | All of these git operations add up, and while Zuul executors can also |
| 300 | perform them, large numbers may impact their ability to run jobs. |
| 301 | Therefore, administrators may wish to run standalone mergers in order |
| 302 | to reduce the load on executors. |
| 303 | |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 304 | Mergers need to be able to connect to the Gearman server (usually the |
| 305 | scheduler host) as well as any services for which connections are |
| 306 | configured (Gerrit, GitHub, etc). |
| 307 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 308 | Configuration |
| 309 | ~~~~~~~~~~~~~ |
| 310 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 311 | The following section of ``zuul.conf`` is used by the merger: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 312 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 313 | .. attr:: merger |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 314 | |
David Shrewsbury | fe1f194 | 2017-12-04 13:57:46 -0500 | [diff] [blame] | 315 | .. attr:: command_socket |
Paul Belanger | 7650611 | 2017-11-27 14:10:30 -0500 | [diff] [blame] | 316 | :default: /var/lib/zuul/merger.socket |
| 317 | |
| 318 | Path to command socket file for the merger process. |
| 319 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 320 | .. attr:: git_dir |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 321 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 322 | Directory in which Zuul should clone git repositories. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 323 | |
Paul Belanger | edadfed | 2017-10-05 16:04:27 -0400 | [diff] [blame] | 324 | .. attr:: git_http_low_speed_limit |
| 325 | :default: 1000 |
| 326 | |
| 327 | If the HTTP transfer speed is less then git_http_low_speed_limit for |
| 328 | longer then git_http_low_speed_time, the transfer is aborted. |
| 329 | |
| 330 | Value in bytes, setting to 0 will disable. |
| 331 | |
| 332 | .. attr:: git_http_low_speed_time |
| 333 | :default: 30 |
| 334 | |
| 335 | If the HTTP transfer speed is less then git_http_low_speed_limit for |
| 336 | longer then git_http_low_speed_time, the transfer is aborted. |
| 337 | |
| 338 | Value in seconds, setting to 0 will disable. |
| 339 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 340 | .. attr:: git_user_email |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 341 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 342 | Value to pass to `git config user.email |
| 343 | <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 344 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 345 | .. attr:: git_user_name |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 346 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 347 | Value to pass to `git config user.name |
| 348 | <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 349 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 350 | .. attr:: log_config |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 351 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 352 | Path to log config file for the merger process. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 353 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 354 | .. attr:: pidfile |
| 355 | :default: /var/run/zuul-merger/zuul-merger.pid |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 356 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 357 | Path to PID lock file for the merger process. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 358 | |
| 359 | Operation |
| 360 | ~~~~~~~~~ |
| 361 | |
| 362 | To start the merger, run ``zuul-merger``. To stop it, kill the |
| 363 | PID which was saved in the pidfile specified in the configuration. |
| 364 | |
David Shrewsbury | b040b0a | 2017-08-03 15:53:59 -0400 | [diff] [blame] | 365 | .. _executor: |
| 366 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 367 | Executor |
| 368 | -------- |
| 369 | |
| 370 | Executors are responsible for running jobs. At the start of each job, |
| 371 | an executor prepares an environment in which to run Ansible which |
| 372 | contains all of the git repositories specified by the job with all |
| 373 | dependent changes merged into their appropriate branches. The branch |
| 374 | corresponding to the proposed change will be checked out (in all |
| 375 | projects, if it exists). Any roles specified by the job will also be |
| 376 | present (also with dependent changes merged, if appropriate) and added |
| 377 | to the Ansible role path. The executor also prepares an Ansible |
| 378 | inventory file with all of the nodes requested by the job. |
| 379 | |
| 380 | The executor also contains a merger. This is used by the executor to |
| 381 | prepare the git repositories used by jobs, but is also available to |
| 382 | perform any tasks normally performed by standalone mergers. Because |
| 383 | the executor performs both roles, small Zuul installations may not |
| 384 | need to run standalone mergers. |
| 385 | |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 386 | Executors need to be able to connect to the Gearman server (usually |
| 387 | the scheduler host), any services for which connections are configured |
| 388 | (Gerrit, GitHub, etc), as well as directly to the hosts which Nodepool |
| 389 | provides. |
| 390 | |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 391 | Trusted and Untrusted Playbooks |
| 392 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 393 | |
| 394 | The executor runs playbooks in one of two execution contexts depending |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 395 | on whether the project containing the playbook is a |
| 396 | :term:`config-project` or an :term:`untrusted-project`. If the |
| 397 | playbook is in a config project, the executor runs the playbook in the |
| 398 | *trusted* execution context, otherwise, it is run in the *untrusted* |
| 399 | execution context. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 400 | |
Clint Byrum | 48b5a67 | 2017-08-18 14:44:00 -0700 | [diff] [blame] | 401 | Both execution contexts use `bubblewrap`_ [#nullwrap]_ to create a |
| 402 | namespace to ensure that playbook executions are isolated and are unable |
| 403 | to access files outside of a restricted environment. The administrator |
| 404 | may configure additional local directories on the executor to be made |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 405 | available to the restricted environment. |
| 406 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 407 | The trusted execution context has access to all Ansible features, |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 408 | including the ability to load custom Ansible modules. Needless to |
| 409 | say, extra scrutiny should be given to code that runs in a trusted |
| 410 | context as it could be used to compromise other jobs running on the |
| 411 | executor, or the executor itself, especially if the administrator has |
| 412 | granted additional access through bubblewrap, or a method of escaping |
| 413 | the restricted environment created by bubblewrap is found. |
| 414 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 415 | Playbooks run in the untrusted execution context are not permitted to |
| 416 | load additional Ansible modules or access files outside of the |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 417 | restricted environment prepared for them by the executor. In addition |
| 418 | to the bubblewrap environment applied to both execution contexts, in |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 419 | the untrusted context some standard Ansible modules are replaced with |
| 420 | versions which prohibit some actions, including attempts to access |
| 421 | files outside of the restricted execution context. These redundant |
| 422 | protections are made as part of a defense-in-depth strategy. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 423 | |
| 424 | .. _bubblewrap: https://github.com/projectatomic/bubblewrap |
Clint Byrum | 48b5a67 | 2017-08-18 14:44:00 -0700 | [diff] [blame] | 425 | .. [#nullwrap] Unless one has set execution_wrapper to nullwrap in the |
| 426 | executor configuration. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 427 | |
| 428 | Configuration |
| 429 | ~~~~~~~~~~~~~ |
| 430 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 431 | The following sections of ``zuul.conf`` are used by the executor: |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 432 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 433 | .. attr:: executor |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 434 | |
Paul Belanger | 2092091 | 2017-11-28 11:22:30 -0500 | [diff] [blame] | 435 | .. attr:: command_socket |
| 436 | :default: /var/lib/zuul/executor.socket |
| 437 | |
| 438 | Path to command socket file for the executor process. |
| 439 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 440 | .. attr:: finger_port |
David Shrewsbury | 93eb56d | 2018-01-10 11:50:03 -0500 | [diff] [blame] | 441 | :default: 7900 |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 442 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 443 | Port to use for finger log streamer. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 444 | |
James E. Blair | 73f9f1f | 2018-02-08 13:07:13 -0800 | [diff] [blame] | 445 | .. attr:: state_dir |
| 446 | :default: /var/lib/zuul |
| 447 | |
| 448 | Path to directory in which Zuul should save its state. |
| 449 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 450 | .. attr:: git_dir |
| 451 | :default: /var/lib/zuul/git |
James E. Blair | 7e6e0a1 | 2017-07-25 11:04:42 -0700 | [diff] [blame] | 452 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 453 | Directory that Zuul should clone local git repositories to. The |
| 454 | executor keeps a local copy of every git repository it works |
| 455 | with to speed operations and perform speculative merging. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 456 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 457 | This should be on the same filesystem as |
| 458 | :attr:`executor.job_dir` so that when git repos are cloned into |
| 459 | the job workspaces, they can be hard-linked to the local git |
| 460 | cache. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 461 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 462 | .. attr:: job_dir |
| 463 | :default: /tmp |
James E. Blair | 7e6e0a1 | 2017-07-25 11:04:42 -0700 | [diff] [blame] | 464 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 465 | Directory that Zuul should use to hold temporary job directories. |
| 466 | When each job is run, a new entry will be created under this |
| 467 | directory to hold the configuration and scratch workspace for |
| 468 | that job. It will be deleted at the end of the job (unless the |
| 469 | `--keep-jobdir` command line option is specified). |
James E. Blair | 7e6e0a1 | 2017-07-25 11:04:42 -0700 | [diff] [blame] | 470 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 471 | This should be on the same filesystem as :attr:`executor.git_dir` |
| 472 | so that when git repos are cloned into the job workspaces, they |
| 473 | can be hard-linked to the local git cache. |
James E. Blair | 7e6e0a1 | 2017-07-25 11:04:42 -0700 | [diff] [blame] | 474 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 475 | .. attr:: log_config |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 476 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 477 | Path to log config file for the executor process. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 478 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 479 | .. attr:: pidfile |
| 480 | :default: /var/run/zuul-executor/zuul-executor.pid |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 481 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 482 | Path to PID lock file for the executor process. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 483 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 484 | .. attr:: private_key_file |
| 485 | :default: ~/.ssh/id_rsa |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 486 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 487 | SSH private key file to be used when logging into worker nodes. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 488 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 489 | .. _admin_sitewide_variables: |
Jamie Lennox | 7655b55 | 2017-03-17 12:33:38 +1100 | [diff] [blame] | 490 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 491 | .. attr:: variables |
Jamie Lennox | 7655b55 | 2017-03-17 12:33:38 +1100 | [diff] [blame] | 492 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 493 | Path to an Ansible variables file to supply site-wide variables. |
| 494 | This should be a YAML-formatted file consisting of a single |
| 495 | dictionary. The contents will be made available to all jobs as |
| 496 | Ansible variables. These variables take precedence over all |
| 497 | other forms (job variables and secrets). Care should be taken |
| 498 | when naming these variables to avoid potential collisions with |
| 499 | those used by jobs. Prefixing variable names with a |
| 500 | site-specific identifier is recommended. The default is not to |
| 501 | add any site-wide variables. See the :ref:`User's Guide |
| 502 | <user_sitewide_variables>` for more information. |
Clint Byrum | dc8a090 | 2017-07-20 16:36:27 -0700 | [diff] [blame] | 503 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 504 | .. attr:: disk_limit_per_job |
| 505 | :default: 250 |
Clint Byrum | dc8a090 | 2017-07-20 16:36:27 -0700 | [diff] [blame] | 506 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 507 | This integer is the maximum number of megabytes that any one job |
| 508 | is allowed to consume on disk while it is running. If a job's |
| 509 | scratch space has more than this much space consumed, it will be |
| 510 | aborted. |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 511 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 512 | .. attr:: trusted_ro_paths |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 513 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 514 | List of paths, separated by ``:`` to read-only bind mount into |
| 515 | trusted bubblewrap contexts. |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 516 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 517 | .. attr:: trusted_rw_paths |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 518 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 519 | List of paths, separated by ``:`` to read-write bind mount into |
| 520 | trusted bubblewrap contexts. |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 521 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 522 | .. attr:: untrusted_ro_paths |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 523 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 524 | List of paths, separated by ``:`` to read-only bind mount into |
| 525 | untrusted bubblewrap contexts. |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 526 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 527 | .. attr:: untrusted_rw_paths |
Monty Taylor | 01380dd | 2017-07-28 16:01:20 -0500 | [diff] [blame] | 528 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 529 | List of paths, separated by ``:`` to read-write bind mount into |
| 530 | untrusted bubblewrap contexts. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 531 | |
Clint Byrum | 48b5a67 | 2017-08-18 14:44:00 -0700 | [diff] [blame] | 532 | .. attr:: execution_wrapper |
| 533 | :default: bubblewrap |
| 534 | |
| 535 | Name of the execution wrapper to use when executing |
| 536 | `ansible-playbook`. The default, `bubblewrap` is recommended for |
| 537 | all installations. |
| 538 | |
| 539 | There is also a `nullwrap` driver for situations where one wants |
| 540 | to run Zuul without access to bubblewrap or in such a way that |
| 541 | bubblewrap may interfere with the jobs themselves. However, |
| 542 | `nullwrap` is considered unsafe, as `bubblewrap` provides |
| 543 | significant protections against malicious users and accidental |
| 544 | breakage in playbooks. As such, `nullwrap` is not recommended |
| 545 | for use in production. |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 546 | |
Clint Byrum | 48b5a67 | 2017-08-18 14:44:00 -0700 | [diff] [blame] | 547 | This option, and thus, `nullwrap`, may be removed in the future. |
| 548 | `bubblewrap` has become integral to securely operating Zuul. If you |
| 549 | have a valid use case for it, we encourage you to let us know. |
| 550 | |
Clint Byrum | 3cef7ed | 2017-09-29 20:18:54 -0700 | [diff] [blame] | 551 | .. attr:: load_multiplier |
| 552 | :default: 2.5 |
| 553 | |
| 554 | When an executor host gets too busy, the system may suffer |
| 555 | timeouts and other ill effects. The executor will stop accepting |
| 556 | more than 1 job at a time until load has lowered below a safe |
| 557 | level. This level is determined by multiplying the number of |
| 558 | CPU's by `load_multiplier`. |
| 559 | |
| 560 | So for example, if the system has 2 CPUs, and load_multiplier |
| 561 | is 2.5, the safe load for the system is 5.00. Any time the |
| 562 | system load average is over 5.00, the executor will quit |
| 563 | accepting multiple jobs at one time. |
| 564 | |
| 565 | The executor will observe system load and determine whether |
| 566 | to accept more jobs every 30 seconds. |
| 567 | |
Paul Belanger | 1754b2c | 2018-01-08 16:24:57 -0500 | [diff] [blame] | 568 | .. attr:: min_avail_mem |
| 569 | :default: 5.0 |
| 570 | |
| 571 | This is the minimum percentage of system RAM available. The |
| 572 | executor will stop accepting more than 1 job at a time until |
| 573 | more memory is available. The available memory percentage is |
| 574 | calculated from the total available memory divided by the |
| 575 | total real memory multiplied by 100. Buffers and cache are |
| 576 | considered available in the calculation. |
| 577 | |
Tobias Henkel | 055cda3 | 2017-10-17 13:08:18 +0200 | [diff] [blame] | 578 | .. attr:: hostname |
| 579 | :default: hostname of the server |
| 580 | |
| 581 | The executor needs to know its hostname under which it is reachable by |
| 582 | zuul-web. Otherwise live console log streaming doesn't work. In most cases |
| 583 | This is automatically detected correctly. But when running in environments |
| 584 | where it cannot determine its hostname correctly this can be overridden |
| 585 | here. |
| 586 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 587 | .. attr:: merger |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 588 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 589 | .. attr:: git_user_email |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 590 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 591 | Value to pass to `git config user.email |
| 592 | <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_. |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 593 | |
James E. Blair | 9d0b4cc | 2017-08-03 15:08:47 -0700 | [diff] [blame] | 594 | .. attr:: git_user_name |
| 595 | |
| 596 | Value to pass to `git config user.name |
| 597 | <https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>`_. |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 598 | |
| 599 | Operation |
| 600 | ~~~~~~~~~ |
| 601 | |
| 602 | To start the executor, run ``zuul-executor``. |
| 603 | |
| 604 | There are several commands which can be run to control the executor's |
| 605 | behavior once it is running. |
| 606 | |
| 607 | To stop the executor immediately, aborting all jobs (they may be |
| 608 | relaunched according to their retry policy), run ``zuul-executor |
| 609 | stop``. |
| 610 | |
| 611 | To request that the executor stop executing new jobs and exit when all |
| 612 | currently running jobs have completed, run ``zuul-executor graceful``. |
| 613 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 614 | To enable or disable running Ansible in verbose mode (with the |
| 615 | ``-vvv`` argument to ansible-playbook) run ``zuul-executor verbose`` |
| 616 | and ``zuul-executor unverbose``. |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 617 | |
| 618 | Web Server |
| 619 | ---------- |
| 620 | |
| 621 | The Zuul web server currently acts as a websocket interface to live log |
| 622 | streaming. Eventually, it will serve as the single process handling all |
| 623 | HTTP interactions with Zuul. |
| 624 | |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 625 | Web servers need to be able to connect to the Gearman server (usually |
| 626 | the scheduler host). If the SQL reporter is used, they need to be |
| 627 | able to connect to the database it reports to in order to support the |
| 628 | dashboard. If a GitHub connection is configured, they need to be |
| 629 | reachable by GitHub so they may receive notifications. |
| 630 | |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 631 | Configuration |
| 632 | ~~~~~~~~~~~~~ |
| 633 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 634 | In addition to the common configuration sections, the following |
| 635 | sections of ``zuul.conf`` are used by the web server: |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 636 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 637 | .. attr:: web |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 638 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 639 | .. attr:: listen_address |
| 640 | :default: 127.0.0.1 |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 641 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 642 | IP address or domain name on which to listen. |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 643 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 644 | .. attr:: log_config |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 645 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 646 | Path to log config file for the web server process. |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 647 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 648 | .. attr:: pidfile |
| 649 | :default: /var/run/zuul-web/zuul-web.pid |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 650 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 651 | Path to PID lock file for the web server process. |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 652 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 653 | .. attr:: port |
| 654 | :default: 9000 |
David Shrewsbury | 6b3b49b | 2017-07-11 13:00:38 -0400 | [diff] [blame] | 655 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 656 | Port to use for web server process. |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 657 | |
James E. Blair | afe27e6 | 2017-08-03 15:11:47 -0700 | [diff] [blame] | 658 | .. attr:: websocket_url |
| 659 | |
| 660 | Base URL on which the websocket service is exposed, if different |
| 661 | than the base URL of the web app. |
Tobias Henkel | b4407fc | 2017-07-07 13:52:56 +0200 | [diff] [blame] | 662 | |
Tristan Cacqueray | 3c2d39d | 2017-11-29 05:36:55 +0000 | [diff] [blame] | 663 | .. attr:: static_cache_expiry |
| 664 | :default: 3600 |
| 665 | |
| 666 | The Cache-Control max-age response header value for static files served |
| 667 | by the zuul-web. Set to 0 during development to disable Cache-Control. |
| 668 | |
David Shrewsbury | ae734d1 | 2017-07-11 12:41:59 -0400 | [diff] [blame] | 669 | Operation |
| 670 | ~~~~~~~~~ |
| 671 | |
| 672 | To start the web server, run ``zuul-web``. To stop it, kill the |
| 673 | PID which was saved in the pidfile specified in the configuration. |
David Shrewsbury | fe1f194 | 2017-12-04 13:57:46 -0500 | [diff] [blame] | 674 | |
| 675 | Finger Gateway |
| 676 | -------------- |
| 677 | |
David Shrewsbury | ae3d96b | 2017-12-13 13:01:46 -0500 | [diff] [blame] | 678 | The Zuul finger gateway listens on the standard finger port (79) for |
| 679 | finger requests specifying a build UUID for which it should stream log |
David Shrewsbury | fe1f194 | 2017-12-04 13:57:46 -0500 | [diff] [blame] | 680 | results. The gateway will determine which executor is currently running that |
| 681 | build and query that executor for the log stream. |
| 682 | |
| 683 | This is intended to be used with the standard finger command line client. |
| 684 | For example:: |
| 685 | |
| 686 | finger UUID@zuul.example.com |
| 687 | |
| 688 | The above would stream the logs for the build identified by `UUID`. |
| 689 | |
James E. Blair | 60d880a | 2018-01-17 08:50:10 -0800 | [diff] [blame] | 690 | Finger gateway servers need to be able to connect to the Gearman |
| 691 | server (usually the scheduler host), as well as the console streaming |
| 692 | port on the executors (usually 7900). |
| 693 | |
David Shrewsbury | fe1f194 | 2017-12-04 13:57:46 -0500 | [diff] [blame] | 694 | Configuration |
| 695 | ~~~~~~~~~~~~~ |
| 696 | |
| 697 | In addition to the common configuration sections, the following |
| 698 | sections of ``zuul.conf`` are used by the finger gateway: |
| 699 | |
| 700 | .. attr:: fingergw |
| 701 | |
| 702 | .. attr:: command_socket |
| 703 | :default: /var/lib/zuul/fingergw.socket |
| 704 | |
| 705 | Path to command socket file for the executor process. |
| 706 | |
| 707 | .. attr:: listen_address |
| 708 | :default: all addresses |
| 709 | |
| 710 | IP address or domain name on which to listen. |
| 711 | |
| 712 | .. attr:: log_config |
| 713 | |
| 714 | Path to log config file for the finger gateway process. |
| 715 | |
| 716 | .. attr:: pidfile |
| 717 | :default: /var/run/zuul-fingergw/zuul-fingergw.pid |
| 718 | |
| 719 | Path to PID lock file for the finger gateway process. |
| 720 | |
| 721 | .. attr:: port |
| 722 | :default: 79 |
| 723 | |
| 724 | Port to use for the finger gateway. Note that since command line |
| 725 | finger clients cannot usually specify the port, leaving this set to |
| 726 | the default value is highly recommended. |
| 727 | |
| 728 | .. attr:: user |
| 729 | :default: zuul |
| 730 | |
| 731 | User ID for the zuul-fingergw process. In normal operation as a |
| 732 | daemon, the finger gateway should be started as the ``root`` user, but |
| 733 | it will drop privileges to this user during startup. |
| 734 | |
| 735 | Operation |
| 736 | ~~~~~~~~~ |
| 737 | |
| 738 | To start the finger gateway, run ``zuul-fingergw``. To stop it, kill the |
| 739 | PID which was saved in the pidfile specified in the configuration. |