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

Create a YANG-based data model for PED files #73

Open
7 of 12 tasks
mpeuster opened this issue Feb 21, 2019 · 1 comment
Open
7 of 12 tasks

Create a YANG-based data model for PED files #73

mpeuster opened this issue Feb 21, 2019 · 1 comment
Assignees
Labels

Comments

@mpeuster
Copy link

mpeuster commented Feb 21, 2019

Use a YANG model to have a clear schema for the PED files. This can also serve as input to IETF work.

Developments: https://github.com/mpeuster/tng-sdk-benchmark/blob/feature-73/models/

YANG background

Examples

Tooling

Custom toolchain called from Makefile.

The toolchain automatically generates different model documentations in doc/ (txt tree, html tree, uml). It also generates the Python model (ietf_ped_model.py) and finally it checks the example PEDs (*.yaml) against this model by loading them into the model.

Requirements:

  • pip install pyang pyangbind
  • pyang also needs to be install system wide to have correct paths to schema artefacts in system dirs

Call:

# validate model, build model, and test examples
make

# single targets
make validate # validate the model against ietf rules
make build # generate the python code model
make test # test the example PED files against model

TODOs Toolchain

  • setup tooling (editor, pyang generation, documentation in README)
  • create models folder in repo
  • initial model to play with https://github.com/mpeuster/tng-sdk-benchmark/blob/feature-73/models/ped.yang
  • tool to validate PED file (*.yml) against YANG model: Custom build
  • Jenkins integration (can we also trigger tests etc. with pytest? tox?)
  • Problem: mandatory fields are not mandatory in validation (ignore this for now)
  • ...

TODOs Model

  • complete model
  • be more specific with units like CIDRs for addresses
  • be more specific in many of the string types. See pattern keyword.

TODO Implementation

  • make should place generated model to the right place in the source tree
  • update implementation to support new model

Goal

Replace all legacy interactions with the PED model inside tng-sdk-bench with a pyang/pybind based solution using generated Python code.

@mpeuster mpeuster self-assigned this Feb 21, 2019
mpeuster pushed a commit to mpeuster/tng-sdk-benchmark that referenced this issue Feb 21, 2019
Signed-off-by: peusterm <[email protected]>
mpeuster pushed a commit to mpeuster/tng-sdk-benchmark that referenced this issue Mar 5, 2019
mpeuster pushed a commit to mpeuster/tng-sdk-benchmark that referenced this issue Mar 5, 2019
…eem to be not

validated :-(

Signed-off-by: peusterm <[email protected]>
@mpeuster mpeuster changed the title Create a YNAG-based data model for PED files Create a YANG-based data model for PED files Mar 6, 2019
@mpeuster
Copy link
Author

mpeuster commented Mar 8, 2019

Status: Model is finished so far (at least we should be able to express everything we expressed before).

Next step: Implementation in code!

mpeuster pushed a commit to mpeuster/tng-sdk-benchmark that referenced this issue Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant