This file is included with the dyntopo namespace package and provides detailed instructions on how to add new orchestrator packages.
Note
For better viewing/reading of this document, use restview.
For example:
restview -l 0:8080 README.rst
And then browse to http://your_machine:8080
Here is the location of the dyntopo online documentation.
- For architectural and design details, please refer to the
- dyntopo plugin designers guide.
To contribute, you need to fork the repository, do your modifications and create a new pull request.
Please make sure you have the full pyats package installed via ```pip install pyats[full]```.
To build the docs locally on your machine. Please follow the instructions below
- Go to the dyntopo Github repository <https://github.com/CiscoTestAutomation/dyntopo>
- On the top right corner, click
`Fork`. (see <https://help.github.com/en/articles/fork-a-repo>) - In your terminal, clone the repo using the command shown below:
git clone https://github.com/<your_github_username>/dyntopo.git cd dyntopo/docs- Use
make install_build_deps`to install all of the build dependencies - Run
make docs`to generate documentation in HTML - Wait until you see
`Done`in your terminal - The documentation is now built and stored under the directory
`dyntopo/__build__` - Run
`make serve`to view the documentation on your browser - Please create a PR after you have made your changes (see [commit your changes](https://pubhub.devnetcloud.com/media/pyats-development-guide/docs/contribute/contribute.html#commit-your-changes) & [open a PR](https://pubhub.devnetcloud.com/media/pyats-development-guide/docs/contribute/contribute.html#open-a-pull-request))
Here are a few examples that could be great pull request:
- Fix Typos
- Better wording, easier explanation
- More details, examples
- Anything else to enhance the documentation
- For detail on contributing to pyATS, please follow the [contribution guidelines](https://pubhub.devnetcloud.com/media/pyats-development-guide/docs/contribute/contribute.html#)
This guide contains details on how to extend dyntopo with new platforms, capabilities and device platform types.
There are a few things to keep in mind when you want to add a new orchestrator:
- Be aware of cisco-shared policies.
- Use the
laasmodule as a template, create new directorydyntopo/<your_orch_name>/src/dyntopo/<your_orch_name>. Your orchestrator code, examples, tests and README.rst are placed under this directory. - Please ensure you place your examples under the following directory:
dyntopo/<your_orch_name>/src/dyntopo/<your_orch_name>/examples/dyntopo_<your_orch_name>. This allows for consistency among user plugins, as examples are automatically written into the top-levelexamplesdirectory in the pyATS workspace wheredyntopois pip-installed. - Create a new directory
dyntopo/<your_orch_name>/docs. - Create softlinks
dyntopo/<your_orch_name>/examples,dyntopo/<your_orch_name>/testsanddyntopo/<your_orch_name>/README.rst. - Update the top-level
dyntopo/Makefileanddyntopo/setup.pywith your orchestrator. - Add a softlink
dyntopo/docs/<your_orch_name>. Link your documentation to the top-leveldyntopo/docs/index.rst. - You must inherit from
ats.kleenex.BringUpWorkerBaseand call the parent__init__in the first line of your__init__. - You should inherit from
ats.kleenex.ArgvQuotingParseras it provides extra debugging in the event an exception is thrown in CLI argument processing. - You should use
ats.kleenex.parse_cli_argsas all required common logic is provided for you, this adheres to the pyATS argument propagation policy. - You should use exceptions such as
ats.kleenex.TopologyDidntComeUpInTimeas they provide a consistent way of reporting issues common to multiple orchestrators. - Expect
ats.kleenex.SignalErrorto be raised at any time as part of pyATS core bringup's signal handling model. - You must implement
_launch_topologyand_tear_down_topologywhich are asyncio coroutines. - You must define a CLI parser that contains the same parameter names as
those in your
__init__prototype (as per pyATS argument propagation policy. Any parameter specified via CLI must override parameters given in the constructor. Any internal parameters that don't directly face the user may be excused from this policy as long as they are documented. - You must implement a version of
main.pythat auto-assigns the-orchestratorinput to the pyATS core bringup tool to your worker class, think up a name for your decoupled bringup tool and update setup.py entry_points. Have your tool'smaincallats.kleenex.main(). Ensure the tool name ends with the charactersbringupso that the-orchestratorparameter does not appear in the tool's-helpdisplay. - You must provide in the
console_scriptssection ofsetup.pyan entry defining the decoupled bringup tool name to use for your orchestrator. The name of this tool must be of the formxxxbringup, wherexxxis the name of your orchestrator. - You must check
self.helpand follow the appropriate logic path when bringup is being run via a decoupled tool in-helpmode. Typically this means skipping bringup altogether. - You must implement
update_helpso that your decoupled bringup tool will have a correct help display. - You must identify those CLI parameters that have an equivalent in the
clean schema, and must tag them with
help_suppress_kleenexwhen adding arguments to your orchestrator's CLI command parser. - You must implement
_set_log_leveland set the log level of all your modules. - You must provide the actual-to-logical device name translation
by populating
self.dev_name_xrefprior to calling_process_tb_config. - You must call
self._process_tb_configwhen the actual topology configuration is ready to be handed off to pyATS core bringup for post-processing and ultimate exposure to the user. - Add new configuration keys to
dyntopo/common/src/dyntopo/common/schema.pyfor your orchestrator and- ensure you validate clean configuration by calling
config_loader.load(self.clean_config)and update the common/schema documentation.
- If you introduce new orchestrator-specific keys into the logical topology
schema, be sure to document them and append them to the worker's
self._logical_device_keys_to_ignoreandself._logical_interface_keys_to_ignoremembers to ensure they are not merged into the final testbed content. Don't forget to update the common/schema documentation. - Make sure that if you need to raise an exception in the worker's
constructor that you call
self._raise_exception(exception)to ensure the worker is shut down properly. - Make sure that if you need to raise an exception in any worker coroutine
that you call
self._store_exception(exception)to store the exception for later processing. - Ensure you add a timer for max_launch_time_minutes handling. See other orchestrators for implementation details.