Original source: Outshift by Cisco
This video from Outshift by Cisco covered a lot of ground. 9 segments stood out as worth your time. Everything below links directly to the timestamp in the original video.
Think of the time your team spends wrestling with inconsistent development setups. This approach could streamline your workflow and free up valuable coding time.
Development Environments Should Be Treated as Code Deliverables, Experts Argue
Development teams should treat their development environments with the same rigor as code deliverables, integrating them into code repositories and maintaining them as an integral part of the project lifecycle. This involves keeping documentation updated, such as README files that detail platform versions and setup procedures, to ensure engineers can independently configure and update their environments without constant supervision.
Regular testing of environment setups is also crucial, especially when deploying new instances like virtual machines, to verify consistent functionality across all platforms. By embedding environment maintenance within the development workflow and considering it a critical component of every sprint, teams can enhance efficiency, reduce onboarding time, and ensure stability across their development infrastructure.
"Treat your development environments as if it was a code deliverable, as if it was any other given user story. It deserves the same importance on every single sprint."
Standardization, Documentation, and Minimal Interaction Key to Effective Development Environments
Effective development environments hinge on three core pillars: standardization of versions, reliable and accessible documentation, and minimal user interaction during setup. Standardisation dictates that all frameworks, libraries, and platforms must have specified, fixed versions to ensure consistency across all developer setups. This prevents discrepancies that can lead to bugs and delays.
Furthermore, documentation must be comprehensive, easy to read, and regularly updated, outlining installation, operation, and troubleshooting steps. Reducing the number of steps and user inputs required for setup streamlines the onboarding process and minimises friction for developers, ultimately contributing to a more efficient and less frustrating development experience.
"These are the three main pillars in my opinion for a reliable good development environment."
Visual Studio Code and GitHub Copilot Enforce Coding Standards, Streamlining Development Workflow
Development teams are leveraging integrated development environments (IDEs) like Visual Studio Code and AI assistants such as GitHub Copilot to enforce coding standards automatically. By configuring settings.json in VS Code, teams can mandate linting, type checking, and docstring formats. GitHub Copilot is then provided with specific instructions to adhere to these conventions, including naming schemes and code style requirements, when generating new code.
Before submitting code for peer review, a make check command validates compliance with these established standards. This automated process ensures consistency, reduces manual review effort, and helps developers proactively identify and correct style and structural issues, significantly improving code quality and team efficiency.
"Every time I ask it to create new code, it's going to follow this conventions."
Docker Compose Enhances Flexibility for Development Environments with Containerized Solutions
Containerized solutions, particularly Docker Compose, are transforming development environments by offering enhanced flexibility and the ability to run multiple platforms concurrently. This approach allows developers to easily integrate various tools, such as Ansible for automation and NetBox for inventory management, within a single, coherent environment. Official vendor containers for platforms like NetBox, NSO, and Ansible simplify the setup process, enabling developers to quickly spin up complex environments.
By packaging applications and their dependencies into portable containers, Docker Compose ensures consistency across different developer machines and operating systems. This significantly reduces the overhead of environment setup and troubleshooting, allowing teams to focus more on development and less on configuration management.
"It gives us a lot more flexibility for building our environments."
Python Libraries Automate Coding Standards for Improved Code Quality
Python developers are increasingly using specialised libraries to automate the enforcement of coding standards, ensuring consistency and quality across projects. Tools like Black handle automatic code formatting, while iSort efficiently organises import statements and flags broken libraries. Linting tools are crucial for maintaining code style, addressing aspects such as indentation and whitespace.
Additionally, MyPy performs static type checking to catch errors early, and other libraries can automatically generate docstrings, those essential descriptive texts for functions. By integrating these tools into the development workflow, teams can reduce manual review time, enforce best practices, and produce more maintainable and readable code.
"Here I mentioned some libraries that you can use. These are all Python libraries that will take your code and we'll do checks based on what you specify."
Developer Teams Face Significant Delays from Onboarding and Environment Troubleshooting
Development teams spend an average of 8 to 12 weeks onboarding new members, largely due to the complexities of setting up their development environments. Additionally, existing team members dedicate approximately 15 hours troubleshooting environment configurations. This substantial time investment significantly reduces the hours available for actual coding, with developers often left with only four to five hours per sprint for working on user stories.
The core issues stem from a lack of replicability, where environments fail to run seamlessly across different host types—be it virtual machines, cloud instances, or local computers—and a lack of reproducibility, where identical setup instructions do not yield identical environments. Addressing these inconsistencies is crucial for improving developer productivity and accelerating project timelines.
"We spend on average from 8 to 12 weeks on boarding people on boarding their environment so they can get started with the code."
Makefile Simplifies Network Automation Environment Deployment for NSO
A Makefile, combined with small, specific bash scripts, is significantly simplifying the deployment of complex network automation development environments. This approach allows users to initiate a fully configured Cisco NSO container, complete with virtual network devices and necessary plugins, by merely executing a 'make' command in the console. The Makefile orchestrates various individual scripts, each performing a precise task, which enhances control and simplifies troubleshooting by isolating potential issues.
This method streamlines the setup process, enabling dynamic rendering of Docker Compose templates using configuration files, ensuring flexibility and reproducibility. By abstracting the complexities of environment configuration into a simple command, developers can rapidly provision their workstations, dedicating more time to coding and less to setup.
"The way I deploy this with all these different make files, sorry, all these different targets, it's as simple as going to my console and saying make."
Network Device Simulation Varies by Use Case: Data Plane vs. Control Plane
Simulating network devices for testing network automation code requires different tools and approaches depending on whether the focus is on the data plane or the control plane. For data plane simulations, which involve testing configurations related to traffic forwarding, access control lists, or quality of service, simpler, stateless tools like NetSims are sufficient. These tools primarily help visualise how configurations will be pushed to devices.
However, more robust solutions such as ContainerLab or Cisco CML are necessary for control plane simulations. These advanced tools enable testing of complex scenarios like establishing routing protocols or checking interface statuses, providing a deeper and more interactive simulation of network behaviour. Choosing the right simulation tool is crucial for accurately validating network automation code against specific operational requirements.
"Depending on what you want to simulate in your use cases, you're going to be looking for two different kinds of solutions."
Network Automation Code Demands Strict Adherence to Coding Standards
Network automation code, much like other software, benefits significantly from adherence to rigorous coding standards. Key practices include using type hinting to clearly define expected input and output data types for functions, improving code clarity and maintainability. Comprehensive docstrings are essential, providing brief descriptions of function purpose, arguments, return values, and potential exceptions, which is crucial for collaborative development.
Consistent naming conventions, such as snake_case for functions and PascalCase for classes, further enhance readability and reduce cognitive load for developers. By implementing these standards, teams ensure that network automation code is not only functional but also understandable, debuggable, and scalable, ultimately fostering better collaboration and reducing errors.
"Even though we're developing network automation code, it shouldn't scape standards."
Also mentioned in this video
- The presenter defines "yak shaving" as spending time on unrelated tasks before… (0:55)
- Poor development environments lead to lost coding time, inconsistent coding… (4:57)
- Key files for defining development environments include requirements.txt for… (8:48)
- Artifacts, which are binary files like plugins, should be stored in an artifact… (14:02)
- The NSO development environment consists of three main components (17:48)
- The custom NSO Docker image is built from a base NSO image with added libraries… (19:05)
- The presenter demonstrates a NSO container development environment, publicly… (19:39)
- The presenter demonstrates how to create a new NSO service within the deployed… (23:36)
Summarised from Outshift by Cisco · 33:09. All credit belongs to the original creators. Streamed.News summarises publicly available video content.