A YEAR OF FEDMSG IN DEBIAN NICOLAS DANDRIMONT OLASD@DEBIAN.ORG - - PowerPoint PPT Presentation

a year of fedmsg in debian
SMART_READER_LITE
LIVE PREVIEW

A YEAR OF FEDMSG IN DEBIAN NICOLAS DANDRIMONT OLASD@DEBIAN.ORG - - PowerPoint PPT Presentation

A YEAR OF FEDMSG IN DEBIAN NICOLAS DANDRIMONT OLASD@DEBIAN.ORG AUGUST 24TH 2014 0 THE PROBLEM WITH DISTRO INFRA SERVICES ARE LIKE PEOPLE Dozens of services, developed by many people Each service has its own way of communicating with the


slide-1
SLIDE 1

A YEAR OF FEDMSG IN DEBIAN

NICOLAS DANDRIMONT OLASD@DEBIAN.ORG AUGUST 24TH 2014

slide-2
SLIDE 2

THE PROBLEM WITH DISTRO INFRA

slide-3
SLIDE 3

SERVICES ARE LIKE PEOPLE

Dozens of services, developed by many people Each service has its own way of communicating with the rest of the world Meaning that a service that needs to interact (yep, that's all of them) will need to implement a bunch of communication systems

slide-4
SLIDE 4

DEBIAN INFRASTRUCTURE COMMS

, our archive software, uses emails and databases to

  • communicate. Metadata is available in a RFC822 format, no real

API (the DB is not public either) dak , our build queue management software, polls a database every few minutes to know what needs to get built. No API outside of its database wanna-build , our bug tracking system, works via email, stores its data in flat files (for now), and exposes a read-only SOAP API debbugs SCM pushes in the distro-provided repos (on ) can trigger an IRC bot (KGB), some mails. No central notification mechanism alioth

slide-5
SLIDE 5

SOME KLUDGES ARE AVAILABLE

UDD (THE ULTIMATE DEBIAN DATABASE) wiki page Contains a snapshot of a lot of the databases undelying the Debian infrastructure at a given time (even some Ubuntu bits) A lot of cron-triggered importers Useful for distro-wide QA purposes, not so much for real-time

  • updates. Furthermore, consistency is not guaranteed
slide-6
SLIDE 6

THE PTS (PACKAGE TRACKING SYSTEM) (and ) https://packages.qa.debian.org/ https://tracker.debian.org Cron-triggered updates on source packages Subscribe for email updates on a given packages Messages not uniform, contain some headers for filtering and machine parsing Not real-time

slide-7
SLIDE 7

A PROPOSED IMPROVEMENT: FEDMSG

slide-8
SLIDE 8

WHAT IS FEDMSG?

in 2009 at NorthWest Linux Fest Jesse Keating's talk A unified message bus, reducing the coupling of interdependent services Services subscribe to one (or several) message topic(s), register callbacks, and respond to events

slide-9
SLIDE 9

WHAT YOU GET (ALMOST) FOR FREE

A stream of data representing the infrastructure activity (stats) De-coupling of interdependent services A unified, pluggable notification system, gathering all the events in the project email irc mobile desktop … badge/achievement system live web dashboard of events IRC feeds ( @ OFTC) identi.ca and twitter accounts that get banned for flooding :-) … #debian-fedmsg

slide-10
SLIDE 10

FEDMSG INCEPTION

First candidate: AMQP as implemented by qpid Issues: SPOF at the central broker brokers weren't very reliable

slide-11
SLIDE 11

Actual message bus: 0mq No broker, each service binds to a port and starts publishing messages Other services connect to those ports and start consuming messages Advantages No central broker 100-fold speedup over AMQP

slide-12
SLIDE 12

Main issue with a brokerless system: service discovery Three options Writing a broker (→ hello SPOF) Using DNS (most elegant solution) Distribute a text file Simon Chopin implemented the DNS solution during his GSoC.

slide-13
SLIDE 13

USING THE BUS

slide-14
SLIDE 14

BUS TOPOLOGY

slide-15
SLIDE 15

MESSAGE TOPICS

Event topics follow the rule:

  • rg.distribution.ENV.SERVICE.OBJECT[.SUBOBJECT].EVENT

Where: ENV is one of dev, stg, or production. SERVICE is something like koji, bodhi, mentors, … OBJECT is something like package, user, or tag SUBOBJECT is something like owner or build (in the case where OBJECT is package, for instance) EVENT is a verb like update, create, or complete.

slide-16
SLIDE 16

PUBLISHING MESSAGES

From python:

import fedmsg fedmsg.publish(topic='testing', modname='test', msg={ 'test': "Hello World", })

From the shell:

$ echo "Hello World." | fedmsg-logger --modname=git --topic=repo.update $ echo '{"a": 1}' | fedmsg-logger --json-input $ fedmsg-logger --message="This is a message." $ fedmsg-logger --message='{"a": 1}' --json-input

slide-17
SLIDE 17

RECEIVING MESSAGES

From python:

import fedmsg config = fedmsg.config.load_config([], None) for name, endpoint, topic, msg in fedmsg.tail_messages(**config): print fedmsg.encoding.pretty_dumps(msg)

In the shell, you can use the fedmsg-tail command

slide-18
SLIDE 18

GOODIES

All the stuff listed in is implemented Cryptographic message signing: either via X.509 (Fedora) or GnuPG (Debian, implemented during GSoC13) Replay mechanism: detect if a message was missed (sequence id mismatch) and ask the sender for the remaining messages (implemented during GSoC13) What you get (almost) for free

slide-19
SLIDE 19

FEDMSG IN DEBIAN

slide-20
SLIDE 20

GSOC 2013

A lot happened during GSoC 2013, thanks to Simon Chopin's involvement: fedmsg (and dependencies) packaging adaptations to make fedmsg more distribution-agnostic bootstrap of the Debian bus using mailing-list subscriptions, and on mentors.d.n

slide-21
SLIDE 21

WHAT THEN?

Packaging adaptations to make it easier to run the fedmsg components individually (separate packages, init scripts and systemd service files). Proper package backports Bus maintenance: keeping the software up to date

slide-22
SLIDE 22

SOME STATS

Since July 14th 2013: around 200k messages 155k bug mails 45k uploads

slide-23
SLIDE 23

LATEST DEVELOPMENTS

Datanommer (database component) has been packaged and is being deployed. Debian services are widely distributed, firewall restrictions are sometimes our of our control: we need a way for services to push their messages instead of having the fedmsg-gateway pull them. fedmsg-relay: non-standard port, non-standard protocol. Currently pondering a way for services to push their messages through https.

slide-24
SLIDE 24

CONCLUSIONS & QUESTIONS

slide-25
SLIDE 25

CONTACT ME

  • lasd@debian.org

If there's interest, I'd be glad to hold an ad-hoc hacking session!

slide-26
SLIDE 26

QUESTIONS ?