Share
Embed
Introducing Openstack Marconi
This covers the Openstack Marconi service: Queuing as a Service. Answers the how, what, and why of Marconi, dives into the API and the architecture, and discusses the future of the project.
Alejandro Cabrera
July 17, 2013
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
96 slides
-
Message Queues as a Service: Introducing Marconi Alejandro Cabrera ([email protected])
July 17, 2013 Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
from pprint import pprint if __name__ == ’__main__’: meta =
{ ’author’ : ’Alejandro Cabrera’, ’email’ : ’[email protected]’, ’objective’ : ’Introduce Marconi!’ } pprint(meta) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
About Me Software developer @ Rackspace for almost a year
Likes: Python, Linux, open-source, automation, quality, cordiality Dislikes: Proprietary, manual processes, hostility Github: cabrera Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Overview Marconi: What, Why, How? Alejandro Cabrera ([email protected]) Message Queues
as a Service: Introducing Marconi -
Overview Marconi: What, Why, How? Marconi and You: Configuring Alejandro
Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Overview Marconi: What, Why, How? Marconi and You: Configuring Growing
Marconi: Development and the Future Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Alejandro Cabrera ([email protected])
Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Queuing as a
service: queues, messages, claims Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Queuing as a
service: queues, messages, claims An HTTP-driven, mostly-RESTful API Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Queuing as a
service: queues, messages, claims An HTTP-driven, mostly-RESTful API An Openstack hopeful Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Queuing as a
service: queues, messages, claims An HTTP-driven, mostly-RESTful API An Openstack hopeful Open-source! Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Queuing as a
service: queues, messages, claims An HTTP-driven, mostly-RESTful API An Openstack hopeful Open-source! Marconi is not: Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Queuing as a
service: queues, messages, claims An HTTP-driven, mostly-RESTful API An Openstack hopeful Open-source! Marconi is not: A replacement for X (celery, zmq, rabbitmq) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Queuing for the Cloud Marconi is: Queuing as a
service: queues, messages, claims An HTTP-driven, mostly-RESTful API An Openstack hopeful Open-source! Marconi is not: A replacement for X (celery, zmq, rabbitmq) A message broker Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: What’s In a Name? Guglielmo Marconi Alejandro Cabrera ([email protected])
Message Queues as a Service: Introducing Marconi -
Marconi: What’s In a Name? Guglielmo Marconi An Italian inventor
often credited with the invention of radio Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: What’s In a Name? Guglielmo Marconi An Italian inventor
often credited with the invention of radio Marconi (the service) is all about managing messages Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi? There was a need for a messsaging platform
that is: Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi? There was a need for a messsaging platform
that is: Open Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi? There was a need for a messsaging platform
that is: Open Easy to use Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi? There was a need for a messsaging platform
that is: Open Easy to use Scalable Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi? There was a need for a messsaging platform
that is: Open Easy to use Scalable Extensible Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi? There was a need for a messsaging platform
that is: Open Easy to use Scalable Extensible Marconi aims to fill those needs Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi Instead of. . . ? Amazon SQS? Alejandro
Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi Instead of. . . ? Amazon SQS? SQS
is closed - you can’t run your own instance Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi Instead of. . . ? Amazon SQS? SQS
is closed - you can’t run your own instance Celery? Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi Instead of. . . ? Amazon SQS? SQS
is closed - you can’t run your own instance Celery? Celery is a task-based service Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi Instead of. . . ? Amazon SQS? SQS
is closed - you can’t run your own instance Celery? Celery is a task-based service It depends on a broker to handle the queuing aspects Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi Instead of. . . ? Amazon SQS? SQS
is closed - you can’t run your own instance Celery? Celery is a task-based service It depends on a broker to handle the queuing aspects RabbitMQ, qpid, ZMQ? Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Why Marconi Instead of. . . ? Amazon SQS? SQS
is closed - you can’t run your own instance Celery? Celery is a task-based service It depends on a broker to handle the queuing aspects RabbitMQ, qpid, ZMQ? You have to scale them yourself Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
How Does it Work? Queues: create them! Alejandro Cabrera ([email protected])
Message Queues as a Service: Introducing Marconi -
How Does it Work? Queues: create them! Messages: post them
to queues (FIFO guaranteed) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
How Does it Work? Queues: create them! Messages: post them
to queues (FIFO guaranteed) Claims: workers claim messages Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
How Does it Work? Queues: create them! Messages: post them
to queues (FIFO guaranteed) Claims: workers claim messages That’s all there is to it. Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
That’s All? Yes. Alejandro Cabrera ([email protected]) Message Queues as a
Service: Introducing Marconi -
That’s All? Yes. It’s up to you to build higher-level
patterns: Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
That’s All? Yes. It’s up to you to build higher-level
patterns: Response/request Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
That’s All? Yes. It’s up to you to build higher-level
patterns: Response/request Publish/subscribe Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
That’s All? Yes. It’s up to you to build higher-level
patterns: Response/request Publish/subscribe Master/slave Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
That’s All? Yes. It’s up to you to build higher-level
patterns: Response/request Publish/subscribe Master/slave Producer(s)/Consumer(s) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you Alejandro Cabrera
([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Logging details Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Logging details Transport drivers: wsgi, zmq Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Logging details Transport drivers: wsgi, zmq As well as transport-specific configuration! Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Logging details Transport drivers: wsgi, zmq As well as transport-specific configuration! Storage drivers Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Logging details Transport drivers: wsgi, zmq As well as transport-specific configuration! Storage drivers Messages: size (default: 256KB), batch size Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Logging details Transport drivers: wsgi, zmq As well as transport-specific configuration! Storage drivers Messages: size (default: 256KB), batch size Queues: name length Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Configuration Marconi doesn’t try to limit you You can
configure. . . : Logging details Transport drivers: wsgi, zmq As well as transport-specific configuration! Storage drivers Messages: size (default: 256KB), batch size Queues: name length Philosophy: configure all the things! Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Can I Use it Now? Yes, with a caveat
Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Can I Use it Now? Yes, with a caveat
It’s pre-alpha status Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi: Can I Use it Now? Yes, with a caveat
It’s pre-alpha status (Don’t run this in production!) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi API: From the Top GET /v1 GET /v1/health Alejandro
Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi API: Handling Queues PUT /v1/queues/{queue} GET /v1/queues{?marker,limit,detailed} PUT /v1/queues/{queue}
GET /v1/queues/{queue} GET /v1/queues/{queue}/stats DELETE /v1/queues/{queue} Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi API: Messages! GET /v1/queues/{queue}/messages{?marker,limit,echo} GET /v1/queues/{queue}/messages/{message_id}{?claim_id} GET /v1/queues/{queue}/messages{?ids,claim_id} POST
/v1/queues/{queue}/messages DELETE /v1/queues/{queue}/messages/{message_id}{?claim_id} Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi API: Claims Processing POST /v1/queues/{queue}/claims{?limit} GET /v1/queues/{queue}/claims/{claim_id} PATCH /v1/queues/{queue}/claims/{claim_id}
DELETE /v1/queues/{queue}/claims/{claim_id} Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Deeper: Internal Architecture Highly modular - driver-driven architecture Alejandro
Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Deeper: Internal Architecture Highly modular - driver-driven architecture Storage:
sqlite, mongodb Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Deeper: Internal Architecture Highly modular - driver-driven architecture Storage:
sqlite, mongodb Transport: wsgi (zmq in the works) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Deeper: Internal Architecture Highly modular - driver-driven architecture Storage:
sqlite, mongodb Transport: wsgi (zmq in the works) Authentication: keystone, nova, endpoint (client-side) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Deeper: Internal Architecture Highly modular - driver-driven architecture Storage:
sqlite, mongodb Transport: wsgi (zmq in the works) Authentication: keystone, nova, endpoint (client-side) The idea is to be highly configurable Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Deeper: Internal Architecture Highly modular - driver-driven architecture Storage:
sqlite, mongodb Transport: wsgi (zmq in the works) Authentication: keystone, nova, endpoint (client-side) The idea is to be highly configurable You know what you need - you make the trade-offs Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Big Picture marconi |-- bootstrap.py
|-- cmd # garbabe collector, standalone server process |-- common # shared utilities |-- __init__.py |-- openstack # openstack common code |-- storage # storage drivers |-- tests # test helpers |-- transport # transport drivers ‘-- version.py Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Storage storage/ |-- base.py |--
exceptions.py |-- __init__.py |-- mongodb ‘-- sqlite Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Storage (MongoDB) storage/ |-- base.py
|-- exceptions.py |-- __init__.py |-- mongodb | |-- claims.py | |-- controllers.py | |-- driver.py | |-- __init__.py | |-- messages.py | |-- options.py | |-- queues.py | ‘-- utils.py ‘-- sqlite Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Storage (sqlite) storage/ |-- base.py
|-- exceptions.py |-- __init__.py |-- mongodb ‘-- sqlite # development driver |-- claims.py |-- controllers.py |-- driver.py |-- __init__.py |-- messages.py |-- queues.py ‘-- utils.py Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Transports transport/ |-- auth.py |--
base.py |-- helpers.py |-- __init__.py |-- wsgi ‘-- zmq Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Transports (wsgi) transport/ |-- auth.py
|-- base.py |-- helpers.py |-- __init__.py |-- wsgi | |-- app.py | |-- claims.py | |-- driver.py | |-- exceptions.py | |-- health.py | |-- helpers.py | |-- __init__.py | |-- messages.py | |-- queues.py | ‘-- stats.py ‘-- zmq Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Transports (zmq) transport/ |-- auth.py
|-- base.py |-- helpers.py |-- __init__.py |-- wsgi ‘-- zmq ‘-- __init__.py Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
A Look at the Structure: Transports (zmq) transport/ |-- auth.py
|-- base.py |-- helpers.py |-- __init__.py |-- wsgi ‘-- zmq ‘-- __init__.py # you can help make this happen! Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Client-Side: Introducing python-marconiclient! You have a server, but now
you need to work with it Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Client-Side: Introducing python-marconiclient! You have a server, but now
you need to work with it python-marconiclient is. . . : Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Client-Side: Introducing python-marconiclient! You have a server, but now
you need to work with it python-marconiclient is. . . : A Python API for communicating with a marconi server Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Client-Side: Introducing python-marconiclient! You have a server, but now
you need to work with it python-marconiclient is. . . : A Python API for communicating with a marconi server A CLI that accomplishes the same Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Going Client-Side: Introducing python-marconiclient! You have a server, but now
you need to work with it python-marconiclient is. . . : A Python API for communicating with a marconi server A CLI that accomplishes the same A reference implementation for alternate marconi clients Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
So. . . What Does it Look Like? >>> client
= Client(conn, async=False) >>> client.queues(marker=..., limit=10, detailed=False) <generator object <genexpr> ar 0x7fd3ef1ed730> >>> client.create_queue(name=’darn_good_queue’, metadata=json.dumps({’game’: ’d2’ } ) ) <MarconiQueue [wot]> >>> client.home <HomeDoc ...> # affects all operations for objects # acquired from the client >>> client.async False Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Client: Handling Queues >>> queue = next(q for q in
client.queues if q.name == ’darn_good_queue’) >>> queue.name u’darn_good_queue’ >>> queue.stats <QueueStats ...> >>> queue.get_messages() <generator object <genexpr> ar 0x7fd3ef1ed742> >>> queue.get_messages(ids=[’50b68a50d6f5b8c8a7c62b’, ’50b68a50d6f5b8c8a7c62b’ ], claim=’a28ee94e-6cb4-11e2-b4’, limit=1) <generator object <genexpr> ar 0x7fd3ef1ed742> >>> queue.post_messages(messages=...) >>> queue.delete() Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Client: Handling Queues (Metadata) >>> queue.metadata {’a’: 1, ’b’: 2}
>>> queue.set_metadata({’a’: 2, ...}) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Client: Message Handling >>> message = next(queue.messages(...)) >>> message.age 90
>>> message.ttl 120 >>> message.id u’9y22h21w2h’ >>> message.body {u’action’: u’win’} >>> message.delete() >>> message.status <EnumValue: Message.Free [value=1]> Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Client: Claims >>> queue.claim(limit=10) <generator object <genexpr> ar 0x7fd3ef1ed742> >>>
claim = queue.claim(limit=10) # identical to queue message fetch API, # with claim id pre-filled >>> claim.messages(...) <generator object <genexpr> ar 0x7fd3ef1ed742> >>> msg = next(claim.messages(...)) >>> msg.status <EnumValue: Message.Claimed [value=2]> Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Client: Claims >>> claim.id ... >>> claim.ttl 90 >>> claim.age
120 >>> claim.patch(ttl=..., grace=...) >>> claim.release() Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi & Openstack & You Currently: pre-incubation Alejandro Cabrera ([email protected])
Message Queues as a Service: Introducing Marconi -
Marconi & Openstack & You Currently: pre-incubation We have the
form, we have contributors (5-6) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi & Openstack & You Currently: pre-incubation We have the
form, we have contributors (5-6) (We need more conributors!) Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi & Openstack & You Currently: pre-incubation We have the
form, we have contributors (5-6) (We need more conributors!) We keep our code: Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi & Openstack & You Currently: pre-incubation We have the
form, we have contributors (5-6) (We need more conributors!) We keep our code: Here: server Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi & Openstack & You Currently: pre-incubation We have the
form, we have contributors (5-6) (We need more conributors!) We keep our code: Here: server And here: client Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
Marconi & Openstack & You Currently: pre-incubation We have the
form, we have contributors (5-6) (We need more conributors!) We keep our code: Here: server And here: client Join us on IRC: #openstack-marconi @ freenode Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
The Future Get incubated into Openstack Alejandro Cabrera ([email protected]) Message
Queues as a Service: Introducing Marconi -
The Future Get incubated into Openstack Release the reference client
Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
The Future Get incubated into Openstack Release the reference client
Implement more: Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
The Future Get incubated into Openstack Release the reference client
Implement more: Transport drivers Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
The Future Get incubated into Openstack Release the reference client
Implement more: Transport drivers Storage drivers Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi -
The Future Get incubated into Openstack Release the reference client
Implement more: Transport drivers Storage drivers Grow! Alejandro Cabrera ([email protected]) Message Queues as a Service: Introducing Marconi