08-15-2020 06:09 PM
Solved! Go to Solution.
08-15-2020 08:08 PM
08-16-2020 09:53 AM
Hi Jacky
The YDK does not have GUI and therefore can be used in terminal only environment. Desktop is not needed, but for the developer it is always a plus, because it gives you ability to use some powerful IDE (Eclipse or Pycharm) for your application development and debugging.
Regarding Linux environment in Centos-7 and RHEL-7.
It all depends, how the Python was installed. If Python was installed using 'yum install python3-devel', the executables and libraries will be installed in the system paths and therefore no additional environment settings are needed. If Python was installed from source, then you need to configure PATH to include Python interpreter path, and LD_LIBRARY_PATH and CMAKE_LIBRARY_PATH to include path of dynamically loaded Python library. This is described in documentation here. For gNMI service it is also required to include grpc and protoc library paths to LD_LIBRARY_PATH. This is described in documentation here.
In addition it is strongly recommended for your project to use Python Virtual Environment, which separates working environment from system Python installation.
08-15-2020 08:08 PM
08-17-2020 11:53 PM
Hello Francesco,
How are you! I hope and believe everything is good for you.
Thank you very much for your reply.
I do follow this guide to install YDK but I faced some issue. May I know if you install ydk in your real linux system or install ydk in the python virtual environment ?
https://github.com/CiscoDevNet/ydk-py
2 Could you please give me a brief introduction about your DevNet develop environment ?
Which Linux version , server or desktop. which Python IDE ??
Thanks
BR
Jacky Zhang
08-16-2020 09:53 AM
Hi Jacky
The YDK does not have GUI and therefore can be used in terminal only environment. Desktop is not needed, but for the developer it is always a plus, because it gives you ability to use some powerful IDE (Eclipse or Pycharm) for your application development and debugging.
Regarding Linux environment in Centos-7 and RHEL-7.
It all depends, how the Python was installed. If Python was installed using 'yum install python3-devel', the executables and libraries will be installed in the system paths and therefore no additional environment settings are needed. If Python was installed from source, then you need to configure PATH to include Python interpreter path, and LD_LIBRARY_PATH and CMAKE_LIBRARY_PATH to include path of dynamically loaded Python library. This is described in documentation here. For gNMI service it is also required to include grpc and protoc library paths to LD_LIBRARY_PATH. This is described in documentation here.
In addition it is strongly recommended for your project to use Python Virtual Environment, which separates working environment from system Python installation.
08-17-2020 11:47 PM
Hello Yangorelik
Thank you so much for your reply.
As I am newer I am sorry if my questions are simple or silly. Please let me know if you I got your points.
1 although CiscoDevNet/ydk-gen guide mentioned ydk installation at the beginning and mentioned python virtual environment at the bottom. Actually, I could run/activate python virtual environment first then follow guide to complete the ydk installation. Am I correct ?
2 May I know which ways do you prefer in your real develop environment.
1 Linux + VIm + test.py to do programs without Python IDE
2 Linux + Python IDE to do programs
3 Can you give me brief introduction about your DevNet develop environment ?
Thank you again and have a nice day
BR
Jacky Zhang
08-18-2020 02:37 PM
Hi Jacky
Here are my answers:
1. You can definitely activate Python virtual environment and then install YDK.
2. I prefer #2 - Linux + IDE. My choice of Python IDE is PyCharm (community edition is free). I also use Eclipse for C++ development.
3. I did development in all YDK supported platforms. All worked fine as long as you have sudo access to the file system. My preferred platform is Ubuntu 18.04. The Mac OSX, CentOS and RHEL are more knowledge demanding platforms, for configuration you need to do a bit more than in Ubuntu. In most cases I used default for the platform software (C/C++ compiler, Python3 etc.). But I also had experience with systems that required manual installation of C/C++ compiler, third party packages, and Python3 installation from source. Most of these approaches and solutions are documented in Readme files on the GitHub.
08-20-2020 05:22 AM
Hi Yan,
Thank you very much for your reply and sharing.
I think you have very senior program development background.
These days, I used Yang Explorer(NetConf) to generate Python Script. I feel Yang Explorer is very useful tool.
Since I haven't dig into YDK too much. I am not aware if YDK may be more powerful than Yang Explorer.
Below is my feel I just would like to exchange my thoughts and feeling with you. Maybe I am wrong and welcome your input.
DevNet is not complicated in terms of logic. In general speaking , Manipulate network devices by program instead of traditional CLI
Now there is one painful point for me that I am not expert for Yang-Model and XML. So it is difficult for me to create correct “ XML Data + Yang Model.”
Yang Explorer is capable to translate data to Python or YDK program with “XML Data + Yang Model”. I just only copy/paste to VS code with minor adjustment
I am glad to meet you in DevNet Develop community.
Thank you and have a nice day.
08-18-2020 06:24 PM - edited 08-18-2020 06:26 PM
1. Yes you can definitely use python environment. I personally don't use python environment.
2. My daily machine is a System76 laptop based on PoP OS. I use vim and Visual Studio Code (and less often Atom). However I use Pycharm community also when working hardly on some projects to get versioning if not using a git :-)
To do some development testing, I use dockers or multipass (Canonical) to fork ubuntu machine (more easy and faster than deploying a VM on VMware workstation or virtual box)
3. Devnet is the Cisco BU for all development stuff for all Cisco related products. They share some codes on devnet website and Github. For those who start scripting, they also put at your disposal some labs to get trained on python development, REST API, ...
08-20-2020 05:14 AM
Thanks a lot Francesco.
08-20-2020 02:51 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide