Merge lp:~eday/burrow/docs into lp:burrow

Proposed by Eric Day
Status: Merged
Approved by: Eric Day
Approved revision: 9
Merged at revision: 9
Proposed branch: lp:~eday/burrow/docs
Merge into: lp:burrow
Diff against target: 283 lines (+155/-18)
7 files modified
burrow/backend/http.py (+4/-4)
burrow/frontend/wsgi.py (+10/-5)
doc/source/_static/basic.css (+1/-1)
doc/source/getting_started.rst (+95/-1)
doc/source/index.rst (+3/-2)
doc/source/introduction.rst (+38/-1)
test/frontend/test_wsgi.py (+4/-4)
To merge this branch: bzr merge lp:~eday/burrow/docs
Reviewer Review Type Date Requested Status
Burrow Core Team Pending
Review via email: mp+58186@code.launchpad.net

Description of the change

More docs, added /v1.0 to HTTP paths.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'burrow/backend/http.py'
2--- burrow/backend/http.py 2011-04-06 02:03:37 +0000
3+++ burrow/backend/http.py 2011-04-18 20:11:06 +0000
4@@ -28,11 +28,11 @@
5 self.server = ('localhost', 8080)
6
7 def delete_accounts(self, filters={}):
8- url = self._add_parameters('/', filters=filters)
9+ url = self._add_parameters('', filters=filters)
10 self._request('DELETE', url)
11
12 def get_accounts(self, filters={}):
13- url = self._add_parameters('/', filters=filters)
14+ url = self._add_parameters('', filters=filters)
15 self._request('GET', url)
16
17 def delete_queues(self, account, filters={}):
18@@ -93,9 +93,9 @@
19 separator = '&'
20 return url
21
22- def _request(self, *args, **kwargs):
23+ def _request(self, method, url, *args, **kwargs):
24 connection = httplib.HTTPConnection(*self.server)
25- connection.request(*args, **kwargs)
26+ connection.request(method, '/v1.0' + url, *args, **kwargs)
27 response = connection.getresponse()
28 if response.status == 200:
29 print response.read()
30
31=== modified file 'burrow/frontend/wsgi.py'
32--- burrow/frontend/wsgi.py 2011-03-30 19:51:34 +0000
33+++ burrow/frontend/wsgi.py 2011-04-18 20:11:06 +0000
34@@ -69,9 +69,10 @@
35 self.default_hide = self.config.get('default_hide', DEFAULT_HIDE)
36 mapper = routes.Mapper()
37 mapper.connect('/', action='root')
38- mapper.connect('/{account}', action='account')
39- mapper.connect('/{account}/{queue}', action='queue')
40- mapper.connect('/{account}/{queue}/{message}', action='message')
41+ mapper.connect('/v1.0', action='version')
42+ mapper.connect('/v1.0/{account}', action='account')
43+ mapper.connect('/v1.0/{account}/{queue}', action='queue')
44+ mapper.connect('/v1.0/{account}/{queue}/{message}', action='message')
45 self._routes = routes.middleware.RoutesMiddleware(self._route, mapper)
46
47 def run(self, thread_pool):
48@@ -118,13 +119,17 @@
49 return method(req, **args)
50
51 @webob.dec.wsgify
52- def _delete_root(self, req):
53+ def _get_root(self, req):
54+ return webob.exc.HTTPOk(body=json.dumps(['v1.0'], indent=2))
55+
56+ @webob.dec.wsgify
57+ def _delete_version(self, req):
58 filters = self._parse_filters(req)
59 self.backend.delete_accounts(filters)
60 return webob.exc.HTTPNoContent()
61
62 @webob.dec.wsgify
63- def _get_root(self, req):
64+ def _get_version(self, req):
65 filters = self._parse_filters(req)
66 accounts = [account for account in self.backend.get_accounts(filters)]
67 if len(accounts) == 0:
68
69=== modified file 'doc/source/_static/basic.css'
70--- doc/source/_static/basic.css 2011-04-07 00:10:52 +0000
71+++ doc/source/_static/basic.css 2011-04-18 20:11:06 +0000
72@@ -251,7 +251,7 @@
73 }
74
75 table.docutils td, table.docutils th {
76- padding: 1px 8px 1px 0;
77+ padding: 1px 8px 1px 8px;
78 border-top: 0;
79 border-left: 0;
80 border-right: 0;
81
82=== modified file 'doc/source/getting_started.rst'
83--- doc/source/getting_started.rst 2011-04-08 02:31:30 +0000
84+++ doc/source/getting_started.rst 2011-04-18 20:11:06 +0000
85@@ -16,4 +16,98 @@
86 Getting Started
87 ***************
88
89-Coming Soon!
90+System Requirements
91+===================
92+
93+Burrow development currently targets Ubuntu Server 10.04, but should
94+work on most Linux platforms with the following software:
95+
96+* Python 2.6
97+* Eventlet 0.9.8
98+* WebOb 0.9.8
99+* Routes
100+* Setuptools
101+* Nose
102+* Sphinx
103+
104+Getting Burrow
105+==============
106+
107+Burrow's source code is hosted on Launchpad and managed with Bazaar.
108+The current trunk can be checked out with its Launchpad alias:
109+
110+ ``bzr branch lp:burrow``
111+
112+A source tarball for the latest release of Burrow is available on the
113+`Launchpad project page <https://launchpad.net/burrow>`_.
114+
115+Prebuilt packages for Ubuntu are not yet available.
116+
117+Development
118+===========
119+
120+To get started with Burrow development (and
121+other OpenStack projects), see the `How To Contribute
122+<http://wiki.openstack.org/HowToContribute>`_ page on the OpenStack
123+wiki. You may also want to look at the `blueprints for Burrow
124+<https://blueprints.launchpad.net/burrow>`_ or ask about specific
125+features on the OpenStack mailing list and IRC channel.
126+
127+Production
128+==========
129+
130+It is not yet recommended to use Burrow in production environments. It
131+should be production ready for small deployments with the next release,
132+and larger deployments the release after.
133+
134+Running
135+=======
136+
137+Once you have the required software installed and Burrow downloaded
138+(either by source tarball or bzr branch), you can either run it
139+directly from the source directory or install it. If you choose to
140+install, run:
141+
142+ ``python setup.py install``
143+
144+If you are running from the source directory, you will want to prepend
145+the ``burrow`` and ``burrowd`` commands with ``bin/``. To start the
146+server, run:
147+
148+ ``burrowd``
149+
150+This should start the default server modules and enter into the server
151+loop. Press CTRL-C to stop.
152+
153+To use the command line client, run:
154+
155+ ``burrow``
156+
157+This should output fairly detailed help messages on the available
158+commands and options. To inset a message (make sure ``burrowd``
159+is still running), run:
160+
161+ ``echo "data" | burrow create_message test_queue message_1``
162+
163+This will insert a new message into the queue ``test_queue`` with
164+message ID ``mesage_1`` and message payload ``data``. To list the queues, run:
165+
166+ ``burrow get_queues``
167+
168+As expected, the queue ``test_queue`` should be returned. Note that
169+by default the ``burrow`` command line tool uses your login ID as
170+the account, so all queue and message operations are in the context
171+of this account ID. You can change the default account ID with the
172+``-a <account>`` option.
173+
174+To list all messages in ``test_queue``, run:
175+
176+ ``burrow get_messages test_queue``
177+
178+To delete the message we previously created, run:
179+
180+ ``burrow delete_message test_queue message_1``
181+
182+From here you can create more messages, delete all messages in an
183+account or queue, or update one or more messages with the ``update_*``
184+commands.
185
186=== modified file 'doc/source/index.rst'
187--- doc/source/index.rst 2011-04-08 23:09:42 +0000
188+++ doc/source/index.rst 2011-04-18 20:11:06 +0000
189@@ -27,9 +27,10 @@
190 documentation can be found below.
191
192 This documentation is generated by the Sphinx toolkit and lives in the
193-source tree. Additional documentation on Burrow and other components
194-of OpenStack can be found on the `OpenStack wiki`_.
195+`Burrow source`_ tree. Additional documentation on Burrow and other
196+components of OpenStack can be found on the `OpenStack wiki`_.
197
198+.. _`Burrow source`: https://launchpad.net/burrow
199 .. _`OpenStack wiki`: http://wiki.openstack.org
200
201 Basics
202
203=== modified file 'doc/source/introduction.rst'
204--- doc/source/introduction.rst 2011-04-08 02:31:30 +0000
205+++ doc/source/introduction.rst 2011-04-18 20:11:06 +0000
206@@ -16,4 +16,41 @@
207 Introduction to Message Queues
208 ******************************
209
210-Coming Soon!
211+Message queues can be utilized by applications for a number of reasons,
212+but at the core they are used to enable asynchronous communication
213+between different threads of execution. Messages may be passed between
214+threads, process, machines, or data centers. At a higher level, they
215+are usually used to distributed work to other threads or programs that
216+are more suitable or even specialized. For example, queue consumers
217+may send email, resize images, or start virtual machines on behalf
218+of the caller. For a more general introduction to message queues,
219+see the Wikipedia page on `Message Queues`_.
220+
221+.. _`Message Queues`: http://en.wikipedia.org/wiki/Message_queue
222+
223+Message queue solutions are usually designed with a specific scope or
224+environment in mind. For example, the Python :mod:`Queue` module is
225+designed to be used within the same process. `RabbitMQ`_ is primarily
226+designed for clustered applications. The protocols used for network
227+based queues play a role in this as well, for example previous
228+versions of `AMQP`_ (pre 1.0) were not well suited for high-latency
229+environments, but `AMQP`_ 1.0 allows pipelining to overcome this
230+limitation. Some message queue solutions involve a broker to route
231+messages between producers and consumers, where others such as
232+`ZeroMQ`_ allow direct message passing. Some message queues such as
233+`Gearman`_ are designed for a single tenant operation, where others
234+like `RabbitMQ`_ allow for multiple accounts.
235+
236+.. _`RabbitMQ`: http://www.rabbitmq.com/
237+.. _`AMQP`: http://www.amqp.org/
238+.. _`ZeroMQ`: http://www.zeromq.org/
239+.. _`Gearman`: http://gearman.org/
240+
241+Burrow is slightly different in that the focus is on distributed
242+messaging (between data centers) so it's appropriate for both low
243+and high-latency environments. It is also designed to handle large
244+numbers of tenants in order to be suitable for a large public cloud
245+deployments. Beyond being a simple message queue, Burrow also provides
246+a fanout event notification mechanism so a single message may be read
247+by multiple readers. Readers can ask for new messages with a marker
248+to maintain the state of the last seen message.
249
250=== modified file 'test/frontend/test_wsgi.py'
251--- test/frontend/test_wsgi.py 2011-03-30 19:51:34 +0000
252+++ test/frontend/test_wsgi.py 2011-04-18 20:11:06 +0000
253@@ -34,18 +34,18 @@
254 self.backend = self.backend_class(config)
255 self.frontend = burrow.frontend.wsgi.Frontend(config, self.backend)
256 self.frontend.default_ttl = 0
257- self._get_url('/', status=404)
258+ self._get_url('', status=404)
259 self._get_url('/a', status=404)
260 self._get_url('/a/q', status=404)
261
262 def tearDown(self):
263 self._get_url('/a/q', status=404)
264 self._get_url('/a', status=404)
265- self._get_url('/', status=404)
266+ self._get_url('', status=404)
267
268 def test_account(self):
269 self._put_url('/a/q/1')
270- accounts = self._get_url('/')
271+ accounts = self._get_url('')
272 self.assertEquals(accounts, ['a'])
273 self._delete_url('/a')
274
275@@ -300,7 +300,7 @@
276 return self._url('PUT', url, status=status, **kwargs)
277
278 def _url(self, method, url, body='', status=200):
279- req = webob.Request.blank(url, method=method, body=body)
280+ req = webob.Request.blank('/v1.0' + url, method=method, body=body)
281 res = req.get_response(self.frontend)
282 self.assertEquals(res.status_int, status)
283 if status == 200:

Subscribers

People subscribed via source and target branches