0% found this document useful (0 votes)
23 views34 pages

DevOps On The Cloud

Uploaded by

shwetasha03
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)
23 views34 pages

DevOps On The Cloud

Uploaded by

shwetasha03
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/ 34

1

u Term Project Check-in this week


u Details and links to Calendy are on now front page of myCourses
u Remember each checkin is 5% of your project grade
u Check-in details can be found on myCourses at Content > Project >
Project Check-in
DevOps & Pipelines

SWEN 514/614: Engineering Cloud Software Systems

Department of Software Engineering


Rochester Institute of Technology
A Very Common Challenge in IT 3
u Deployments to production happening very rarely (only a few times a year)
u Testing happens months after the development finishes
u Operations team (which supports production) is constantly fire-fighting
u Developers find it near impossible to get any IT changes done
u Question: Could the Development Methodology be part of the problem?

I want
I want stability
change

Building Supporting
Software Software
Waterfall Methodology 4

u Takes a methodical, sequential approach to


developing software
u It starts with extensive planning and design and then
the development team codes the software
u When the development team is finished, another
team tests it, and once testing is complete the
software is handed off to operations to deploy
u Requirements can (and will) change in the middle of
the dev process, which Waterfall doesn’t take this into
consideration
u It focuses solely on delivering working software, and it
doesn’t consider how the software will work in a
production environment
Agile Methodology 5

u While Waterfall doesn’t work well with change,


Agile does because the focus is placed on delivering
small iterations of software instead of a whole product
u This makes it much easier to adjust the software when
requirements change
u An Agile team is cross-functional and is made up of
one team member from planning, another from
coding, another from testing and so on
u Like Waterfall, Agile also focuses on just creating
working software, and it doesn’t consider how the live
production environment will affect the software and
vice versa, how the software will impact the live
environment
What needs the Change? 6
u Both methodologies exclude the Operations team in the software
development process
u This leads to problems and discord between the development team
and the Operations team
Why?
u When something goes wrong, it’s hard to tell if
the problem lies in the code or in the
deployment
u This results in a lot of blame between the two
departments due to the “wall” between
development and operations
u A new approach emerged called DevOps,
which removes the “wall” between the
Development and Operation teams
DevOps - Defined 7
u 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
u It’s gaining popularity at a rapid rate

Source: https://www.360logica.com/blog/how-does-devops-benefits-to-the-information-system-development/devops-loop-illustrations/
Why is DevOps important? 8

1. Shorter Development Cycles, Faster


Innovation
2. Reduced Deployment Failures,
Rollbacks, and Time to Recover
3. Improved Communication and
Collaboration
4. Increased Efficiencies through
Automation

Source: https://riskspan.com/news-insight-blog/what-is-devops/devops-venn/
Shorter Development Cycles, Faster Innovation 9
u When Development and Operations
teams are in separate silos, it’s usually
difficult to tell if an application is ready
for operations
u When Development teams simply turn
over an application, the operations’
cycle times are extended needlessly
u With a combined Development and
Operations team, applications are
ready for use much more quickly

Source: https://puppet.com/sites/default/files/inline-images/2016%20State%20of%20DevOps%20infographic.jpg
Reduced Deployment Failures, Rollbacks, and 10
Time to Recover
u Part of the reason teams experience deployment
failures is due to programming defects
u The shorter development cycles with DevOps
promote more frequent code releases
u This makes it easier to spot code defects and
teams can reduce the number of deployment
failures
u Time to recover is an important issue, because
some failure must be expected but it is much
faster when the development and operations
teams have been working together, exchanging
ideas and accounting for both teams’ challenges
during development
Source: https://puppet.com/sites/default/files/inline-images/2016%20State%20of%20DevOps%20infographic.jpg
Improved Communication and Collaboration 11
u DevOps improves the software development culture
u When the teams trust each other, they can experiment and
innovate more effectively
u The teams can focus on getting the product to market or into
production
u It’s no longer a matter of “turning over” the application to
operations and waiting to see what happens
u The process becomes
increasingly seamless as all
individuals work toward a
common goal
Increased Efficiencies through Automation 12
u Increased efficiency helps to speed the development process and make it
less prone to error. This includes:
u Test Automation - Test the code and the underlying infrastructure in an automated way
instead of doing it manually
u Centralized Configuration Management - If there are multiple running servers and you need
to make configuration changes in one file then it is better to automate this process rather
than do it manually
u Continuous Integration – Development practice
that requires developers to integrate code into a
shared repository several times a day. Each
check-in is then verified by an automated build,
allowing teams to detect problems early.
u Continuous Delivery – A software development
practice where code changes are automatically
prepared for a release to production
Continuous Integration/Continuous Deployment 13
- aka “CI/CD Pipeline”

u The difference between Continuous Delivery and Continuous Deployment is


the presence of a manual approval to update to production
u With Continuous Deployment, production happens automatically without
manual approval
Source: https://semaphoreci.com/blog/2017/07/27/what-is-the-difference-between-continuous-integration-continuous-deployment-and-continuous-delivery.html
Costs/Gains - Continuous Integration 14

u Costs (upfront work)


u Your team will need to write automated tests for each new feature, improvement or bug fix
u You need a continuous integration server that can monitor the main repository and run the
tests automatically for every new commit pushed
u Developers need to merge their changes as often as possible, at least once a day
u Gains (benefits)
u Less bugs get shipped to production as regressions are
captured early by the automated tests
u Building the release is easy as all integration issues have been
solved early
u Less context switching as developers are alerted as soon as
they break the build and can work on fixing it before they
move to another task
u Testing costs are reduced drastically – a CI server can run
hundreds of tests in a matter of minutes
Source: https://cloud.google.com/solutions/continuous-integration/
Costs/Gains - Continuous Delivery 15

u Costs
u You need a strong foundation in continuous integration and your test suite needs to cover
enough of your codebase
u Deployments need to be automated. The trigger is still manual but once a deployment is
started there shouldn't be a need for human intervention
u Your team will most likely need to embrace feature flags so that incomplete features do not
affect customers in production

u Gains
u The complexity of deploying software has been taken away
and your team doesn't have to spend days preparing for a
release anymore
u You can release more often, thus accelerating the feedback
loop with your customers
u There is much less pressure on decisions for small changes,
hence encouraging iterating faster
Source: https://www.cloudbees.com/use-case/continuous-delivery
Costs/Gains - Continuous Deployment 16

u Costs
u Your testing culture needs to be at its best and the quality of your test suite will determine
the quality of your releases
u Your documentation process will need to keep up with the pace of deployments
u Feature flags become an inherent part of the process of releasing significant changes to
make sure you can coordinate with other departments (Support, Marketing, PR...).

u Gains
u You can develop faster as there's no need to pause
development for releases. Deployments pipelines are
triggered automatically for every change.
u Releases are less risky and easier to fix in case of problem as
you deploy small batches of changes
u Customers see a continuous stream of improvements, and
quality increases every day, instead of every month, quarter
or year
Source: https://medium.com/sleekrco/the-journey-build-continuous-deployment-sleekr-69f07adb7efe
Pipeline - Continuous Integration 17

u Triggered automatically when code is committed to a repository


u A build process is initiated to ensure code is not broken
u Unit tests and other validation processes are executed
u Upon completion, a report is created (success/failed) and/or a
deployment process could be initiated to deploy to another
environment (test, pre-prod, etc.)

Github Maven JUnit


Pipeline - Continuous Integration 18

u Pipeline scripts are generally authored in YAML or JSON

Example Pipeline (GitLab)


Pipeline - Continuous Integration example 19

u Several test and validation steps can be executed to ensure code


quality

Test/Validation Benefit
JUnit Code that tests our code and looks for known regression issues
Jacoco Measures the amount of app code actually exercised by our unit tests. Requires at least 70% coverage

JFrog Xray Proactively identify vulnerabilities on open source and license compliance violations, before they manifest in
production releases
Checkstyle (Linting) Validates code matches best practices for formatting to ease maintenance

Veracode Scans our source code looking for known security and quality issues
SonarQube Additional code scanning for known security and quality issues
Pipeline - Continuous Integration Tools 20

AWS CodeBuild is a
fully managed build
service that
compiles source
code, runs tests, and
produces software
packages that are
ready to deploy
Pipeline - Continuous Deployment/Delivery 21
u Executes after Continuous Integration steps have successfully completed
u Application is built and deployed to a pre-prod environment
u Additional automated testing and/or Acceptance Testing is conducted
u If successful, the application is then deployed automatically or pending a
manual approval to production
Pipeline - Deploy 22

u Deployment Examples:
u Deploy on-premise
u Build code and deploy to existing infrastructure
u Deploy to cloud
u Create the infrastructure using IaC
u Build code and package (e.g. containers)
u Deploy to new infrastructure (e.g. container orchestration)
Pipeline – Deploy to Cloud example 23

u This example provides Continuous Deployment pipeline


that deploys code into docker applications running on
ECS

This could be
Docker Hub
Source: https://aws.amazon.com/blogs/compute/continuous-deployment-to-amazon-ecs-using-aws-codepipeline-aws-codebuild-amazon-ecr-and-aws-cloudformation/
DevOps in the Cloud – CI/CD Pipeline 24

u AWS CodePipeline
u A Continuous Delivery/Deployment service for fast and reliable application
updates
u It builds, tests, and deploys your code every time there is a code change, based
on the release process models you define
Deployment Tools 25

u The following Deployment and Management services create the


infrastructure
DevOps in the Cloud – AWS OpsWorks 26

u AWS OpsWorks is a configuration management service that provides


managed instances of Chef and Puppet
u Chef and Puppet are automation platforms
that allow you to use code to automate the
configurations of your servers
u It uses a concept of stacks, layers and
instances
u Stacks - You control AWS resources like
virtual machines, load balancers, container
clusters, and databases
u Layers – These are responsible for configuring
and deploying software to virtual machines
u Instances – A representation for a virtual
machine
Source: Wittig, M. and Wittig, A. (n.d.). Amazon Web Services in action.
DevOps in the Cloud – Elastic Beanstalk 27
u A higher-level service (PaaS) for deploying and scaling web
applications and services developed with Java, .NET, PHP, Node.js,
Python, Ruby, Go, and Docker on familiar servers such as Apache,
Nginx, Passenger, and IIS
u You can quickly deploy and manage applications in the AWS Cloud
without worrying about the infrastructure that runs those applications
u Automatically handles the
deployment, from capacity
provisioning, load balancing, auto-
scaling to application health
monitoring
u All via CloudFormation
DevOps in the Cloud – Elastic Beanstalk 28
u The elements of Elastic Beanstalk includes:
u Application - A logical container that contains versions, environments, and
configurations
u Version – Specific release of your application of deployable code on S3

u Configuration template -
contains your default
configuration (e.g. size of
virtual machine)
u Environment - where AWS
Elastic Beanstalk executes
your application. It consists
of a version and the
configuration.
Source: Wittig, M. and Wittig, A. (n.d.). Amazon Web Services in action.
Recap of Deployment Models 29

u With my infrastructure created and deployed, how do I now deploy my


code from my repo (e.g. Github) to the EC2 instances?
AWS CodeDeploy 30
u AWS CodeDeploy is a fully managed deployment service that
automates software deployments to a variety of compute services
such as Amazon EC2, AWS Fargate, AWS Lambda, and your on-
premises servers
u You can use AWS CodeDeploy to automate software deployments,
eliminating the need for error-prone manual operations
CI/CD on AWS - Summary 31
u There are several tools to help that can help with your pipelines on AWS
These are optional for your This is the same as the
project “setup” for your project

u There many more 3rd party tools you can choose from
CI/CD - Challenges 33
u Organizational Culture Changes
u Some businesses prefer traditional methodologies and might have a hard time implementing
continuous integration
u Managers may be resistant because continuous integration doesn’t help them meet their
immediate company objectives
u Difficult to Maintain
u Building an automated code repository is not a simple task and there are many tools to
integrate
u Teams must build the proper testing suite and spend time writing test cases versus developing
code
u Numerous Error Messages
u For larger development teams, they may see CI error messages daily and ignore them
because they have other tasks and concerns
u They may start to see a broken build as a normal thing and defects could start accumulating
on top of each other

u Bottom-line – Migration might be slow, but benefits easily outweigh the costs
Build a Simple Pipeline 34

u We are going to create a Continuous Deployment pipeline that


deploys a live sample web application
u This will use AWS CodePipeline to deploy code from your Github
account to an Elastic Beanstalk NodeJS application
u Go to Assignments > Activity #13 – Create a DevOps Pipeline
u There are 2 deliverables for this activity

You might also like