Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 1 | :title: Installation |
| 2 | |
| 3 | .. _gearman: http://gearman.org/ |
| 4 | .. _zuul: http://ci.openstack.org/zuul/ |
| 5 | |
Joshua Hesketh | a74f49d | 2013-09-06 15:52:49 +1000 | [diff] [blame] | 6 | Installation |
| 7 | ============ |
| 8 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 9 | Turbo-hipster is installed directly into your Python ``site-packages`` |
| 10 | directory, and is then run as a service. It is managed using a configuration |
Matthew Oliver | 1761669 | 2014-03-13 21:33:55 +1100 | [diff] [blame^] | 11 | file, which is in yaml format. |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 12 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 13 | Installing turbo-hipster |
| 14 | ------------------------ |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 15 | |
Lana Brindley | f0c5519 | 2014-01-20 17:24:37 +1000 | [diff] [blame] | 16 | 1. Turbo-hipster can be installed directly to your Python ``site-packages`` |
| 17 | directory: |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 18 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 19 | $ sudo python setup.py install |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 20 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 21 | 2. Copy the configuration file to a convenient location. By default, |
Matthew Oliver | 1761669 | 2014-03-13 21:33:55 +1100 | [diff] [blame^] | 22 | turbo-hipster will look in ``/etc/turbo-hipster/config.yaml``: |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 23 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 24 | $ cp -R etc/turbo-hipster /etc/ |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 25 | |
Matthew Oliver | 1761669 | 2014-03-13 21:33:55 +1100 | [diff] [blame^] | 26 | 3. The turbo-hipster configuration file is in yaml format. Open the |
| 27 | ``config.yaml`` configuration file in your preferred editor and modify it |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 28 | for your environment:: |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 29 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 30 | **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 Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 80 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 81 | 4. Create a turbo-hipster user: |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 82 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 83 | $ useradd turbo-hipster |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 84 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 85 | 5. Create the directories listed in the configuration file, and give the |
Lana Brindley | f0c5519 | 2014-01-20 17:24:37 +1000 | [diff] [blame] | 86 | ``turbo-hipster`` user write access: |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 87 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 88 | $ mkdir -p /var/log/turbo-hipster/ |
| 89 | $ chown turbo-hipster:turbo-hipster /var/log/turbo-hipster/ |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 90 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 91 | $ mkdir -p /var/lib/turbo-hipster/jobs |
| 92 | $ chown turbo-hipster:turbo-hipster /var/lib/turbo-hipster/jobs |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 93 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 94 | $ mkdir -p /var/lib/turbo-hipster/git |
| 95 | $ chown turbo-hipster:turbo-hipster /var/lib/turbo-hipster/git |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 96 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 97 | $ mkdir -p /var/cache/pip |
| 98 | $ chown turbo-hipster:turbo-hipster /var/cache/pip |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 99 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 100 | 6. Open the MySQL log rotation configuration file in your preferred text |
Lana Brindley | f0c5519 | 2014-01-20 17:24:37 +1000 | [diff] [blame] | 101 | editor, and edit it to ensure it is writable by ``other``: |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 102 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 103 | $ vim /etc/logrotate.d/mysql-server |
| 104 | # edit create 640 to 644. |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 105 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 106 | .. 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 Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 109 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 110 | $ git clone https://github.com/rcbau/turbo-hipster |
Joshua Hesketh | 05d0158 | 2013-09-09 15:16:08 +1000 | [diff] [blame] | 111 | |
Lana Brindley | ec7637a | 2014-01-17 13:32:17 +1000 | [diff] [blame] | 112 | .. 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 |
Matthew Oliver | 1761669 | 2014-03-13 21:33:55 +1100 | [diff] [blame^] | 116 | setting in the ``config.yaml`` configuration file. |