blob: 82779c67034e12be6e677a6b176f474c57b7bcff [file] [log] [blame]
Thanh Ha33ccffe2016-01-24 21:32:25 -05001Quick Start Guide
2=================
3
4System Requirements
5-------------------
6
7For most deployments zuul only needs 1-2GB. OpenStack uses a 30GB setup.
8
9Install Zuul
10------------
11
12You can get zuul from pypi via::
13
14 pip install zuul
15
16Zuul Components
17---------------
18
19Zuul provides the following components:
20
21 - **zuul-server**: scheduler daemon which communicates with Gerrit and
22 Gearman. Handles receiving events, launching jobs, collecting results
23 and postingreports.
24 - **zuul-merger**: speculative-merger which communicates with Gearman.
25 Prepares Git repositories for jobs to test against. This additionally
26 requires a web server hosting the Git repositories which can be cloned
27 by the jobs.
28 - **zuul-cloner**: client side script used to setup job workspace. It is
29 used to clone the repositories prepared by the zuul-merger described
30 previously.
31 - **gearmand**: optional builtin gearman daemon provided by zuul-server
32
33External components:
34
35 - Jenkins Gearman plugin: Used by Jenkins to connect to Gearman
36
37Zuul Communication
38------------------
39
40All the Zuul components communicate with each other using Gearman. As well as
41the following communication channels:
42
43zuul-server:
44
45 - Gerrit
46 - Gearman Daemon
47
48zuul-merger:
49
50 - Gerrit
51 - Gearman Daemon
52
53zuul-cloner:
54
55 - http hosted zuul-merger git repos
56
57Jenkins:
58
59 - Gearman Daemon via Jenkins Gearman Plugin
60
61Zuul Setup
62----------
63
64At minimum we need to provide **zuul.conf** and **layout.yaml** and placed
65in /etc/zuul/ directory. You will also need a zuul user and ssh key for the
66zuul user in Gerrit. The following example uses the builtin gearmand service
67in zuul.
68
69**zuul.conf**::
70
71 [zuul]
72 layout_config=/etc/zuul/layout.yaml
73
74 [merger]
75 git_dir=/git
76 zuul_url=http://zuul.example.com/p
77
78 [gearman_server]
79 start=true
80
81 [gearman]
82 server=127.0.0.1
83
84 [connection gerrit]
85 driver=gerrit
86 server=git.example.com
87 port=29418
88 baseurl=https://git.example.com/gerrit/
89 user=zuul
90 sshkey=/home/zuul/.ssh/id_rsa
91
92See :doc:`zuul` for more details.
93
94The following sets up a basic timer triggered job using zuul.
95
96**layout.yaml**::
97
98 pipelines:
99 - name: periodic
100 source: gerrit
101 manager: IndependentPipelineManager
102 trigger:
103 timer:
104 - time: '0 * * * *'
105
106 projects:
107 - name: aproject
108 periodic:
109 - aproject-periodic-build
110
111Starting Zuul
112-------------
113
114You can run zuul-server with the **-d** option to make it not daemonize. It's
115a good idea at first to confirm there's no issues with your configuration.
116
117Simply run::
118
119 zuul-server
120
121Once run you should have 2 zuul-server processes::
122
123 zuul 12102 1 0 Jan21 ? 00:15:45 /home/zuul/zuulvenv/bin/python /home/zuul/zuulvenv/bin/zuul-server -d
124 zuul 12107 12102 0 Jan21 ? 00:00:01 /home/zuul/zuulvenv/bin/python /home/zuul/zuulvenv/bin/zuul-server -d
125
126Note: In this example zuul was installed in a virtualenv.
127
128The 2nd zuul-server process is gearmand running if you are using the builtin
129gearmand server, otherwise there will only be 1 process.
130
131Zuul won't actually process your Job queue however unless you also have a
132zuul-merger process running.
133
134Simply run::
135
136 zuul-merger
137
138Zuul should now be able to process your periodic job as configured above once
139the Jenkins side of things is configured.
140
141Jenkins Setup
142-------------
143
144Install the Jenkins Gearman Plugin via Jenkins Plugin management interface.
145Then naviage to **Manage > Configuration > Gearman** and setup the Jenkins
146server hostname/ip and port to connect to gearman.
147
148At this point gearman should be running your Jenkins jobs.
149
150Troubleshooting
151---------------
152
153Checking Gearman function registration (jobs). You can use telnet to connect
154to gearman to check that Jenkins is registering your configured jobs in
155gearman::
156
157 telnet <gearman_ip> 4730
158
159Useful commands are **workers** and **status** which you can run by just
160typing those commands once connected to gearman. Every job in your Jenkins
161master must appear when you run **workers** for Zuul to be able to run jobs
162against your Jenkins instance.