Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker registry events emitter #509

Open
glensc opened this issue Apr 3, 2018 · 7 comments
Open

docker registry events emitter #509

glensc opened this issue Apr 3, 2018 · 7 comments

Comments

@glensc
Copy link
Contributor

glensc commented Apr 3, 2018

docker registry v2 supports notifying endpoints:
https://docs.docker.com/registry/notifications/

i wonder if there's any attempt to write such listener and fedmsg producer?


if there is not i'm willing to write one. what python frameworks you suggest to use? as i see i need some kind of http server to receive the events.

@jeremycline
Copy link
Member

I don't know anything about the docker registry, but it sounds like there would be two approaches here: 1) write some Go code to implement a Sink that emits ZeroMQ messages (there are Go bindings) - not sure how all that works - or 2) Use something like Twisted to make a web server that publishes ZeroMQ messages (there is a Twisted-compatible ZMQ library).

I don't think either one should be in the fedmsg library itself, though.

@glensc
Copy link
Contributor Author

glensc commented Apr 3, 2018

i'm not saying it should be in this repo. just something written in python and using fedmsg library, similar like https://github.com/glensc/fedmsg-cvs (which is based on some ralphbean's project)

are you saying using all such approach is deprecated, i should write to ZMQ directly without using fedmsg libraries?

@glensc
Copy link
Contributor Author

glensc commented May 25, 2018

@jeremycline ping

@glensc
Copy link
Contributor Author

glensc commented May 25, 2018

there's also fedmsg-rabbitmq-serializer, perhaps i should write my consumer using rabbitmq instead. i found it easier to use rabbitmq in php.

@jeremycline
Copy link
Member

We've proposed moving to AMQP for Fedora and dropping support for fedmsg. The publish endpoint will be preserved and will likely remain ZeroMQ, but as part of this proposed migration there will be bridges to and from AMQP. They're a little more configurable than fedmsg-rabbitmq-serializer and use the AMQP topic exchange with the original ZeroMQ topic.

@glensc
Copy link
Contributor Author

glensc commented May 25, 2018

So this basically makes whole fedmsg project obsolete? And if I want to setup messaging in my infrastructure I should invent everything myself?

I currently use:

@jeremycline
Copy link
Member

Ideally yes, fedmsg would be retired, but I don't think fedmsg offers any value over the pyzmq bindings it uses to send messages. Publishing an (unsigned) message in the same format as fedmsg with pyzmq is just:

import json

import zmq

socket = zmq.Context().socket(zmq.PUB)
socket.bind('tcp://*:9940')
socket.send_multipart([b'my.topic', json.dumps({'my': 'message body'}).encode('utf-8')])

There's really not a lot to invent. I've never understood the value of fedmsg, I never use it myself if I can help it. The ZeroMQ API is quite nice and the Python bindings are very good.

Of course, if you move to AMQP you'll be able to use all the tools we are, if you want. Now is a good time to provide feedback on the API. I think you'll find it addresses a lot of the annoying things about using fedmsg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants