-
Notifications
You must be signed in to change notification settings - Fork 194
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
contrib: add helper to graph current configuration #1303
contrib: add helper to graph current configuration #1303
Conversation
6b42a99
to
791ce4f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1303 +/- ##
======================================
Coverage 62.7% 62.7%
======================================
Files 163 163
Lines 12001 12001
======================================
Hits 7532 7532
Misses 4469 4469 ☔ View full report in Codecov by Sentry. |
Does this actually use anything from |
Not much apart from the "setup". I thought it kind of made sense to group, but I'm happy to separate it. I'll update the PR |
d3dab9f
to
4043914
Compare
I ended up finding a solution to share the event loop between fastapi and labgrid so I also updated the script to serve the graph in a browser. |
4043914
to
cafa749
Compare
ab523e3
to
df8b7ad
Compare
A visual representation can help make sense of a large configuration quickly. As such, add a command line helper to generate a graphviz graph of the resources and places in a given environment. By default, this graph will be served on http://localhost:8800/labgrid/graph Signed-off-by: Liam Beguin <liambeguin@gmail.com>
df8b7ad
to
f99c44b
Compare
I just rebased this MR on the latest master. If there are no other comments I think this would be ready to merge. |
Description
Add a sub-command to sync-places to generate a graphviz graph of the resources and places in a given environment.
A visual representation can help make sense of a large amount of information quickly.
This tried to put all relevant information in one place without being overly complicated.
I also tired to use a color blind friendly palette, not sure how that turned out..
I'm very open to modifying this based on feedback and recommendations.
I also tried to put this into a separate tool using fastapi to have the graph rendered in a browser directly, but ran into trouble. If that approach is preferred I can also push that instead, and maybe with a bit of support we can get it to work consistently.
Testing
$ ./labgrid/contrib/sync-places.py graph | dot -Tsvg -o labgrid-graph.svg
By default the command will just output a dot graph to stdout, piping that to
dot
we can generate images.As noted in the docstring, this will generate a graph with:
here's a simple example of what the output looks like:
![image](https://private-user-images.githubusercontent.com/3811160/286736329-de8c5742-c3b0-4982-a305-5bf5897577f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTU3ODgsIm5iZiI6MTczOTYxNTQ4OCwicGF0aCI6Ii8zODExMTYwLzI4NjczNjMyOS1kZThjNTc0Mi1jM2IwLTQ5ODItYTMwNS01YmY1ODk3NTc3ZjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMTAzMTI4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmUxNzA0ODViMTNkY2QwNWJlNDRlN2MyZmMyOTA1MzMyMGM0NTYyYTIyYTUwZGM5YTU1ZGU0MDVlNDg1MzY1MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ngDB2lgjN5df4dyePXWemt07f-4-MinNqQB4BdXs9fY)
Checklist