Skip to content

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

@mpeuster

Description

@mpeuster

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions