Cisco DevNet - Lab 1: Installing Workstation as Development Environment
Installing Workstation as Development Environment
Installing a workstation as a development environment in the context of DevNet, Cisco's developer program, involves configuring the system to support network automation and programmability. This includes setting up tools and software tailored for Cisco platforms and APIs. DevNet workstations commonly include an integrated development environment (IDE) such as Visual Studio Code or PyCharm, along with the necessary software development kits (SDKs) and libraries for Cisco platforms like Cisco IOS, NX-OS, or ACI. DevNet developers often utilize Python or JavaScript for scripting and programming, leveraging libraries like the Cisco SDK or RESTCONF/NETCONF protocols for network automation. The installation process may also include tools for version control, such as Git, and collaboration platforms like Cisco Webex Teams. Setting up a DevNet workstation ensures developers have the specialized tools required to create, test, and deploy network automation solutions on Cisco infrastructure.
Lab:
Set up development environment: Linux
Disclaimer
This Lab Guide is designed to assist candidates to facilitate Technology learning. While every effort has been made to ensure that all material is as complete and accurate as possible, the enclosed material is presented on an “as is” basis. Neither the authors nor RSTForum assume any liability or responsibility to any person or entity with respect to loss or damages incurred from the information contained in this Lab guide. This workbook was developed by RSTForum. Any similarities between material presented in this Lab Guide and any other Lab Guide or any other material is completely coincidental.
Installation
In this lab you’ll find walkthroughs on how to install a set of common development tools on an Ubuntu Desktop 18.0.4 workstation or latest.
Objectives
- Install a basic development toolset on your local workstation
- Verify the tools are all working as expected
Step 1: Ubuntu specific preparation
To use Linux as your development environment, you should have a good graphical desktop interface setup.
- The standard/default Ubuntu desktop environment for Ubuntu 18.04 LTS is Gnome Shell, but…this is Linux – you have choices!
- Now your workstation should startup and provide a GUI login to a desktop environment
- Install some basic Linux tools and utilities
sudo apt install curl
sudo apt install libssl-dev
# (equivalent to openssl-dev on other distributions)
(wget is already installed, so we do not need to install it)
- Install the typical developer tools and utilities (For example the GCC C/C++ compiler):
sudo apt install build-essential
Step 2: Source control systems
Git
Installation:
- Git needs to be installed as a separate package, but is easily done:
sudo apt install git
Verification
Let us verify Git is working as expected:
- Open a terminal
- From within the terminal, run:
git --version
You should get output indicating the version of git installed:
# Example output
git version 2.17.1
- Attempt to clone a repository from GitHub:
git clone https://github.com/RSTForum/knowledgebase.git
# Expected Output
Cloning into
remote: Counting objects: 11, done.
remote: Total 11 (delta 0), reused 0 (delta 0), pack-reused 11
Unpacking objects: 100% (11/11), done.
Step 3: Python and Node.js
Python 3 is the recommended version of Python.
Note: Python 2 is no longer supported. As of January 1st, 2020 no new bug reports, fixes, or changes will be made to Python 2. You can read Python 2 instructions in the appendix to this Lab, but it is not required or recommended.
Installing Python
You may already have Python 3 installed. Verify your Python installation by running this command at the terminal prompt:
python3
#Expected output
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
\[GCC 8.3.0\] on linux
Type "help", "copyright", "credits" or "license" for more information
>>>
- If Python3 is not installed, you can install it:
sudo apt install python3
- Verify Python3 was correctly installed:
cd ~
python3 -V
# Expected Output
Python 3.6.9
Python virtual environments
Before leaving the Python setup, you need to know how to create a Python virtual environment. Python virtual environments are a method of creating isolated “environments” where specific versions of Python can be installed along with independent sets of libraries and dependencies.
Virtual environment usage is very common and is recommended practice when working in Python, and most DevNet labs encourage you to create and work within virtual environments.
- First download and install the Python 3 virtual environment package.
sudo apt install python3-virtualenv
- Create a Python 3 virtual environment using the virtualenv module.
python3 -m venv py3-venv
- Now “activate” the environment. Look for the name of the virtual environment to be enclosed in parenthesis after activation.
source py3-venv/bin/activate
# Expected Output
(py3-venv) \[timmc@ubuntu ~\]$
- Now verify that python is now linked to Python 3.
python -V
Python 3.6.9
- Deactivate the virtual environment.
deactivate
Step 4: Nodejs
There are two different Node.js options when installing. It’s possible to use the distro-stable package with APT, or to branch out and use version-specific versions of Node.js using NVM, the Node Version Manager.
For our lab purposes, the distro-stable
version will probably be fine since it is 8.x. (Note: This will install an older version of NodeJS. To install the latest version, use the NVM steps below and not these)
- Install nodejs
sudo apt install nodejs
- Install NPM (Node Package Manager)
sudo apt install npm
- Check the version installed.
nodejs -v
#Expected output
v8.10.0
Install Using NVM (Will install the latest version of NodeJS)
- Install NVM
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
- Reload system environment using this command. It will set the required environment variables to use nvm on the system.
source ~/.profile
source ~/.bashrc
- Find Available NodeJS Version
nvm ls-remote
- Install and use NodeJS
nvm install v12.18.0
- Check the version installed.
nvm use v12.18.0
- Check the version installed.
node -v
Step 5: Text editors and IDE
Atom Installation
- Because Atom only offers install via Debian package in Ubuntu (.deb) we can’t use apt to do the install. Luckily, we can use snap installer instead. This should already be installed, but if not we can install it:
sudo apt install snapd
- Using snap, installing Atom is, well, a snap:
sudo snap install atom --classic
Verification
- Once the program is finished installing, we can launch it by typing atom from the terminal, or find it under Applications
Visual Studio Code
Installation
- VS code can also been installed from the Snap store:
sudo snap install atom --classic
- Open VS Code to display the main interface
- In the upper left, select the Extensions view, search for “python” and install the top hit, i.e. the “Python” extension (by Microsoft)
All done!
Step 6: Development tools and clients
Postman
Installation
- Postman has a complicated install on some distributions, but we can leverage the snap installer that we used for Atom to install Postman as well.
sudo snap install postman
- Now you can activate Postman either from the terminal window by using the postman command, or find it under Applications.
Verification
-
Once the installation completes, find Postman in the application launcher.
-
Postman will open and allow you to sign-up or sign-in. You do NOT need to sign in to use Postman, you can simply click the “Take me straight to the app. I’ll create an account another time.” link to bypass login.
- Test that you can make REST API calls with Postman with this fun “Dad Joke” API. Enter https://icanhazdadjoke.com/ into the address bar. Click the “Headers” tab and add an entry for Accept with a value of application/json. Then click “Send” and enjoy your joke 🙂
ngrok
Installation
- ngrok is another app we can get from the handy Snap store:
snap install ngrok
Google Chrome
Installation
-
Download the .deb Google Chrome installer from google.com/chrome
-
Install it using dkpg:
cd $HOME/Downloads
sudo dpkg -i google-chrome-stable\_current\_amd64.deb
- Start Google Chrome from the terminal with the google-chrome-stable command or from Applications
Verification
To access the Chrome Developer tools:
- Open Google Chrome, and click the menu icon (“three dots”) to the right of the address bar
-
Under More tools, click the link for Developer tools
-
You will now see the developer tools open within the window:
OpenConnect
Installation
- Install the OpenConnect client: