-
Notifications
You must be signed in to change notification settings - Fork 99
Add lightweight netlab API server command #2969
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
Conversation
|
This is primarily an automation I built to hook netlab into Semaphore UI |
|
Thank you ! I certainly see some future in this. Could you please write some words describing the problem you are trying to solve with this commit? So we can start from a common understanding? |
|
Engineers here need to model and test lots of different vendors and networks. We've had some internal tooling in the past to do this manually (some hack expect style scripts), but have switched to netlab to make the environment a bit more composable. We started using Semaphore UI (https://semaphoreui.com/) as a job execution engine, which works well with the built in terraform/ansible worklows in a multi-user environment. It can also do manual bash/python scripts. I'd started with bash scripts with sshpass, but found them kinda brittle. I wanted to switch to an API based workflow to make it a bit more robust. I'd initially wrote a FastAPI based wrapper that imports these functions (which I'm still using), but I had the thought that this could be easily extended in the native CLI workflow. A typed version I think still has use and this could be extended for that. |
|
@captainpacket -- Thanks a million for the PR. Definitely an interesting idea ;) and I truly appreciate you crossing all the Ts and dotting all the Is. Give me a few days -- I'm stuck in the "we have to deal with another Ansible brokenness" bog, and have to get out of that first. |
61a1f3d to
76d3284
Compare
76d3284 to
57e732e
Compare
|
Cleaned up a few semaphore specific things (project/task) that I'd left behind; added minimal authentication and TLS option |
ipspace
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly minor details and improvement suggestions, the only showstopper is whether jobs can be run in parallel and how to handle that.
ipspace
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you & welcome to the club ;)
|
@captainpacket -- Looks like you overcomplicated typing definitions and made mypy unhappy (CI check has failed). It could be a real mismatch (in which case it needs to be fixed), or just a confusing type (I would something go just with typing.List or typing.Callable without specifying the details). |
Ahh yeah - I overspecified the typing a bit. I loosened it up and mypy passes locally. |
Adds a minimal netlab API server (stdlib HTTP) to expose CLI actions for automation. Includes new CLI command, help listing, and docs page.