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

Common graph integrations #145

Merged
merged 25 commits into from
Oct 31, 2022
Merged

Conversation

thebracket
Copy link
Collaborator

This PR contains the work I've been doing on the integration system in general, and UISP/Spylnx in particular.

Rather than duplicate work between integrations, a lot of common functionality is now in integrationCommon.py. Integrations start by making a new NetworkGraph object, and adding nodes to it. Nodes can be sites, APs, or clients. While adding, fill in an id field and a parentId field. Once added, calling prepareGraph() builds the tree. You can then output the network.json file with createNetworkJson and the ShapedDevices.csv file with createShapedDevices().

There is also support for using graphviz (if you have it installed) to produce a network map of the discovered topology. If you don't have it installed, it skips this step.

There are also a bunch of unit tests.

This has been tested against UISP, and the test Splynx (Spylnx support is a bit limited, making a flat network only). UISP integration mode can be set with uispStrategy in ispConfig.py. "full" will attempt to map the network based on data-links, and "flat" will generate a simple, flat topology.

…he test-bed. Not ready for use.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…stem a bit.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
… and the children rearranged to preserve speed limits in a sane manner (so a shared relay can have X for one customer, Y for another and Z as a limit)

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…dividual steps private methods.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…result.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…mented once again.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
… yet.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…P integration.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…n-mapped circuits needing to go to the top.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…on system. Add unit tests to ensure that it works.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
… on node add. That makes it work across all integrations.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
… own integration.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
…ented, and uses the NetworkGraph framework. I'm going to have to find some more test data to make sure it actually works.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
@rchac rchac merged commit 7359727 into LibreQoE:main Oct 31, 2022
@rchac
Copy link
Member

rchac commented Oct 31, 2022

Awesome work! Thank you so much.

I did notice two things:

  • The integrationCommon.py file would output the actual list object of device["ipv4"] and device["ipv6"] into the ShapedDevices.csv file, brackets and quotes included. It's hard to parse that on the LibreQoS.py end because apparently we can't just do actualList = list(inputString) in python - it actually splits the string up by character when I do that. So my fix was to parse that as a string, removing the brackets and quotes for entries, just before outputting to the ShapedDevices.csv file.

So this one's fixed. =)

  • integrationCommon.py iterates starting at 0 for the Circuit ID. The problem there is that LibreQoS.py uses Circuit ID as a unique identifier to determine if it needs to update a given circuit, or remove it (during the day, before a full reload). As it stands, that generated incrementing number used could lead to different circuit IDs being chosen each time for the same circuit. LibreQoS will then tear down most of the network heirarchy multiple times a day, instead of just affecting the intended circuits.

Is there any way to have integrationUISP.py and integrationCommon.py use the UISP subscriber site ID as the Circuit ID by default - so it doesn't change each time?

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

Successfully merging this pull request may close these issues.

None yet

2 participants