0% found this document useful (0 votes)
3 views

DevOps - Unit - 1

This document provides an introduction to DevOps, covering its definition, features, architecture, lifecycle, and tools. It emphasizes the importance of collaboration between development and operations teams, automation, and continuous processes in software development. Additionally, it outlines the Software Development Life Cycle (SDLC) and Agile methodologies as foundational concepts for implementing DevOps practices.

Uploaded by

sitharavashisht
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

DevOps - Unit - 1

This document provides an introduction to DevOps, covering its definition, features, architecture, lifecycle, and tools. It emphasizes the importance of collaboration between development and operations teams, automation, and continuous processes in software development. Additionally, it outlines the Software Development Life Cycle (SDLC) and Agile methodologies as foundational concepts for implementing DevOps practices.

Uploaded by

sitharavashisht
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

DevOps Unit -1 : Introduction to Devops

• Introduction to SDLC
• Agile Model
• Introduction to Devops
• DevOps Features
• DevOps Architecture
• DevOps Lifecycle
• Understanding Workflow and principles
• Introduction to DevOps tools
• Build Automation
• Delivery Automation
• Understanding Code Quality
• Automation of CI/CD
DevOps Definition
• DevOps is the combination of cultural philosophies,
practices, and tools that increases an organization’s ability
to deliver applications and services at high velocity.

• Evolving and improving products at a faster pace than


organizations using traditional software development and
infrastructure management processes.

• This speed enables organizations to better serve their


customers and compete more effectively in the market.
Introduction to SDLC(Software Development Life
Cycle)
• SDLC stands for Software Development Life
Cycle.

• It is a process that gives a complete idea about


developing, designing, and maintaining a software
project by ensuring that all the functionalities
along with user requirements, objectives, and end
goals are addressed.

• With SDLC, the software project’s quality and the


overall software development process get
enhanced.
Stages of SDLC
Stage 1: Requirement Gathering & Analysis Phase
Stage 2: Design Phase
• In the design phase of an SDLC, the architectural
design is proposed for the project based on the
SRS Document requirements.
• The Designing Phase of SDLC involves the
following
• Separation of hardware and software system
requirements
• Designing the system architecture based on
gathered requirements
• Creating Unified Modelling Language (UML)
diagrams like- use cases, class diagrams, sequence
diagrams, and activity diagrams
Stage 3: Development Phase
• In the entire SDLC, the development phase is
considered to be the longest one. In this phase,
the actual project is developed and built.
• The Development Phase of SDLC involves the
following
• Actual code is written
• Demonstration of accomplished work
presented before a Business Analyst for
further modification of work
• Unit testing is performed, i.e., verifying the
code based on requirements
Stage 4: Testing Phase

• Almost all stages of SDLC involves the testing


strategy.
• However, SDLC’s testing phase refers to checking,
reporting, and fixing the system for any
bug/defect.
• In this phase, the on-going system or project is
migrated to a test environment where different
testing forms are performed.
• The Testing Phase involves the following-
• Testing the system as a whole
• Performing different types of test in the system
• Reporting and fixing all forms of bugs & defects
Stage 5: Deployment & Maintenance Phase
• In this SDLC phase, once the system testing has been
done, it is ready to be launched. The system may be
initially released for limited users by testing it in a
real business environment for UAT or User
Acceptance Testing.
The Deployment & Maintenance Phase involves the
following-
• The system is ready for delivery
• The system is installed and used
• Errors are rectified that might have been previously
missed
• Enhancing the system inside a data center
Agile Method
• In software development, agile (sometimes
written Agile) practices include requirements
discovery and solutions improvement through the
collaborative effort of self-organizing and cross-
functional teams with their customer(s)/end
user(s), adaptive planning, evolutionary
development, early delivery, continual
improvement, and flexible responses to changes in
requirements, capacity, and understanding of the
problems to be solved.
• Agile SDLC model is a combination of
iterative and incremental process models with
focus on process adaptability and customer
satisfaction by rapid delivery of working
software product.
• Agile Methods break the product into small
incremental builds. These builds are provided
in iterations.
• Each iteration typically lasts from about one
to three weeks.
Every iteration involves cross functional teams
working simultaneously on various areas like

• Planning
• Requirements Analysis
• Design
• Coding
• Unit Testing and
• Acceptance Testing.
At the end of the iteration, a working product is
displayed to the customer and important
stakeholders.
What is Agile?
• Agile model believes that every project needs to
be handled differently and the existing methods
need to be tailored to best suit the project
requirements.
• In Agile, the tasks are divided to time boxes (small
time frames) to deliver specific features for a
release.
• Iterative approach is taken and working software
build is delivered after each iteration.
• Each build is incremental in terms of features; the
final build holds all the features required by the
customer.
The graphical illustration of the Agile Model
Following are the Agile Manifesto principles −
Agile Model – Pros
• The advantages of the Agile Model are as follows −
• Is a very realistic approach to software development.
• Promotes teamwork and cross training.
• Functionality can be developed rapidly and
demonstrated.
• Suitable for fixed or changing requirements
• Delivers early partial working solutions.
• Minimal rules, documentation easily employed.
• Enables concurrent development and delivery within
an overall planned context.
• Little or no planning required.
• Easy to manage.
• Gives flexibility to developers.
The disadvantages of the Agile Model are as
follows −

• Not suitable for handling complex dependencies.


• More risk of sustainability, maintainability and
extensibility.
• Depends heavily on customer interaction, so if
customer is not clear, team can be driven in the
wrong direction.
• There is a very high individual dependency, since
there is minimum documentation generated.
• Transfer of technology to new team members may
be quite challenging due to lack of documentation.
Introduction to Devops
• DevOps is the acronym given to the
combination of Development and Operations.
• It refers to a collaborative approach to make
the Application Development team and the IT
Operations team of an organization to
seamlessly work with better communication.
• It is a philosophy that encourages adopting
iterative software development, automation,
and programmable infrastructure deployment
and maintenance.
• DevOps emphasizes building trust and better
liasioning between developers and system
administrators.
• This helps the organization in aligning
technological projects to business
requirements.
• DevOps is visualized as an infinite loop
comprising the steps: plan, code, build, test,
release, deploy, operate, monitor, then back to
plan, and so on.
DevOps Features
1) Automation
• Automation helps to reduce time during the testing
and deployment phase. With automation,
productivity increases, and releases are made
faster. This helps in catching bugs quickly so that
they can be fixed easily.

2) Collaboration
• DevOps is a collaboration of the Development and
Operations team. It improves the working model
of the teams and they become more productive
with their productivity, which strengthens
accountability and ownership.
3) Integration
• Software Applications need to be integrated with
other components in the environment. The
integration phase is where the existing code is
combined/merged with new features/functionality
and then tested. Continuous integration and testing
enable continuous development.

4) Configuration management
• Configuration management helps in building
robust and stable systems for the engineering
teams using tools that can automatically manage
and monitor updates to the configuration data.
DevOps Architecture
• Development and operations both play essential roles in
order to deliver applications.
• The deployment comprises analyzing the requirements,
designing, developing, and testing of the software
components or frameworks.

• The operation consists of the administrative processes,


services, and support for the software.

• When both the development and operations are combined


with collaborating, then the DevOps architecture is the
solution to fix the gap between deployment and operation
terms; therefore, delivery can be faster.
• DevOps architecture is used for the applications hosted on
the cloud platform and large distributed applications.
• Agile Development is used in the DevOps architecture so
that integration and delivery can be contiguous.
• When the development and operations team works
separately from each other, then it is time-consuming
to design, test, and deploy.
• And if the terms are not in sync with each other, then it
may cause a delay in the delivery.
• So DevOps enables the teams to change their short comings
and increases productivity.
Various components that are used in the DevOps architecture
1) Build
• Without DevOps, the cost of the consumption of the
resources was evaluated based on the pre-defined individual
usage with fixed hardware allocation.
• And with DevOps, the usage of cloud, sharing of resources
comes into the picture, and the build is dependent upon the
user's need, which is a mechanism to control the usage of
resources or capacity.

2) Code
• Many good practices such as Git enables the code to be
used, which ensures writing the code for business, helps to
track changes, getting notified about the reason behind the
difference in the actual and the expected output, and if
necessary reverting to the original code developed.
3) Test
• The application will be ready for production after
testing. In the case of manual testing, it consumes
more time in testing and moving the code to the
output.
• The testing can be automated, which decreases the
time for testing so that the time to deploy the code to
production can be reduced as automating the running
of the scripts will remove many manual steps.
4) Plan
• DevOps use Agile methodology to plan the
development. With the operations and development
team in sync, it helps in organizing the work to plan
accordingly to increase productivity.
5) Monitor
• Continuous monitoring is used to identify any risk of
failure. Also, it helps in tracking the system accurately
so that the health of the application can be checked.
The monitoring becomes more comfortable with
services where the log data may get monitored
through many third-party tools such as Splunk.

6) Deploy
• Many systems can support the scheduler for
automated deployment.
• The cloud management platform enables users to
capture accurate insights and view the optimization
scenario, analytics on trends by the deployment of
dashboards.
7) Operate
• DevOps changes the way traditional approach of developing
and testing separately. The teams operate in a collaborative
way where both the teams actively participate throughout
the service lifecycle.
• The operation team interacts with developers, and they
come up with a monitoring plan which serves the IT and
business requirements.

8) Release
• Deployment to an environment can be done by automation.
But when the deployment is made to the production
environment, it is done by manual triggering.
• Many processes involved in release management commonly
used to do the deployment in the production environment
manually to lessen the impact on the customers.
DevOps Lifecycle
• DevOps defines an agile relationship between
operations and Development.
• It is a process that is practiced by the
development team and operational engineers
together from beginning to the final stage of
the product.
• 1) Continuous Development
• This phase involves the planning and coding
of the software. The vision of the project is
decided during the planning phase. And the
developers begin developing the code for the
application. There are no DevOps tools that
are required for planning, but there are several
tools for maintaining the code.
• Examples : GitHub,Git,GitLab,Apache
Subversion (SVN)
• 2) Continuous Integration
• This stage is the heart of the entire DevOps
lifecycle.
• It is a software development practice in which the
developers require to commit changes to the
source code more frequently.
• This may be on a daily or weekly basis.
• Then every commit is built, and this allows early
detection of problems if they are present.
• Building code is not only involved compilation,
but it also includes unit testing, integration testing,
code review, and packaging.
• The code supporting new functionality is
continuously integrated with the existing code.
• Therefore, there is continuous development of
software.
• The updated code needs to be integrated
continuously and smoothly with the systems to
reflect changes to the end-users.
3) Continuous Testing
• This phase, where the developed software is continuously testing
for bugs.
• For constant testing, automation testing tools such as TestNG,
JUnit, Selenium, etc are used.
• These tools allow QAs to test multiple code-bases thoroughly in
parallel to ensure that there is no flaw in the functionality.
• In this phase, Docker Containers can be used for simulating the
test environment.
4) Continuous Monitoring
• Monitoring is a phase that involves all the operational
factors of the entire DevOps process, where important
information about the use of the software is recorded and
carefully processed to find out trends and identify
problem areas.
• Usually, the monitoring is integrated within the
operational capabilities of the software application.

5) Continuous Feedback
• The application development is consistently improved by
analyzing the results from the operations of the software.
• This is carried out by placing the critical phase of constant
feedback between the operations and the development of
the next version of the current software application.
6) Continuous Deployment
• In this phase, the code is deployed to the production servers. Also, it is
essential to ensure that the code is correctly used on all the servers.

7) Continuous Operations
All DevOps operations are based on the continuity with complete
automation of the release process and allow the organization to
accelerate the overall time to market continuingly.
Understanding DevOps Workflow and principles

• DevOps Workflow
• DevOps workflow provides a visual overview
of the sequence in which input is provided.
Also, it tells about which one action is
performed, and output is generated for an
operations process.
Sequential Job Execution

DevOps Fan in/out in repo


Workflow
Branch Level Filtering

Parallel Job Execution


DevOps Principles
DevOps Tools
Puppet
Ansible
Docker
Nagios
Chef
Jenkins
Git
SALTSTACK
Splunk
Selenium
Build Automation
• Build automation is the process of automating the retrieval
of source code, compiling it into binary code, executing
automated tests, and publishing it into a shared, centralized
repository.
• Build automation is critical to Successful DevOps processes.
• In fact, build automation is a critical first step of any CI/CD
process.
• You must have build automation in place in order for
Continuous Integration (CI) to occur.
• And CI is one of seven DevOps practices you need to be
successful.
• Build automation enables Continuous Integration (CI).
So, the role of CI in the automated build process is that CI
uses build automation to verify check-ins and enable
teams to detect issues early.
• Because of its relationship with CI, build automation also
makes Continuous Testing (CT) and Continuous Delivery
(CD) - possible.
5 Benefits of Build Automation
How to Automate the Build Process
• The build may include any of the following steps:
• Compiling source code (in compiler-based languages like
C++ or Java)
• Compressing target files into archives (such as JAR, ZIP or
WAR)
• Generating software installers
• Running automated tests on the build
• Automatically deploying software on a target environment
• Build Automation help development teams by
Standardizing builds, eliminating variations between
releases and reducing manual work which can lead to
defects and deployment issues.
• Documenting and codifying important aspects of a
software project
Build automation systems can be triggered in a
number of ways:
• Manual build trigger—a developer requests a new build.
• Schedule build trigger—an automatic build from the
codebase every hour, day, week, etc.

• Source code build trigger—many teams automatically


run a build after every code commit, in line with
continuous integration best practices.

• Post-process build trigger—a build can be run each time


a specific process completes, for example after a security
scan finishes running, although this is not commonly used
in CI/CD pipelines, and all build-related processes are
typically run as part of the build script.
Types of Builds : Two Types
• Full build—builds the entire software application from
the source files. It takes in the full project, checks
dependencies, compiles all source code and builds the
target software components, creating the complete build
artifact.

• Incremental build—an incremental build takes an


existing build, checks what has changed in the source
code and artifacts since the last time the software was
built, and compiles or rebuilds any file or artifact that has
changed, or which depends on a resource that has
changed. Other files will remain unchanged and be reused
from the previous build.
How Do Build Automation Tools Work?
• Build automation tools use a scripting language that allows
developers to specify what source code to use, pull in the relevant
resources, and perform other actions such as run automated tests or
deploy the software.
Top Automated Build Tools
• Jenkins
• TravisCI
• Maven
Delivery Automation : Automate continuous delivery through a delivery pipeline

• Continuous delivery requires that code changes constantly


flow from development all the way through to production.

• To continuously deliver in a consistent and reliable way, a


team must break down the software delivery process into
delivery stages and automate the movement of the code
through the stages to create a delivery pipeline.

• A delivery pipeline is so-named because it allows code to flow


through a consistent, automated sequence of stages where each
stage in the sequence tests the code from a different
perspective.

• Each successive stage becomes more production-like in its


testing and provides more confidence in the code as it
progresses through the pipeline.
• While each stage is either building or testing
the code, the stage must have the necessary
automation to not only run the test but also to
provision, deploy, set up, and configure the
testing and staging environments.

• The code should progress through each stage


automatically.

• The goal is to strive for unattended


automation that eliminates or minimizes
human intervention.
• It is a wise investment to create and automate your delivery
pipeline before you write much feature code.

• Create a simple "hello world" application in the programming


language that the project will use and focus on getting the
pipeline stages identified, implemented, and automated from
end to end.

• By taking this approach, you can create feature code much


faster and with confidence because you can build and test each
bit of code automatically.

• If you are adding an automated pipeline to an existing project,


where you start depends on the current level of automation
that is already in place and, more importantly, where the
biggest bottleneck might be in the delivery flow that
automation can improve.
The benefits of an automated software delivery pipeline
Choose tools for the delivery pipeline
• Creating even a simple delivery pipeline involves
multiple automation tools and frameworks.
• Source-code management: Tools include Git and
Subversion.
• Build: Tools include Ant, Make, Maven, and Gradle.
• Continuous integration (CI) server: Tools include
Jenkins and Travis-CI.
• Configuration management: Tools include Ansible,
SaltStack, Chef, and Puppet.
• Deployment and provisioning: Tools include IBM®
UrbanCode® Deploy, Bamboo, and Chef.
• Testing frameworks: Tools include xUnit, Behave,
and Selenium. Testing frameworks tend to be
programming-language specific.
Various stages of the pipeline
• Automated testing
• An orchestration framework for continuous
delivery
Stages
• Because every pipeline is different, stages don't have strict
rules.
• However, several common stages are applicable to most
projects: build, staging, and production.
Build

• In the build stage, the software is built,


packaged, and archived. Unit tests are run.
• The input for the build stage is typically a
source-code repository.
• The output of this stage is an artifact that is
stored in an artifact repository.
Staging
• In this stage, the build artifact is installed or
deployed into a staging environment that is a clone
of the production environment.
• Automated tests are run to verify the new version.
• Functional tests or integration tests are run on new
capabilities.
• Regression tests are run to ensure that the new
version does not break any capabilities.
• Finally, performance tests are run.
Production
• In the production stage, the software is
installed or deployed into the production
environment.
• Additional tests are run to ensure that the new
version is working as expected.
• To avoid downtime during deployment,
techniques called "blue-green" or "red-black"
deployments are often used.
Understanding Code Quality
• Code quality metrics defines code that is good
(high quality) - and code that is bad (low
quality).
• The code quality is important, as it impacts
the overall software quality. And quality
impacts how safe, secure, and reliable your
codebase is.
• Programmers aren’t perfect. Manual code
reviews and testing will never find every error
in the code.
• A study on “Software Defect Origins and Removal
Methods” found that individual programmers are less than
50% efficient at finding bugs in their own software.
• And most forms of testing are only 35% efficient. This
makes it difficult to determine quality.
• The quality of code in programming is important. When
code is low quality, it might introduce safety or security
risks.
• If the software fails - due to a security violation or safety
flaw.
• Quality is everyone’s job. The developer. The tester. The
manager. High quality should be the goal throughout the
development process.
How to Measure Code Quality?
• There’s no one way to measure the quality of your code. What you
measure may be different from what other development team measures.
• Reliability
Reliability measures the probability that a system will run without failure
over a specific period of operation. It relates to the number of defects and
availability of the software.
• Maintainability
• Maintainability measures how easily software can be maintained. It
relates to the size, consistency, structure, and complexity of the codebase.
And ensuring maintainable source code relies on a number of factors,
such as testability and understandability.
• Testability
• Testability measures how well the software supports testing efforts. It
relies on how well you can control, observe, isolate, and automate testing,
among other factors.
cyclomatic complexity — can help you improve the testability of the component.
• Portability
• Portability measures how usable the same software is in
different environments. It relates to platform
independency.
• Reusability
• Reusability measures whether existing assets such as
code - can be used again. Assets are more easily reused if
they have characteristics such as modularity or loose
coupling.
• Reusability can be measured by the number of
interdependencies. Running a static analyzer can help you
identify these interdependencies.
Automation of CI/CD
• CI/CD, which stands for continuous integration
(CI) and continuous delivery (CD), creates a faster and
more precise way of combining the work of different
people into one cohesive product.

• In application development and operations (DevOps),


CI/CD streamlines application coding, testing and
deployment by giving teams a single repository for
storing work and automation tools to consistently
combine and test the code to ensure it works.
What is the CI/CD pipeline?
• The continuous integration/continuous delivery (CI/CD)
pipeline is an agile DevOps workflow focused on a frequent
and reliable software delivery process.

• The methodology is iterative, rather than linear, which allows


DevOps teams to write code, integrate it, run tests, deliver
releases and deploy changes to the software collaboratively
and in real-time.

• A key characteristic of the CI/CD pipeline is the use of


automation to ensure code quality.

• As the software changes progress through the pipeline, test


automation is used to identify dependencies and other issues
earlier, push code changes to different environments and
deliver applications to production environments.
Benefits of the CI/CD pipeline
• Reducing time to deployment through
automation:
• Automated testing makes the development
process more efficient, reducing the length of
the software delivery process.
• In addition, continuous deployment and
automated provisioning allow a developer’s
changes to a cloud application to go live
within minutes of writing them.
• Decreasing the costs associated with
traditional software development: Fast
development, testing and production
(facilitated by automation) means less time
spent in development and, therefore, less cost.

• Continuous feedback for improvement: The


CI/CD pipeline is a continuous cycle of build,
test and deploy. Every time code is tested,
developers can quickly take action on the
feedback and improve the code.
• Improving the ability to address error
detection earlier in the development
process: In continuous integration, testing is
automated for each version of code built to
look for issues integration. These issues are
easier to fix the earlier in the pipeline that they
occur.
• Improving team collaboration and system
integration. Everyone on the team can change
code, respond to feedback and quickly
respond to any issues that occur.
Automation and how the CI/CD pipeline works

• The CI/CD process begins with continuous integration


(CI).
• CI allows developers to work independently, creating their
own coding “branch” to implement small changes.
• As the developer works, they can take snapshots of the
source code, typically within a versioning tool like Git.
• The developer is free to work on new features; if a problem
comes up, Git can easily revert the codebase to its previous
state.
• The work of individuals is then pushed into an automated
system that uses scripts to build and test the code changes.
• After the build stage, a CI server compiles the source code
changes into the master code or “trunk.”
• Instead of writing code independently and
submitting to the master once a month, which
can lead to arduous work fixing bugs and poor
version control, the CI/CD development
process lets teams submit code changes more
frequently.
• This continuous testing offers faster bug fixes,
ensures functionality and, ultimately, results in
better collaboration and software quality.
The CI/CD pipeline phases

You might also like