Skip to content
New issue

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

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

Already on GitHub? # to your account

Connectivity graph #17

Closed
hsanjuan opened this issue Jan 2, 2017 · 4 comments
Closed

Connectivity graph #17

hsanjuan opened this issue Jan 2, 2017 · 4 comments
Assignees
Labels
exp/intermediate Prior experience is likely helpful kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up
Milestone

Comments

@hsanjuan
Copy link
Collaborator

hsanjuan commented Jan 2, 2017

Need an easy way to list all libp2p nodes involved in cluster (members and IPFS) and see what's connected to what (ideally everything is connected to everything).

@hsanjuan hsanjuan added this to the Beta milestone Jan 2, 2017
hsanjuan added a commit that referenced this issue Feb 27, 2017
This adds snapshot and restore methods to state and uses the snapshot
one to save a copy of the state when shutting down. Right now, this is
not used for anything else.

Some lines performing a migration, but this is only an idea of how it could
work.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
hsanjuan added a commit that referenced this issue Mar 10, 2017
This adds snapshot and restore methods to state and uses the snapshot
one to save a copy of the state when shutting down. Right now, this is
not used for anything else.

Some lines performing a migration, but this is only an idea of how it could
work.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
hsanjuan added a commit that referenced this issue Mar 10, 2017
This adds snapshot and restore methods to state and uses the snapshot
one to save a copy of the state when shutting down. Right now, this is
not used for anything else.

Some lines performing a migration, but this is only an idea of how it could
work.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
hsanjuan added a commit that referenced this issue Mar 10, 2017
This adds snapshot and restore methods to state and uses the snapshot
one to save a copy of the state when shutting down. Right now, this is
not used for anything else.

Some lines performing a migration, but this is only an idea of how it could
work.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
hsanjuan added a commit that referenced this issue Mar 10, 2017
This adds snapshot and restore methods to state and uses the snapshot
one to save a copy of the state when shutting down. Right now, this is
not used for anything else.

Some lines performing a migration, but this is only an idea of how it could
work.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
hsanjuan added a commit that referenced this issue Mar 13, 2017
This adds snapshot and restore methods to state and uses the snapshot
one to save a copy of the state when shutting down. Right now, this is
not used for anything else.

Some lines performing a migration, but this is only an idea of how it could
work.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
@hsanjuan hsanjuan added exp/intermediate Prior experience is likely helpful kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked labels Oct 10, 2017
@ZenGround0
Copy link
Collaborator

@hsanjuan @dgrisham Below is a proposal of one way this could be done. @hsanjuan I know you have been thinking about this for a relatively long time so I am interested to hear your thoughts and suggestions for improvement. Send me your feedback!

Drawing out the full connectivity graph in ascii art of a varying number of cluster and ipfs nodes is difficult. I propose that the connectivity display instead show very simple responses in the case where everything is healthy. Then in the case where nodes are unexpectedly disconnected it should show the connectivity graphs and broken links for each of these nodes one at a time. Furthermore I propose breaking down the prompts into describing cluster node and then ipfs node connectivity. For example in the case where everything is connected:

> ipfs-cluster-ctl graph
All cluster peers are connected
All ipfs daemons are connected

And in the case where nodes are disconnected:

> ipfs-cluster-ctl graph
2 cluster peers not fully connected: QmAAAaaa, QmCCCccc
______________________________________________________________________________
IPFS daemons                                               IPFS Cluster Peers
______________________________________________________________________________

Qmasdfasdf <------->X-------------X <---------------------> QmBBBbbb
                    |  QmAAAaaa   | <---------------------> QmDDDddd
                    X-------------X <----\          \----->  QmCCCccc

______________________________________________________________________________

Qmhjklhjkl <-\   \->X-------------X <---------------------> QmBBBbbb
                    |  QmCCCccc   | <---------------------> QmDDDddd
                    X-------------X <----\          \----->  QmAAAaaa

1 IPFS daemon not fully connected: Qmhjklhjkl
______________________________________________________________________________
IPFS daemons                                               IPFS Cluster Peers
______________________________________________________________________________

Qmasdfasdf <--------->X-------------X <----\          \-----> QmCCCccc
Qmyuioyuio <--------->|  Qmhjklhjkl | 
Qmertyerty <--------->X-------------X 

The command could further take a peer id as an argument e.g. ipfs-cluster-ctl graph QmAAAaaa and only display the connectivity graph of that peer in the same fashion as above.

Note that the general approach above could also just list out connected peers and disconnected peers in a table, but I think that visually showing connections and links leads to smoother processing of the information.

@hsanjuan
Copy link
Collaborator Author

As I see this, the command should generate a DOT file (https://en.wikipedia.org/wiki/DOT_(graph_description_language)). This format can then be used by existing programs (graphviz suite) to print the graph in whatever format is appropiate.

For example, once you have the graph definition with all existing connections you can do something like a 'complement' operation to see which paths are missing. Probably it makes sense to provide 3 graphs :

  • ipfs-cluster peers connections to other peers
  • ipfs-cluster peers connections to their ipfs daemons
  • ipfs daemons connections to other ipfs-daemons in the cluster

I am not sure how much of this is server-side work or ctl side (the server could provide the necessary lists of connections).

Implementing yourself an ascii graph representation might be a greater time sink than this issue deserves...

@ZenGround0
Copy link
Collaborator

Thanks for the feedback, I see your point of view and will ease up on a full blown ascii graph in favor of making a dot file. I'll be working on branch: https://github.com/ipfs/ipfs-cluster/tree/feat/connectivity-graph if anyone is interested in taking a look.

@ZenGround0 ZenGround0 self-assigned this Oct 19, 2017
@hsanjuan hsanjuan added status/in-progress In progress and removed help wanted Seeking public contribution on this issue status/ready Ready to be worked labels Oct 27, 2017
@hsanjuan hsanjuan mentioned this issue Jan 17, 2018
@hsanjuan hsanjuan added need/review Needs a review and removed status/in-progress In progress labels Jan 17, 2018
@hsanjuan
Copy link
Collaborator Author

#291 fixes this

@ghost ghost removed the need/review Needs a review label Jan 26, 2018
@hsanjuan hsanjuan mentioned this issue Feb 7, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
exp/intermediate Prior experience is likely helpful kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

No branches or pull requests

2 participants