cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4116
Views
10
Helpful
5
Replies

Getting started with YANG Suite

jcohoe
Cisco Employee
Cisco Employee

YANG Suite is here

Well after a long anticipated release the YANG Suite tooling is finally here. Lets take a quick look at some resources for the tool as well as the getting started workflow once it has been installed and is running.

 

Resources

 

DevNet/YANGSuite: https://developer.cisco.com/yangsuite

Documentatoin: https://developer.cisco.com/docs/yangsuite 

Github repository: https://github.com/CiscoDevNet/yangsuite

Learning Lab: https://developer.cisco.com/learning/lab/intro-yangsuite/step/1

PyPi: https://pypi.org/project/yangsuite/

BrightTalk Webinar: https://www.brighttalk.com/webcast/17628/455586/the-wait-is-over-for-the-cisco-yang-suite-tooling

 

Installation

 

Installation using Git and docker is recommended:

 

 

git clone https://github.com/CiscoDevNet/yangsuite
cd yangsuite/docker/ ; ./gen_test_certs.sh
docker-compose up

 

 

The containers are ready when the following is seen on the console:

 

 

Successfully built 7f0c52fbeb08
Successfully tagged backup:latest
Starting docker_yangsuite_1 ... done
Starting docker_backup_1    ... done
Recreating docker_nginx_1   ... done
...
yangsuite_1 | spawned uWSGI master process (pid: 34)
yangsuite_1 | spawned uWSGI worker 1 (pid: 38, cores: 1)
yangsuite_1 | spawned uWSGI worker 2 (pid: 39, cores: 1)
yangsuite_1 | spawned uWSGI worker 3 (pid: 40, cores: 1)
yangsuite_1 | spawned uWSGI worker 4 (pid: 41, cores: 1)
yangsuite_1 | spawned uWSGI worker 5 (pid: 42, cores: 1)

 

 

Access YANG Suite at https://localhost to being working with the tool

 

Day 0 Workflow

Now that the tool is accessible lets look at the getting started workflow:

  • Check for updates
  • Add the DevNet Always IOS XE device
  • Download YANG files
  • Explore YANG
  • Interact with NETCONF
  • Receive gRPC telemetry
  • ... etc

 

Demo Video

Each of the above steps are covered in detail in the demo video. Lets watch Getting started with Cisco YANG Suite on YouTube 

 

Thank you, please let me know if you found this helpful

 

 

 

5 Replies 5

Hi Jeremy,

How can we have multiple YANG Suite preferences files (/home/user/.config/yangsuite/yangsuite.ini) in a Python installation?

Is there any option to save different files per each venv we create? 

Thanks

shuangli
Cisco Employee
Cisco Employee

can't found gen_test_certs.sh file after git clone:

 

root@localhost yangsuite]# cd yangsuite/docker/ ; ./gen_test_certs.sh
bash: cd: yangsuite/docker/: No such file or directory
bash: ./gen_test_certs.sh: No such file or directory
[root@localhost yangsuite]# docker-compose up
ERROR: Couldn't find env file: /yangsuite/yangsuite/docker/yangsuite/setup.env
[root@localhost yangsuite]#

Hi @shuangli - There is a new startup script for Docker:

git clone https://github.com/CiscoDevNet/yangsuite
cd yangsuite/docker/ ; bash ./start_yang_suite.sh

It's also documented on Github: https://github.com/CiscoDevNet/yangsuite/tree/main

HTH
Marcel

gavid
Level 1
Level 1

Hi

I have a similar issue to @shuangli .  It feels like I'm missing something fundamental like an environment path setting or something similar.

No matter what platform I install on I cant get the yangsuite command to be recognised as though it isn't installed correctly.  I have tried  Ubuntu 22.04/20.04 VMs both docker and pip installs, windows the same pip/WSL2 or docker and brew for MacOS.

The docker error is as below:

 

1

# Copyright 2022 Cisco Systems, Inc
2


3

FROM ubuntu:20.04
4


5

ENV DOCKER_RUN  true
6


7

ARG PY=python3
8

ARG PY_VER=3.8
9

ARG YS_DIST=/usr/local/lib/python${PY_VER}/dist-packages/yangsuite/
10

ARG YS_SETTINGS=${YS_DIST}/settings/
11


12

# Postgres requires timezone to be specified at run time
13

RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
14


15

# Install required packages and remove the apt packages cache when done
16

RUN apt-get update && \
17

    apt-get install -y \
18

        git \
19

        software-properties-common \
20

        postgresql \
21

        openssh-client \
22

        iputils-ping \
23

        python3.8 \
24

        python3-pip \
25

        gcc \
26

        libffi-dev \
27

        sqlite3 \
28

        vim \
29

        snmp \
30

        sendmail \
31

        && \
32

    apt-get clean && \
33

    rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
34


35

# Run the rest of the commands as the ``postgres`` user created by the ``postgres`` package when it was ``apt-get installed``
36

# USER postgres
37


38

# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
39

# then create a database `docker` owned by the ``docker`` role.
40

# Note: here we use ``&&\`` to run commands one after the other - the ``\``
41

#       allows the RUN command to span multiple lines.
42

# RUN   /etc/init.d/postgresql start &&\
43

44

#     createdb -O ysadmin yangsuite_db
45


46

RUN mkdir -p /yangsuite/uwsgi
47

COPY uwsgi.ini /yangsuite/
48

COPY migrate_and_start.sh /yangsuite/
49

RUN chmod +x /yangsuite/migrate_and_start.sh
50

RUN pip3 install --upgrade pip
51

RUN pip3 install --upgrade setuptools wheel uwsgi
52


53

# For PostgresSQL
54

# RUN  pip3 install --upgrade psycopg2-binary==2.8.6 tzdata
55


56

# Installing YANG Suite
57

RUN pip3 install --upgrade --no-cache yangsuite
58


59

# Installing YANG Suite optional free plugins
60

RUN pip3 install --upgrade --no-cache \
61

    yangsuite-grpc-telemetry \
62

    yangsuite-coverage \
63

    yangsuite-gnmi \
64

    yangsuite-restconf
65


66

# Uncomment to add another pypi repository to search for here
67

#
68

# ARG PIP_EXTRA_URL=https://private.pypi.com/simple
69

# RUN pip3 install --upgrade --no-cache --extra-index-url=${PIP_EXTRA_URL}  private_lib
70


71

# Uncomment to install optional plugin or replacement wheels
72

#
73

# COPY *.whl /yangsuite/
74

# RUN pip3 install --upgrade --no-cache /yangsuite/*.whl
75


76

COPY production.py ${YS_SETTINGS}
77

COPY wsgi.py ${YS_DIST}
78

RUN mkdir /ys-data
79

RUN mkdir /ys-static
80


81

RUN yangsuite --save-settings --configure-only \
82

    --allowed-hosts localhost \
83

    --static-root /ys-static \
84

    --data-path /ys-data \
85

    --settings yangsuite.settings.production
/bin/sh: 1: yangsuite: not found

86


87

# For PostgresSQL
88

# CMD service postgresql start
89


90

CMD /etc/init.d/sendmail start
91

 

 

When i run the python command from a venv i get the same:

 

(.venv) xxx@xxx-wks:~/testing/yangsuite$ yangsuite
yangsuite: command not found
(.venv) xxx@xxx-wks:~/testing/yangsuite$

 

 

 

(.venv) xxx@xxx-wks:~/testing/yangsuite/.venv$ cd lib/python3.10/site-packages/
(.venv) xxx@xxx-wks:~/testing/yangsuite/.venv/lib/python3.10/site-packages$ ls
Automat-22.10.0.dist-info                      netmiko
Deprecated-1.2.14.dist-info                    netmiko-2.4.2.dist-info
Django-5.0.2.dist-info                         networkx
GitPython-3.1.42.dist-info                     networkx-3.2.1.dist-info
Jinja2-3.1.3.dist-info                         numpy
Markdown-3.5.2.dist-info                       numpy-1.24.4.dist-info
MarkupSafe-2.0.1.dist-info                     numpy.libs
OpenSSL                                        openpyxl
PyGithub-2.2.0.dist-info                       openpyxl-3.1.2.dist-info
PyJWT-2.8.0.dist-info                          ordered_set
PyNaCl-1.5.0.dist-info                         ordered_set-4.1.0.dist-info
PyYAML-6.0.1.dist-info                         packaging
XlsxWriter-3.1.9.dist-info                     packaging-23.2.dist-info
__pycache__                                    pandas
_cffi_backend.cpython-310-x86_64-linux-gnu.so  pandas-1.5.3.dist-info
_distutils_hack                                paramiko
_yaml                                          paramiko-2.12.0.dist-info
amqp                                           past
amqp-5.2.0.dist-info                           pexpect
appdirs-1.4.4.dist-info                        pexpect-4.9.0.dist-info
appdirs.py                                     pip
asgiref                                        pip-24.0.dist-info
asgiref-3.7.2.dist-info                        pkg_resources
async_timeout                                  prompt_toolkit
async_timeout-4.0.3.dist-info                  prompt_toolkit-3.0.43.dist-info
attr                                           protobuf-4.25.3.dist-info
attrs                                          ptyprocess
attrs-23.2.0.dist-info                         ptyprocess-0.7.0.dist-info
autobahn                                       pyOpenSSL-24.0.0.dist-info
autobahn-23.6.2.dist-info                      pyang
automat                                        pyang-2.6.0.dist-info
bcrypt                                         pyasn1
bcrypt-4.1.2.dist-info                         pyasn1-0.5.1.dist-info
beautifulsoup4-4.12.3.dist-info                pyasn1_modules
billiard                                       pyasn1_modules-0.3.0.dist-info
billiard-4.2.0.dist-info                       pycparser
bs4                                            pycparser-2.21.dist-info
celery                                         pyserial-3.5.dist-info
celery-5.3.6.dist-info                         python_dateutil-2.8.2.dist-info
certifi                                        python_dotenv-1.0.1.dist-info
certifi-2024.2.2.dist-info                     python_json_logger-2.0.7.dist-info
cffi                                           python_slugify-4.0.1.dist-info
cffi-1.16.0.dist-info                          pythonjsonlogger
channels                                       pytz
channels-4.0.0.dist-info                       pytz-2024.1.dist-info
channels_redis                                 redis
channels_redis-4.2.0.dist-info                 redis-5.0.1.dist-info
charset_normalizer                             regex
charset_normalizer-3.3.2.dist-info             regex-2023.12.25.dist-info
click                                          requests
click-8.1.7.dist-info                          requests-2.31.0.dist-info
click_didyoumean                               rest_framework
click_didyoumean-0.3.0.dist-info               scp-0.14.5.dist-info
click_plugins                                  scp.py
click_plugins-1.1.1.dist-info                  serial
click_repl                                     service_identity
click_repl-0.3.0.dist-info                     service_identity-24.1.0.dist-info
concurrent                                     setuptools
confusable_homoglyphs                          setuptools-69.1.0.dist-info
confusable_homoglyphs-3.3.1.dist-info          six-1.16.0.dist-info
constantly                                     six.py
constantly-23.10.4.dist-info                   slugify
corsheaders                                    sly
cryptography                                   sly-0.5.dist-info
cryptography-42.0.3.dist-info                  smmap
daphne                                         smmap-5.0.1.dist-info
daphne-4.1.0.dist-info                         soupsieve
dateutil                                       soupsieve-2.5.dist-info
deepdiff                                       sqlparse
deepdiff-4.0.7.dist-info                       sqlparse-0.4.4.dist-info
deprecated                                     testdata
distutils-precedence.pth                       text_unidecode
django                                         text_unidecode-1.3.dist-info
django_cors_headers-4.3.1.dist-info            textfsm
django_filter-23.5.dist-info                   textfsm-1.1.3.dist-info
django_filters                                 twisted
django_registration                            twisted-23.10.0.dist-info
django_registration-3.4.dist-info              txaio
djangorestframework-3.14.0.dist-info           txaio-23.1.1.dist-info
djproxy                                        typing_extensions-4.9.0.dist-info
djproxy-2.3.6.dist-info                        typing_extensions.py
docker                                         tzdata
docker-4.4.4.dist-info                         tzdata-2024.1.dist-info
docutils                                       urllib3
docutils-0.20.1.dist-info                      urllib3-1.26.18.dist-info
dotenv                                         vine
elastic_transport                              vine-5.1.0.dist-info
elastic_transport-8.12.0.dist-info             wcwidth
elasticsearch                                  wcwidth-0.2.13.dist-info
elasticsearch-7.17.9.dist-info                 websocket
et_xmlfile                                     websocket_client-1.7.0.dist-info
et_xmlfile-1.1.0.dist-info                     wheel
future                                         wheel-0.42.0.dist-info
future-0.18.3.dist-info                        whitenoise
futures-3.0.5.dist-info                        whitenoise-4.1.4.dist-info
git                                            wrapt
gitdb                                          wrapt-1.16.0.dist-info
gitdb-4.0.11.dist-info                         xeger
github                                         xeger-0.3.4.dist-info
google                                         xlsxwriter
grpc                                           yaml
grpcio-1.60.1.dist-info                        yamlordereddictloader-0.4.0.dist-info
hyperlink                                      yamlordereddictloader.py
hyperlink-21.0.0.dist-info                     yang
idna                                           yang.connector-24.1-py3.10-nspkg.pth
idna-3.6.dist-info                             yang.connector-24.1.dist-info
incremental                                    yangsuite
incremental-22.10.0.dist-info                  yangsuite-3.0.0.dist-info
jinja2                                         yangsuite_coverage-3.0.16.dist-info
jsonfield                                      yangsuite_devices-2.9.10.dist-info
jsonfield-3.1.0.dist-info                      yangsuite_filemanager-1.9.10.dist-info
jsonpickle                                     yangsuite_gnmi-2.7.13.dist-info
jsonpickle-3.0.2.dist-info                     yangsuite_grpc_telemetry-1.0.8.dist-info
jwt                                            yangsuite_netconf-1.17.25.dist-info
kombu                                          yangsuite_restconf-2.1.9.dist-info
kombu-5.3.5.dist-info                          yangsuite_yangtree-2.1.10.dist-info
libfuturize                                    yscoverage
libpasteurize                                  ysdevices
lxml                                           ysfilemanager
lxml-4.9.4.dist-info                           ysgnmi
markdown                                       ysgrpctelemetry
markupsafe                                     ysnetconf
msgpack                                        ysrestconf
msgpack-1.0.7.dist-info                        ysyangtree
nacl                                           zope
ncclient                                       zope.interface-6.2-py3.10-nspkg.pth
ncclient-0.6.15.dist-info                      zope.interface-6.2.dist-info
(.venv) xxx@xxx-wks:~/testing/yangsuite/.venv/lib/python3.10/site-packages$

 

 

gavid
Level 1
Level 1

This works now with the PIP package update to 3.0.2, with version 3.0.1 when installing the plugin "yangsuite-coverage" as per the github instructions it removed the yangsuite application.