James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 1 | Quick Start Guide |
| 2 | ================= |
| 3 | |
| 4 | This provides a very simple overview of Zuul. It is recommended to |
| 5 | read the following sections for more details. |
| 6 | |
| 7 | Install Zuul |
| 8 | ------------ |
| 9 | |
| 10 | You can get zuul from pypi via:: |
| 11 | |
| 12 | pip install zuul |
| 13 | |
| 14 | Zuul Components |
| 15 | --------------- |
| 16 | |
| 17 | Zuul provides the following components: |
| 18 | |
| 19 | - **zuul-scheduler**: The main Zuul process. Handles receiving |
| 20 | events, executing jobs, collecting results and posting reports. |
| 21 | Coordinates the work of the other components. |
| 22 | |
| 23 | - **zuul-merger**: Scale-out component that performs git merge |
| 24 | operations. Zuul performs a large number of git operations in |
| 25 | the course of its work. Adding merger processes can help speed |
| 26 | Zuul's processing. This component is optional (zero or more of |
| 27 | these can be run). |
| 28 | |
| 29 | - **zuul-executor**: Scale-out component for executing jobs. At |
| 30 | least one of these is required. Depending on system |
| 31 | configuration, you can expect a single executor to handle up to |
| 32 | about 100 simultaneous jobs. Can handle the functions of a |
| 33 | merger if dedicated mergers are not provided. One or more of |
| 34 | these must be run. |
| 35 | |
| 36 | - **gearman**: optional builtin gearman daemon provided by zuul-scheduler |
| 37 | |
| 38 | External components: |
| 39 | |
| 40 | - **gearman**: A gearman daemon if the built-in daemon is not used. |
| 41 | |
| 42 | - **zookeeper**: A zookeeper cluster (or single host) for |
| 43 | communicating with Nodepool. |
| 44 | |
| 45 | - **nodepool**: Provides nodes for Zuul to use when executing jobs. |
| 46 | |
| 47 | |
| 48 | Zuul Setup |
| 49 | ---------- |
| 50 | |
| 51 | At minimum you need to provide **zuul.conf** and **main.yaml** placed |
| 52 | in **/etc/zuul/**. The following example uses the builtin gearman |
| 53 | service in Zuul, and a connection to Gerrit. |
| 54 | |
| 55 | **zuul.conf**:: |
| 56 | |
James E. Blair | 3984036 | 2017-06-23 20:34:02 +0100 | [diff] [blame] | 57 | [scheduler] |
James E. Blair | eff5a9d | 2017-06-20 00:00:37 -0700 | [diff] [blame] | 58 | tenant_config=/etc/zuul/main.yaml |
| 59 | |
| 60 | [gearman_server] |
| 61 | start=true |
| 62 | |
| 63 | [gearman] |
| 64 | server=127.0.0.1 |
| 65 | |
| 66 | [connection gerrit] |
| 67 | driver=gerrit |
| 68 | server=git.example.com |
| 69 | port=29418 |
| 70 | baseurl=https://git.example.com/gerrit/ |
| 71 | user=zuul |
| 72 | sshkey=/home/zuul/.ssh/id_rsa |
| 73 | |
| 74 | See :ref:`components` and :ref:`connections` for more details. |
| 75 | |
| 76 | The following tells Zuul to read its configuration from and operate on |
| 77 | the *example-project* project: |
| 78 | |
| 79 | **main.yaml**:: |
| 80 | |
| 81 | - tenant: |
| 82 | name: example-tenant |
| 83 | source: |
| 84 | gerrit: |
| 85 | untrusted-projects: |
| 86 | - example-project |
| 87 | |
| 88 | Starting Zuul |
| 89 | ------------- |
| 90 | |
| 91 | You can run any zuul process with the **-d** option to make it not |
| 92 | daemonize. It's a good idea at first to confirm there's no issues with |
| 93 | your configuration. |
| 94 | |
| 95 | To start, simply run:: |
| 96 | |
| 97 | zuul-scheduler |
| 98 | |
| 99 | Once run you should have two zuul-scheduler processes (if using the |
| 100 | built-in gearman server, or one process otherwise). |
| 101 | |
| 102 | Before Zuul can run any jobs, it needs to load its configuration, most |
| 103 | of which is in the git repositories that Zuul operates on. Start an |
| 104 | executor to allow zuul to do that:: |
| 105 | |
| 106 | zuul-executor |
| 107 | |
| 108 | Zuul should now be able to read its configuration from the configured |
| 109 | repo and process any jobs defined therein. |
| 110 | |
| 111 | Troubleshooting |
| 112 | --------------- |
| 113 | |
| 114 | You can use telnet to connect to gearman to check which Zuul |
| 115 | components are online:: |
| 116 | |
| 117 | telnet <gearman_ip> 4730 |
| 118 | |
| 119 | Useful commands are **workers** and **status** which you can run by just |
| 120 | typing those commands once connected to gearman. |