In this simple Continuous Integration (CI), we combine
- Gitlab Community Edition
- Cisco Modeling Lab (CML)
- Containerized NSO
- A simple NSO RESTCONF pytest library
to demonstrate a simple structure of CI chain that can be easily expanded.
In this CI Gitlab Pipeline, several stages are included,
- Compile the NSO packages
- Set up the devices under test in CML with given config
- Use pytest to check the functionality of NSO package in docker containers
- Clean up testing environment
Readers can follow the setup steps to create a complete CI chain in Devnet Sandbox. The containerized NSO makes testing several NSO packages in parallel possible and the CML creates a full controlled environment for testing. Pytest tests are created based on a NSO testing library to test the dryrun of the NSO package.
-
Reserve an instance of the Devnet CML Sandbox, an email with how to set up VPN to the Sandbox will be sent
-
Follow the instruction in the email to set up VPN. After connecting to Devnet sandbox VPN, ssh to Dev Server (password: C1sco12345)
ssh developer@10.10.20.50
-
Clone this project
git clone --recurse-submodules https://github.com/wholechainsawit/devnet-gitlab-nso-cml-ci.git
-
Download trial NSO from Devnet Download and get the unsigned
nso-5.3.linux.x86_64.installer.bin
by executingbash nso-5.3.linux.x86_64.signed.bin
Copy the trial NSO to the Dev Server (password: C1sco12345)
scp nso-5.3.linux.x86_64.installer.bin developer@10.10.20.50:/home/developer/devnet-gitlab-nso-cml-ci/setup/nso-docker/nso-install-files
-
Run setup script
cd /home/developer/devnet-gitlab-nso-cml-ci/setup sh set-env.sh
-
Setup a new project in Gitlab
- Create a new project, nso_cicd, on Gitlab Instructions
- Add this project to the Gitlab
cd /home/developer/devnet-gitlab-nso-cml-ci git remote add gitlab http://10.10.20.50/root/nso_cicd.git git push -u gitlab --all Username for 'http://10.10.20.50': root Password for 'http://root@10.10.20.50': C1sco12345
-
That's it! Enjoy!
Dev Server: developer@10.10.20.50 developer/C1sco12345
CML: https://10.10.20.161 developer/C1sco12345
Special thanks to Damiano, Asad, and Dan from Verizon team for their support to make this project possible