Tutorial 1- DevOps Overview

Welcome to the exciting world of DevOps!

What you will Learn:

 

SDLC Evolution

DevOps Overview

The traditional SDLC waterfall model approach is suitable for products whose requirements do not change over the software development lifecycle. The challenge with this approach is that, if there are 10 product requirements (features), the end user will not have the product look and feel till the final product is built. Once all the 10 features are developed and tested, only then the application would be deployed to production. So the release lifecycle was quite long.

On the contrary, in the Agile world, the end user wants to have a look and feel of the features as and when they are developed. The challenge here is a) individual feature needs to be developed and tested and deployed to production b) requirements might change at any point of time c) operations team is not kept in sync of any changes that might come in between and hence some friction is expected.

Most of the above challenges and risks are mitigated in DevOps software development approach. One of the primary reason being, the entire code deployment process to development server -> to staging server -> to production server, is automated. Jenkins helps us automate the entire process.

Before DevOps

DevOps Overview

Before DevOps culture, there used to be a development and operations team. The developers used to write their code and pass it to the operations team. The operations team will add few configurations, make it production ready and deploy it to the servers. The operations team would also manage the infrastructure.

The challenge in pre-devops culture:

  1. Dev team & Ops team would be working independently. They do not know what the other team is doing. No collaboration between developer and operations personnel
  2. Developers always want to move their code to production as soon as possible. However operations team perform their due diligence before deploying anything new to production and hence the deployment process used to be slightly slow. This resulted in little bit of stress between the 2 teams.

After DevOps

DevOps is simply a way of doing activities/tasks that has automation in every aspect of it. DevOps was introduced to overcome the above challenges and accelerate the software delivery process.

Also read: Configure Selenium-Java Webdriver in Eclipse

The developers can now deploy the changes directly to servers and hence the process is much faster, see below

DevOps Overview

The whole DevOps system that we are going to build will be running on a linux machine. DevOps is not a tool, instead it is a culture comprising of many tools.

Before getting deployed to production, the source code moves through various stages inside the DevOps culture world. There are various tools available for each stage:

  1. Git (local source code version management tool),
  2. GitHub (remote source code version management tool),
  • Maven (to build the project),
  1. Tomcat (app server to deploy apps),
  2. Docker (to create containers),
  3. Kubernetes (to manage deployment of containers),
  • SonarQube (for code analysis),
  • JFrog (to store the artefacts that are generated using Maven build process),
  1. Ansible, Chef, Puppet (configuration deployment automation tools),
  2. Jenkins, Bamboo (integrates all the above tools enabling automated deployments using Continuous Integration/Continuous Delivery pipeline code),
  3. Vagrant (to create local lab infrastructure by creating linux virtual machines),
  • AWS, Azure, Google cloud (to create infrastructure on cloud)

DevOps Overview

The ultimate goal of all these tools is to help us accelerate the process of source code deployment to production.

DevOps Engineer role

As a DevOps engineer, we need to work with multiple technologies and should be able to integrate devops tools. The person has a dual role: developer & operations engineer. DevOps engineer will be responsible to move the source code to different DevOps stages and finally deploy it to production environment.

Also read: Working with Various Browsers

Benefits of DevOps

DevOps make our life easier since it automates application deployments by integrating various tools.

Brief overview of DevOps Tools

  • Platform – All the DevOps tools are configured in Linux platform
  • Source code management – Git maintains the version of your code, at any point of time you can see the code version history, you can also see who modified the code, when was it modified and so on;
  • CI/CD – Jenkins is a continuous integration and continuous deployment tool. What this means is that, whenever the developer updates his/her code, Jenkins will automatically pull the updated code and deploy the changes to your website. The end users will now see the new changes;
  • Containers – Docker containers are completely isolated environments. Each container can have their own processes or services. The main purpose of Docker is to containerize applications and to ship them and run them;
  • Managing containers – Suppose the production environment is running thousands of containers. To manage the containers, we use Kubernetes;
  • Automation tools in DevOps – Ansible can be used to automate any service in Windows/Linux/Server etc;
  • Infrastructure as a Code (IAAC) – We can create our linux instances (infrastructure) in 2 ways: Vagrant can be used to create infrastructure in our local machine. AWS Cloud, Azure, Google cloud platform etc can be used to create infrastructure on cloud (for deploying a real application).

Typical DevOps Workflow

The different stages are numbered in the below diagram and are shown in brackets.

DevOps Overview

Below is a typical DevOps workflow:

  1. Developers develop their code
  2. Commit the code to local Git repository (Git keeps track of source code changes in developer’s local system)
  3. Once code is ready, developers push the code to remote GitHub repository. When multiple developers are working on a common project, GitHub distributed repository ensures code integrity and solves collaboration issues between developers
  4. We use Jenkins to integrate all the tools and it ensures that the code moves from one stage to another stage automatically. So, Jenkins clones the GitHub repository
  5. Jenkins will execute Maven command for build process. Maven compiles and packages the source code into an artefact
  6. Once build is success, Jenkins will ask Maven to push the source code to sonarqube for code quality analysis
  7. Once code quality is ‘Pass’, Maven publishes the artefact to JFrog artifactory
  8. Once artefacts are ready in JFrog artifactory, the artefacts can be deployed to application servers. The app server can be a standalone (apache tomcat) OR it can be a Docker container
  9. Jenkins calls Ansible scripts to run playbooks to create custom docker image (that includes our artefact). Ansible playbook will take care of publishing custom images to the docker hub
  10. Once customized image is available at docker hub, Jenkins will run the deployment manifest and service manifest on kubernetes cluster. The kubernetes master starts creating the application instances (viz deploy the application) on the worker nodes (pods)
  11. Once the application is running successfully, we can now access the application using a URL which is mapped to specific application endpoint. End users can now access the application.

We would be learning fundamentals of most of these tools as we move along this exciting DevOps journey.

DevOps as CI/CD

DevOps Overview

DevOps software development approach comprises of: Continuous development, Continuous Testing, Continuous Integration and Continuous deployment (all of these at the same time).

If you look at the above figure, the new features are continuously being developed and tested. Once thoroughly tested, the new features and the bug fixes are continuously deployed to end users. The entire process is automated using various tools at each stage.

So this was all about DevOps fundamentals.

We would next be starting with source code management: Git & GitHub tools.

Thank you for reading!

Share On

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp
Share on tumblr
Share on email

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

Lifetime Membership Club

LIFETIME MEMBERSHIP BIG SALE - ALL LIVE COURES JUST - 10000 RS/149 USD
Attend All Live courses in just 10000 rs / $149 - offer ends 31st May 2024