Script tool to generate WRS configurations
The tool is used to generate configuration files (dot-config_*) for dedicated WRS layers used in GSI WR Timing Networks:
- Grand Master
- Service
- Local Master
- Distribution
- Access (and its special cases)
The tool consists of a set of items (VLAN definition, WRS layers, port roles and default configuration object), Python modules to generate configuration objects (JSON) and WRS port-models (in DOT and SVG). For more details on items refer to Network: White Rabbit Installation. It also uses an external tool from CERN: WRS configuration generator.
The tool directory contents are:
- items: vlans.json, switch_layers.json, port_roles.json, dot-config.json
- configuration object generator: make_config_obj.py
- WRS port-model generator: make_port_model.py
- desired switch roles: switches.json
- generated configurations and objects: dot-config_* in 'output' sub-directory
The WRS configuration is generated in two steps. User needs to supply required switch roles in 'switches.json'.
In the first step, the configuration object generator produces so-called configuration objects in JSON. For that object generator uses provided items. The items are templates defined by WRS experts.
Switch roles -> configuration object generator -> configuration objects (JSON)
In the next step, the desired switch configurations are generated with the CERN tool.
Configuration objects -> CERN configuration generator -> configurations (dot-config_)*
Optionally, one can make WRS port-model from the generated configuration. The port-models are actually designated to visualize the VLAN configuration of WRS.
Configuration -> port-model generator -> port-model (DOT, SVG)
A host with Python (3.6+) and graphviz package is required!
- Download the repo.
git clone https://github.com/GSI-CS-CO/wrs_config --recursive
In order to generate pre-defined configurations, invoke following make commands:
make clean
make all
It will produce WRS configurations in 'output/config' sub-directory. An another remote Git repository, wrs_tn2_configuration, which contains generated WRS configurations, is embedded as submodule. Once user is confident with newly generated dot-configs, they have to committed manually into the submodule repository.
(sudo) apt install pip
(sudo) apt install graphviz
(sudo) apt install whois # (Debian-based)
(sudo) pip install requests
Refer to README.md of forked wrs-config-generator.