Monday, March 6, 2017

CI/CD Concepts and popular tools

1 Introduction

I had been asked many times about what is CI/CD, I had tried my best to explain it but still, i found out if someone hadn’t done it before, it is a difficult concept to grasp.

Then, I found the only way to explain the full picture is using a lot of diagrams and detail step to step workflow as example. In order to save time and the hazzle to explain the same thing again and again.  I just write a document like this post, and give it to people who me about CI/CD.

1.1 What is Continuous integration (CI)?

Continuous Integration (CI) is a development methodology with the following:
  • Developers is required to check in code to a shared repository daily or several times a day.
  • Each check-in will trigger a build in the CI server (Jenkins)
  • Unit and integration testing is integrated with the build.
  • If anything fail, the responsible person will be notified.

This methodology has allow teams to detect problems early and quickly.

1.2 What is Continuous deployment (CD)?

Continuous deployment (or Continuous delivery) is a methodology to automate the steps of taking checked in code and making it run on production server that passes the automated tests. It is a set of practices and principles aimed  to build, test and release software faster and reduce the cost, time and risks.

1.3 What is DevOps

DevOps is a term refer to a set of practices that allow the automating the process of software delivery and infrastructure changes. This process emphasize the collaboration and communication on both software developers and other information-technology (IT) professionals within an organization.

DevOps is basically a continuation of CI/CD process into the production environment like the following diagram.

2 Tools for CI/CD developments

There are tons of tool out there for CI/CD process but I love the following tools described here and some of them are basically the de facto standard tool for CI/CD.

Except JIRA, all the tools mentioned here are free.

2.1 Source Code Management - Git/CodeCommit


By far, Git is the most widely used open sourced version control system (VCS) in the world. It is originally developed in 2005 by Linus Torvalds, the creator of the Linux operating system.

CodeCommit is a AWS GIT service. It is a low cost option to host GIT repository in AWS.

Following is some characteristic of GIT
  • Support for non-linear development - Git supports rapid branching and merging,
  • Distributed development - Developers can clone a copy of the source code and store it locally for software development, once development is done, the change can be easily merge back to the repository.
  • Can handle large projects - Git is very fast and scalable compared to other version control systems.
  • Data Assurance - each version (commit) of source code is depend upon the complete development history leading. It is almost to have data corruption.

2.2 Vagrant with VirtualBox for development


Setting up a development environment can be a tedious and time consuming chore. But using Vagrant, we can create portable configurations and allow developers to create their own development environment on their PC.
Following is the reason why Vagrant with Virtualbox is popular:
  • Virtualbox is a software virtualization package that installs on PC or OSX, and is  free.

  • Vagrant is a tool to create and configure a portable development environments. We can describe the environment in a Ruby like text file called Vagrantfile. We can also include some orchestration commands to bootstrap the environment. This Vagrantfile can versioned and stored in GIT.

The biggest beauty of using developer's PC as development tool is it give freedoms to the developers to experiment new ideas without worrying destroying the development environment. If the hit a problem and can not resolve, all they need to do is destroy the environment and recreate, and it all just could happen within minutes.

2.3 JIRA - Issue-tracking System

JIRA is the most popular agile tool for issue-tracking platform. It allows you to track any kind of unit of work (be it an issue, bug, story, project task, etc.) through a predefined workflow.

Because it can be easily integrated with Jenkins, Git and other platforms, it is widely  used by development and technical support teams to get more work done and faster.

JIRA is a licensed software from Atlassian.

2.4 Jenkins

Jenkins is an application and a framework that manages and monitors the execution of repeated tasks. Jenkins is popular, open sourced and also the hub of the CD/DevOps Ecosystem.



To understand how Jenkins become a hub, the following is a CI process model that has been used in many company.

  • Developers check out software code into their private workspaces (workstation).
  • Developers develop and test the code in the Development environment setup with Vagrant and Virtualbox.
  • When the code is finish and test locally, developer commit the changes to the repository (GIT).
  • The Jenkins server (CI server) monitors the repository and checks out changes when they occur.
  • The Jenkins server builds the system.
  • Automatic unit and integration tests can be setup after the build completes, but it is optional.
  • The Jenkins server releases deployable artifacts (ie. executable).
  • The Jenkins server assigns a build label to the version of the code it just built.
  • The Jenkins server informs the team of the successful build via email.
  • If the build or automated acceptance tests fail, the Jenkins server alerts the team via email and a JIRA ticket.
  • The team fix the issue at the earliest opportunity.
  • Continue to continually integrate and test throughout the project.
  • When ready, release software for user acceptance test.
  • Final release to the general public.

2.5 RunDeck


RunDeck is an open-source tool that can automating tasks on multiple nodes, with both a CLI and a web-based interface. It has a concept of jobs similar to Jenkins.'

Rundeck is not very well know but I found out it is very useful when we need to combine complicated deployment procedures as one job. I also like the simplicity of the GUI user interface and allow us to create “one-click” jobs for different groups within an organization.

process

3 Conclusion

I hope this post help you to understand the CI/CD process and the popular tools being used.

4 comments: