Everything you need to know about DevOps
DevOps is a set of practices that combines software development (Dev) and IT operations (Ops). It aims to shorten the systems development life cycle and provide continuous delivery with high software quality. DevOps is complementary with Agile software development, several DevOps aspects came from the Agile methodology.
Agile
The motivations for what has become modern DevOps and several standard DevOps practices such as automated build and test, continuous integration, and continuous delivery originated in the Agile world. Agile development teams using methods such as Extreme Programming couldn't "satisfy the customer through early and continuous delivery of valuable software” unless they subsumed the operations/infrastructure responsibilities associated with their applications, many of which they automated. Because Scrum emerged as the dominant Agile framework in the early 2000s and it omitted the engineering practices that were part of many Agile teams, the movement to automate operations/infrastructure functions splintered from Agile and expanded into what has become modern DevOps. Today, DevOps focuses on the deployment of developed software, whether it is developed via Agile or other methodologies.
How DevOps Works
Under a DevOps model, development and operations teams are no longer “siloed.” Sometimes, these two teams are merged into a single team where the engineers work across the entire application lifecycle, from development and test to deployment to operations, and develop a range of skills not limited to a single function.
In some DevOps models, quality assurance and security teams may also become more tightly integrated with development and operations and throughout the application lifecycle. When security is the focus of everyone on a DevOps team, this is sometimes referred to as DevSecOps.
These teams use practices to automate processes that historically have been manual and slow. They use a technology stack and tooling which help them operate and evolve applications quickly and reliably. These tools also help engineers independently accomplish tasks (for example, deploying code or provisioning infrastructure) that normally would have required help from other teams, and this further increases a team’s velocity.
Decoding the DevOps Lifecycle
DevOps is primarily implemented in application development for e-commerce websites, cloud-native applications, and other large distributed platforms. It consists of multiple phases that collectively become the DevOps lifecycle.
◉ Continuous Development
◉ Continuous Integration
◉ Continuous Testing
◉ Continuous Feedback
◉ Continuous Monitoring
◉ Continuous Deployment
◉ Continuous Operations
These seven phases are the main constituents that ensure DevOps optimizes all development processes, right from proposal to production and the complete delivery. Here is a phase-wise, complete break-down & analysis of the DevOps lifecycle.
1) Continuous Development
The first phase of the DevOps lifecycle is where the planning and software coding takes place. The planning involves understanding the vision of the project and envisioning a software based on those perceptions.
Planning doesn’t involve any major tools, but maintaining the code entails the use of a range of tools. Developing the source code for the application begins by choosing from the different programming languages. JavaScript, C/C++, Ruby, and Python are prominently used for coding applications in DevOps.
The process of maintaining the code is called Source Code Management (SCM), where version control tools such as GIT, TFS, GitLab, Subversion, and Mercurial, among others, are used.
In the SCM process, GIT is a preferred tool that enables a distributed version control. It facilitates data assurance through circulated non-linear workflows. For large projects, where a vast number of collaborators are involved in the development activity, GIT establishes reliable communication between the teams through the Commit messages.
With the help of a version control tool, a stable version of the application code is built in the continuous development phase. Developers can also package the code into .exe (executable) files by using Garden, Maven, and similar tools.
2) Continuous Integration
The source code gets modified several times, and these frequent changes happen on a weekly or a daily basis. Code integration, the next phase, is the core of the entire DevOps lifecycle. In continuous integration, new codes that support add-on functionalities are built and integrated into the existing code.
In this phase, bugs in the source code are detected early on. To generate new code that brings more functionalities to the application, developers run tools for unit testing, code review, integration testing, compilation, and packaging.
The continuous integration of this new code into the existing source code helps reflect the changes that end-users would experience with the updated code.
Jenkins is popularly used as a reliable DevOps tool for procuring the updated source code and constructing the build into.exe format. These transitions occur seamlessly, and the updated code is packaged and proceeded to the next phase, which is either the production server or the testing server.
3) Continuous Testing
Some developers carry out the continuous testing phase before the continuous integration phase. Based on the updations in the application code, this phase can be repositioned around the continuous integration phase in the DevOps lifecycle.
Here, the developed software is continuously tested for bugs. A test environment is simulated with the use of Docker containers. Through automated testing, developers save effort and time, usually lost in manual testing. Reports generated by automated testing improve the test evaluation process. Analyzing the failed test-cases becomes easy. After going through a UAT (User Acceptance Testing) process, the resultant test-suite is simpler and bug-free. TestNG, Selenium and JUnit are some of the DevOps tools used for automated testing. These tools can also arrange test-case execution in a pre-set timeline.
Quality assessors (QAs) can use these tools for parallel testing of several other code-bases.
It ensures the flawless functionality and inter-networking of the application. In the end, the tested code is re-sent to the continuous integration phase for updating the source code.
4) Continuous Feedback
Continuous testing and continuous integration are the two crucial phases that ensure consistent improvements in the application code. Continuous feedback is a peculiar phase where these improvements are analyzed.
Developers can gauge the outcome of these modifications on the final product. Most importantly, customers who tested these applications can share their experiences in this phase. In a majority of cases, this phase of the DevOps lifecycle provides a turning point to the application development process. The feedback is assessed promptly and developers begin working on the new changes. Sooner, there is a positive response in customer feedback, which paves the way for releasing new versions of the software application.
5) Continuous Monitoring
Monitoring the performance of an application is of key importance for application developers. In this phase, developers record data on the use of the application and continuously monitor each functionality. “Server not reachable” or “low memory” are some of the common system errors resolved in this phase.
Continuous monitoring helps in sustaining the availability of services in the application. It also determines the threats and root causes of recurring system errors. Security issues get resolved and problems are automatically detected and fixed.
Compared to the software development teams, the IT operations teams are more involved in this phase. Their role is pivotal in supervising user activity, checking the system for unusual behavior, and tracing the presence of bugs.
Sensu, ELK Stack, NewRelic, Splunk, and Nagios are the key DevOps tools used in continuous monitoring. These tools enable complete control in overseeing the performance of the system, the production server, and the application. The operations team can actively engage in increasing the reliability and productivity of the applications with the help of these tools.
When major issues are detected in this phase, the application is swiftly rerun through all the earlier phases of the DevOps lifecycle. That is how finding a resolution to all sorts of issues becomes faster in this phase.
6) Continuous Deployment
Conventionally, the phase of continuous deployment takes place before continuous monitoring. But, developers make sure that this phase is always active in the DevOps lifecycle, especially after the application goes live and starts receiving high traffic.
In this phase, the finalized application code is deployed to the production servers. Configuration Management is a key process in this phase, and it carries out the precise deployment of application code on all servers. Consistency in the application’s performance and functional conditions is established and curated. Code is released to the servers, updates are scheduled for all servers, and these configurations are kept consistent throughout the production process. Ansible, Puppet, and Chef are some of the effective DevOps tools used for Configuration Management, where they frequently execute the quick and continuous deployment of new code.
Containerization tools are used to achieve continuous deployment through the Configuration Management process. Vagrant, a containerization tool, develops coherence in different environments - from development and testing to staging and production. Similarly, the scalability of continuous deployment is handled by tools like Docker. These tools nullify all sorts of production failures and system errors by replicating and packaging the software couplings from testing, staging, and development phases. Ultimately, the application runs smoothly on different computers.
7) Continuous Operations
The last phase of the DevOps lifecycle is the shortest phase and the least complicated one. The purpose of continuous operation is to automate the process of releasing the application and the subsequent updates. Development cycles in continuous operations are shorter, allowing developers to ongoingly accelerate the time-to-market for the application.
DevOps toolchain
Followers of DevOps practices often use certain DevOps-friendly tools as part of their DevOps “toolchain.” The goal of these tools is to further streamline, shorten, and automate the various stages of the software delivery workflow (or “pipeline”). Many such tools also promote core DevOps tenets of automation, collaboration, and integration between development and operations teams. The following shows a sample of tools used at various DevOps lifecycle stages.
Plan. This phase helps define business value and requirements. Sample tools include Jira or Git to help track known issues and perform project management.
Code. This phase involves software design and the creation of software code. Sample tools include GitHub, GitLab, Bitbucket, or Stash.
Build. In this phase, you manage software builds and versions and use automated tools to help compile and package code for future release to production. You use source code repositories or package repositories that also “package” infrastructure needed for product release. Sample tools include Docker, Ansible, Puppet, Chef, Gradle, Maven, or JFrog Artifactory.
Test. This phase involves continuous testing (manual or automated) to ensure optimal code quality. Sample tools include JUnit, Codeception, Selenium, Vagrant, TestNG, or BlazeMeter.
Deploy. This phase can include tools that help manage, coordinate, schedule, and automate product releases into production. Sample tools include Puppet, Chef, Ansible, Jenkins, Kubernetes, OpenShift, OpenStack, Docker, or Jira.
Operate. This phase manages software during production. Sample tools include Ansible, Puppet, PowerShell, Chef, Salt, or Otter.
Monitor. This phase involves identifying and collecting information about issues from a specific software release in production. Sample tools include New Relic, Datadog, Grafana, Wireshark, Splunk, Nagios, or Slack.
Benefits of DevOps
Speed
Move at a high velocity so you can innovate for customers faster, adapt to changing markets better, and grow more efficient at driving business results. The DevOps model enables your developers and operations teams to achieve these results. For example, microservices and continuous delivery let teams take ownership of services and then release updates to them quicker.
Rapid Delivery
Increase the frequency and pace of releases so you can innovate and improve your product faster. The quicker you can release new features and fix bugs, the faster you can respond to your customers’ needs and build a competitive advantage. Continuous integration and continuous delivery are practices that automate the software release process, from build to deploy.
Reliability
Ensure the quality of application updates and infrastructure changes so you can reliably deliver at a more rapid pace while maintaining a positive experience for end-users. Use practices like continuous integration and continuous delivery to test that each change is functional and safe. Monitoring and logging practices help you stay informed of performance in real-time.
Scale
Operate and manage your infrastructure and development processes at scale. Automation and consistency help you manage complex or changing systems efficiently and with reduced risk. For example, infrastructure as code helps you manage your development, testing, and production environments in a repeatable and more efficient manner.
Improved Collaboration
Build more effective teams under a DevOps cultural model, which emphasizes values such as ownership and accountability. Developers and operations teams collaborate closely, share many responsibilities, and combine their workflows. This reduces inefficiencies and saves time (e.g. reduced handover periods between developers and operations, writing code that takes into account the environment in which it is run).
Security
Move quickly while retaining control and preserving compliance. You can adopt a DevOps model without sacrificing security by using automated compliance policies, fine-grained controls, and configuration management techniques. For example, using infrastructure as code and policy as code, you can define and then track compliance at scale.
DevOps Principles & Best Practices
Here are DevOps principles and best practices that you need to follow.
1. Version Control For All Production Artifacts
Both Dev and Ops should use version control for everything. And they should share the same single source of truth.
2. Continuous Integration and Deployment
Check-in code every day and check into the trunk every day, as opposed to hanging onto private code branches and integrating only at the end of the release.
3. Automated Acceptance Testing
Stop the line not only when the build breaks but also when something breaks. This is true for all software testing, whether it's an automated user test, an integration test, or a system test. This step keeps things in an always-deployable state.
4. Peer Review of Production Changes
Use peer reviews for better quality; leverage your team’s familiarity, shared goals, and mutual accountability, as opposed to external change approval (such as a change advisory board).
5. High-Trust Culture
This is both a practice and an outcome result from a single source of truth, peer reviews, and shared goals.
6. Proactive Monitoring of the Production Environment
Monitor and communicate across the teams so everyone can see, understand, and affect end results and customer utilization.
7. Win-Win Relationship (and Outcomes) Between Dev and Ops
This approach counters the learned behavior that deployments hurt. By deploying code into production every day, you can change lives in Operations. Deployments don’t have to be done at midnight on Friday with Ops working all weekend to get things running. When Ops employees are working the same hours as Dev, there is a sense of teamwork and joint accomplishment.
Source: novelvista.com