blob: 9a6068630e7ca850dd11f4cec3832aafe0acdad1 [file] [log] [blame]
Joshua Hesketh3b7765d2013-11-18 13:06:20 +11001:title: Running
2
3
4Running
5=======
6
Lana Brindleyec7637a2014-01-17 13:32:17 +10007Starting turbo-hipster
8----------------------
9
10Turbo-hipster can be run from the command line::
11
12 $ ./turbo-hipster/worker_server.py
13
14This option allows you to pass parameters to turbo-hipster. Use the --help
15parameter to see a full list.
16
17+-------+--------------+--------------------------------------------------------+
18| Short | Long | Description |
19+=======+==============+========================================================+
20| -c | --config | Print the path to the configuration file and exit |
21+-------+--------------+--------------------------------------------------------+
22| -b | --background | Run as a daemon in the background |
23+-------+--------------+--------------------------------------------------------+
24| -p | --pidfile | Specify the PID file to lock while running as a daemon |
25+-------+--------------+--------------------------------------------------------+
26
27Alternatively, you can start turbo-hipster as a service.
28
291. Copy the turbo-hipster init.d script to /etc/init.d/:
30
31 $ sudo cp etc/init.d/turbo-hipster /etc/init.d/
32
332. Reload the script with the default configuration:
34
35 $ sudo update-rc.d turbo-hipster defaults
36
373. Start the service:
38
39 $ sudo service turbo-hipster start
40
41Plugins
42=======
43
44Plugins can be used to extend turbo-hipster's capabilities.
45
46.. note::
47 Currently, the only available plugin for turbo-hipster is the
48 Database Migration plugin, ``gate_real_db_upgrade``, which tests code
49 against a variety of real-world databases.
50
51Installing plugins
52------------------
53
54Turbo-hipster plugins are responsible for handling the jobs that are passed
55to it. They must successfully build reports and publish them according to
56their configuration. They must also be able to communicate test results back
57to Zuul using Gearman.
58
59Plugins must take a standard format in order to be able to work correctly
60with turbo-hipster. They must contain a ``task.py`` file with a ``Runner``
61class.
62
63Once you have created a turbo-hipster plugin, you need to configure it in
64the ``config.json`` configuration file.
65
66.. FIXME More config information required here
67
68Plugin: Database migration with ``gate_real_db_upgrade``
69--------------------------------------------------------
70
71The database migration plugin, ``gate_real_db_upgrade``, is used to test
72datasets against real-world, anonymized, databases.
73
74Migrating a database
75--------------------
76
77In order to use turbo-hipster with the ``gate_real_db_upgrade`` plugin, you
78need to set up the databases to test against, and point to the plugin in
79turbo-hipster's configuration file.
80
811. Create a directory for the datasets:
82
83 $ mkdir -p /var/lib/turbo-hipster/datasets
84
852. Copy the json dataset to the directory you created:
86
87 $ cp /my/dataset.json /var/lib/turbo-hipster/datasets/
88
893. Open the ``/etc/turbo-hipster/config.json`` file in your preferred
90editor, locate the plugins section, and add this line::
91
92 **plugins**
93 gate_real_db_upgrade
94
95Testing with turbo-hipster
96==========================
97
98When turbo-hipster completes a test, it sends the result of the test back to
99Gearman. These results contain a link to a compiled logfile for the test.
100
101If the test fails, or takes too long to complete, turbo-hipster will add a
102review to your patchset that looks like this:
103
104.. image:: ../images/THTestResult.png
105
106Reading test reports
107--------------------
108
109An example of a standard log file:
110http://thw01.rcbops.com/results/54/54202/5/check/gate-real-db-upgrade_nova_mysql_devstack_150/ddd6d53/20130910_devstack_applied_to_150.log
111
112An example of the same logfile, using the javascript logviewer:
113http://thw01.rcbops.com/logviewer/?q=/results/54/54202/5/check/gate-real-db-upgrade_nova_mysql_devstack_150/ddd6d53/20130910_devstack_applied_to_150.log
114
115Test failure codes
116------------------
117
118This section gives a list of failure codes, including some steps you can
119take for troubleshooting errors:
120
121 FAILURE - Did not find the end of a migration after a start
122
123If you look at the log you should find that a migration began but never
124finished. Hopefully there'll be a traceroute for you to follow through to
125get some hints about why it failed.
126
127 WARNING - Migration %s took too long
128
129In this case your migration took a long time to run against one of the test
130datasets. You should reconsider what operations your migration is performing
131and see if there are any optimizations you can make, or if it is really
132necessary. If there is no way to speed up your migration you can email us at
133rcbau@rcbops.com for an exception.
134
135 FAILURE - Final schema version does not match expectation
136
137Somewhere along the line the migrations stopped and did not reach the
138expected version. Our datasets start at previous releases and have to
139upgrade all the way through to the most current release. If you see this,
140inspect the log for traceroutes or other hints about the failure.
141
142 FAILURE - Could not setup seed database.
143 FAILURE - Could not find seed database.
144
145These errors are internal errors. If you see either of these, contact us at
146rcbau@rcbops.com to let us know so we can fix and rerun the tests for you.
147
148 FAILURE - Could not import required module.
149
150This error probably shouldn't happen as Jenkins should catch it in the unit
151tests before Turbo-Hipster launches. If you see this, please contact us at
152rcbau@rcbops.com and let us know.
153
154If you receive an error that you think is a false positive, leave a comment
155on the review with the sole contents of "recheck migrations".
156
157If you have any questions/problems please contact us at rcbau@rcbops.com.