-
Notifications
You must be signed in to change notification settings - Fork 52
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
Gossip Discovery #65
Comments
This seems like a big job. The protocol is defined here: https://github.com/zeromq/czmq/blob/master/src/zgossip.xml |
Is there a document for the protocol? Or only the xml?
|
I'm working on it: https://github.com/sphaero/pyre/tree/gossip |
any progress on porting gossip to Pyre? |
Most of the code is in place. The clients connect and exchange but the logic of the exchange is still missing (zloop). Only I moved to working on zproject and zproto python support. My use case changed slightly making the need for gossiping less of a priority. |
@sphaero have you made any [local] updates to your fork/branch ? i'd like to pick up where you left off, gonna sync your fork/branch to a local repo, wasn't sure if you had something stashed you hadn't yet pushed... |
No I don't think so. I got stuck in the engine code. I kind of moved to the zyre python binding and letting zproject generate the state machine in python. Let me know if you need help |
so are you using gossip through zyre[proper] python bindings? |
I was doing a research in which I needed gossip discovery because it's 'better' for using zyre threads. Although in the end I didn't need it I did get the binding to work properly. |
Ahh. It wasn't clear if pyre was meant to be a pure Python implementation because something didn't mesh well at the c level or not.. I hadn't dug to far into the python bindings of zyre itself but will.. Ty! |
Pyre was written before gossiping was added to Zyre. The gossiping enging is generated using zproject/zproto. There are three options for gossiping support in python: |
wanted to update this thread, in case others started poking around. i pushed some initial changes here that gets the branch closer: https://github.com/zeromq/pyre/compare/master...wesyoung:feat/gossip?expand=1 [this branch merges most of master with the previous work @sphaero started..] there's still a ways to go (right now it'll connect to the gossip socket, but fails to deliver the key-pairs to existing nodes) spent a bunch of time reading through the C libs, just getting an idea how the engine works. some initial thoughts (soliciting feedback):
at this stage, the engine "almost works" ie: you can start to see the shouts come across the wire, just that new nodes aren't seeing the whole network (something blocking somewhere). but i can def see where native python users may get confused, and there might be a lot of work keeping this up to date as zyre iterates along (not impossible, just finding a balance). i'm not sure i have strong opinions either way, but am starting to think doing something like pyzmq does (sugar, etc) may be the right direction to take this, keep it accessible to native python users (which means more developers using, improving the core framework) while offloading the engine work to where it belongs? thoughts? (keep in mind, still getting my feet wet, feel free to make corrections in my assumptions here :)). |
Nice! my thoughts: 1: yes the zyre engine is faster but this is python thing |
i'm putting this together: https://github.com/wesyoung/pyzyre which builds and embed's libzmq.so, libczmq.so and libzyre.so within python (not system wide, auto configures, builds, etc). it's not quite complete, but it wraps everything and puts into place a thin layer for "more pythonic functions" a-top of Zyre (building something similar for czmq). so by default you have access to zyre.Zyre (_zyre_ctypes) but we can do more magic within pyzyre.Zyre (which could sub-class zyre.Zyre, etc). make things [at the czmq layer] easier to use. by default it installs site-packages/czmq, site-packages/zyre and site-packages/pyzyre. comments welcome. still a work in progress, dunno where it fits in life, but just the build system alone (re-purposed from pyzmq) helps solve a few problems for me. have an examples dir and pyzyre.utils patch coming soon too. |
Just a quick note; you are aware zyre comes with python bindings included. What would be very welcome is a high level pythonic interface on top of those bindings which would load Pyre if it can't find the zyre libs. Pyre would then just mimic the zyre API exactly. |
let me know if/when you get a chance to poke around the repo a bit.. following up on our initial thread :) made a few patches [merged] to zproject [and czmq and zyre] to get things lined up. make it easier to build/install the core libs from pip. not by having to everything by hand to keep up with the zyre engine [or czmq]. i'm not aiming to "load pyre if it fails to find the others" i'm aiming for "it just does magic and builds it" .. sorta like pyzmq does. if people want to continue with a PP version (ie: pyre), that's a-OK. totally understand. but other languages seem to be suffering from the ability of keeping up with the C-engine too, so finishing the build system and making magic happen (ie: pip install pyzre .. and it builds the C libs for you) seems like the next best thing... (imho). right now, this loads the python [zproject generated] bindings and everything [including the gossip engine] seems to work. next step is factoring in some pythonic methods to get encryption working (and cleaner integration with native pyzmq Sockets, i have some examples just need to clean them up). [again, not arguing which way is best, just contributing back, if it's useful, great, if not ... it's there if anyone ever needs it] |
I noticed that this is in the TODO list. Any progress on this? If there is a protocol spec for this I could do a PR and work on it.
The text was updated successfully, but these errors were encountered: