blob: f3fd4af0b50c8a4994bf3809df16c5a3486112b0 [file] [log] [blame]
Joshua Hesketh05d01582013-09-09 15:16:08 +10001:title: Installation
2
3.. _gearman: http://gearman.org/
4.. _zuul: http://ci.openstack.org/zuul/
5
Joshua Hesketha74f49d2013-09-06 15:52:49 +10006Installation
7============
8
Lana Brindleyec7637a2014-01-17 13:32:17 +10009Turbo-hipster is installed directly into your Python ``site-packages``
10directory, and is then run as a service. It is managed using a configuration
Lana Brindleyf0c55192014-01-20 17:24:37 +100011file, which is in json format.
Joshua Hesketh05d01582013-09-09 15:16:08 +100012
Lana Brindleyec7637a2014-01-17 13:32:17 +100013Installing turbo-hipster
14------------------------
Joshua Hesketh05d01582013-09-09 15:16:08 +100015
Lana Brindleyf0c55192014-01-20 17:24:37 +1000161. Turbo-hipster can be installed directly to your Python ``site-packages``
17directory:
Joshua Hesketh05d01582013-09-09 15:16:08 +100018
Lana Brindleyec7637a2014-01-17 13:32:17 +100019 $ sudo python setup.py install
Joshua Hesketh05d01582013-09-09 15:16:08 +100020
Lana Brindleyec7637a2014-01-17 13:32:17 +1000212. Copy the configuration file to a convenient location. By default,
Lana Brindleyf0c55192014-01-20 17:24:37 +100022turbo-hipster will look in ``/etc/turbo-hipster/config.json``:
Joshua Hesketh05d01582013-09-09 15:16:08 +100023
Lana Brindleyec7637a2014-01-17 13:32:17 +100024 $ cp -R etc/turbo-hipster /etc/
Joshua Hesketh05d01582013-09-09 15:16:08 +100025
Lana Brindleyf0c55192014-01-20 17:24:37 +1000263. The turbo-hipster configuration file is in json format. Open the
Lana Brindleyec7637a2014-01-17 13:32:17 +100027``config.json`` configuration file in your preferred editor and modify it
28for your environment::
Joshua Hesketh05d01582013-09-09 15:16:08 +100029
Lana Brindleyec7637a2014-01-17 13:32:17 +100030 **zuul_server**
31 A dictionary containing details about how to communicate
32 with zuul
33 **git_url**
34 The publicly accessible protocol and URI from where
35 to clone projects and zuul_ references from. For
36 example::
37 http://review.openstack.org/p/
38 or::
39 git://review.example.org
40 **gearman_host**
41 The host of gearman_. zuul talks to its workers via
42 the gearman protocol and while it comes with a built-
43 in gearman server you can use a separate one.
44 **gearman_port**
45 The port that gearman listens on.
46 **debug_log**
47 A path to the debug log. Turbo-hipster will attempt to create
48 the file but must have write permissions.
49 **jobs_working_dir**
50 Each job will likely need to write out log and debug
51 information. This defines where turbo-hipster will do that.
52 **git_working_dir**
53 turbo-hipster needs to take a copy of the git tree of a
54 project to work from. This is the path it'll clone into and
55 work from (if needed).
56 **pip_download_cache**
57 Some of turbo-hipsters task plugins download requirements
58 for projects. This is the cache directory used by pip.
59 **plugins**
60 A list of enabled plugins and their settings in a dictionary.
61 The only required parameters are *name*, which should be the
62 same as the folder containing the plugin module, and
63 *function*, which is the function registered with zuul.
64 Any other parameters are specified by the plugin themselves
65 as required.
66 **publish_logs**
67 Log results from plugins can be published using multiple
68 methods. Currently only a local copy is fully implemented.
69 **type**
70 The type of protocol to copy the log to. eg 'local'
71 **path**
72 A type specific parameter defining the local location
73 destination.
74 **prepend_url**
75 What to prepend to the path when sending the result
76 URL back to zuul. This can be useful as you may want
77 to use a script to authenticate against a swift
78 account or to use *laughing_spice* to format the logs
79 etc.
Joshua Hesketh05d01582013-09-09 15:16:08 +100080
Lana Brindleyec7637a2014-01-17 13:32:17 +1000814. Create a turbo-hipster user:
Joshua Hesketh05d01582013-09-09 15:16:08 +100082
Lana Brindleyec7637a2014-01-17 13:32:17 +100083 $ useradd turbo-hipster
Joshua Hesketh05d01582013-09-09 15:16:08 +100084
Lana Brindleyec7637a2014-01-17 13:32:17 +1000855. Create the directories listed in the configuration file, and give the
Lana Brindleyf0c55192014-01-20 17:24:37 +100086``turbo-hipster`` user write access:
Joshua Hesketh05d01582013-09-09 15:16:08 +100087
Lana Brindleyec7637a2014-01-17 13:32:17 +100088 $ mkdir -p /var/log/turbo-hipster/
89 $ chown turbo-hipster:turbo-hipster /var/log/turbo-hipster/
Joshua Hesketh05d01582013-09-09 15:16:08 +100090
Lana Brindleyec7637a2014-01-17 13:32:17 +100091 $ mkdir -p /var/lib/turbo-hipster/jobs
92 $ chown turbo-hipster:turbo-hipster /var/lib/turbo-hipster/jobs
Joshua Hesketh05d01582013-09-09 15:16:08 +100093
Lana Brindleyec7637a2014-01-17 13:32:17 +100094 $ mkdir -p /var/lib/turbo-hipster/git
95 $ chown turbo-hipster:turbo-hipster /var/lib/turbo-hipster/git
Joshua Hesketh05d01582013-09-09 15:16:08 +100096
Lana Brindleyec7637a2014-01-17 13:32:17 +100097 $ mkdir -p /var/cache/pip
98 $ chown turbo-hipster:turbo-hipster /var/cache/pip
Joshua Hesketh05d01582013-09-09 15:16:08 +100099
Lana Brindleyec7637a2014-01-17 13:32:17 +10001006. Open the MySQL log rotation configuration file in your preferred text
Lana Brindleyf0c55192014-01-20 17:24:37 +1000101editor, and edit it to ensure it is writable by ``other``:
Joshua Hesketh05d01582013-09-09 15:16:08 +1000102
Lana Brindleyec7637a2014-01-17 13:32:17 +1000103 $ vim /etc/logrotate.d/mysql-server
104 # edit create 640 to 644.
Joshua Hesketh05d01582013-09-09 15:16:08 +1000105
Lana Brindleyec7637a2014-01-17 13:32:17 +1000106.. note::
107 The turbo-hipster source code is also available for download from
108 the `turbo-hipster github page <https://github.com/rcbau/turbo-hipster/>`_
Joshua Hesketh05d01582013-09-09 15:16:08 +1000109
Lana Brindleyec7637a2014-01-17 13:32:17 +1000110 $ git clone https://github.com/rcbau/turbo-hipster
Joshua Hesketh05d01582013-09-09 15:16:08 +1000111
Lana Brindleyec7637a2014-01-17 13:32:17 +1000112.. note::
113 Debug logging must be configured for turbo-hipster, as it uses the Python
114 logging framework to capture log messages from the task plugin code.
115 To configure debug logging, set the ``debug_log`` configuration
116 setting in the ``config.json`` configuration file.