Subject: [alpine-devel] build server messaging

From: Natanael Copa <[email-masked]>
Date: Tue, 22 Nov 2011 16:59:40 +0100

Hi,

Our current messaging between git server and buildservers goes via
public IRC and has not been 100% reliable.

So I have been looking at replacing it with a zeromq[1] based infra.

The idea is that we have a buildmsg-server that listens on 2 ports, one
for subscribers and one for git push notifications.

The buildmsg-send is executed from git hook when something is pushed.
buildmsg-send will connect to the buildmsg-server socket and simply
pass over the git branch (i.e "master" or "2.3-stable").
buildmsg-server will forward this to all subscribers.

The building servers will run buildmsg-subscriber's which connects to
buildmsg-server and subscribes to a "branch". Whenever a message
arrives it starts building.

With zeromq and lua this is all very simple. I have pushed example code
to http://git.alpinelinux.org/cgit/autobuilder/

(I added some deamonization code for buildmsg-server but i think that
maybe its better if start-stop-daemon handles that together with
pidfile creation and stdin/out/err redirection etc)

Feedback is welcome.

Thanks!

-nc

[1] http://www.zeromq.org/

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Jesse Young <[email-masked]>
Date: Tue, 22 Nov 2011 19:10:18 -0600

On Tue, 22 Nov 2011 16:59:40 +0100
Natanael Copa <[email-masked]> wrote:

> The idea is that we have a buildmsg-server that listens on 2 ports,
> one for subscribers and one for git push notifications.

I'm not familiar with the build system, and only minimally familiar with
zmq, so ignore me if I'm totally off base.

The way I understand how zmq subscription sockets work is that
clients will miss notifications if they get disconnected for whatever
reason. So a mechanisim should be in place to replay notifications
that the client may have missed. Maybe this is the non-reliability
you're experiencing with IRC as well?

Jesse

---

---

From: Natanael Copa <[email-masked]>
Date: Wed, 23 Nov 2011 08:09:24 +0100

On Tue, 22 Nov 2011 19:10:18 -0600
Jesse Young <[email-masked]> wrote:

> I'm not familiar with the build system, and only minimally familiar
> with zmq, so ignore me if I'm totally off base.
> 
> that the client may have missed.

It is not really a big problem since what the build server does
when it gets it notification is pull from git and build all that has
been changed (or more precise, build everything that is missing). In
other words it will pick up everything it has missed while it was
offline.

zeromq is pretty nice in that way, that if the subscriber start up
before the publisher, it will auto connect whenever the publishing
server (buildmsg-server) server comes up.

If the buildmsg-server goes down people who does a git push will notice
it since the git notification will block til server comes back up again.

> Maybe this is the non-reliability

Not really. I think the build bot does not handle all kinds of stuff
that might happen with a public IRC server. (irc server goes offline,
comes back, you get kicked from the channel etc etc).

The problem is that we don't have control over the messaging server
which currently is Freenode.

-nc

---