What are the basics in DevOps: CI/CD Jenkin?


        

        The practice in software engineering for automating the code periodically is called Continuous Integration(CI). The resulting binaries after building the code which can be deployed to the target environment. This practice is called continuous delivery. It aims at building, testing, and releasing software faster and frequently. In the regular software development lifecycle, the team members checking their code regularly in a source version control system like Git repository. The CI server fetches these changes and integrates them. It runs the build process and produces the bundle of artifacts. These artifacts are versioned and stored in the build repository. CI server also runs unit test and integration tests etc., It runs the entire process based on several triggers many times a day and sends the notification of success or failure. There are various products, tools, and frameworks available to implement CI and CD pipeline in our environment. The most popular are Bamboo, Circleci, Continuum, Travis CI, Cruise Control, TeamCity, anthillpro and Buildbot etc., You can host the CI server into the network infrastructure and other products completely hosted in the cloud. It depends on the business and technical requirements of the project.     

        When practicing CI, the developer commits their code into the version control repository. It is easier to identify the defects and other software quality issues on a smaller code than larger code developed over the period. The teams implementing the CI, start with version control configuration and practice definitions. The features and fixes are implemented in both short and long time frames. When the feature is complete, the developer merges the changes from the feature branch to the primary development branch. CI packages all the software, database components, and testing. Continuous delivery is the automation that pushes the application to delivery environments. The development teams have development and testing environments. The CI/CD is designed for businesses that want to improve the application delivery process. It has standardized builds, develop tests, and automate deployments for deploying changes in the code. The operations team can see greater stability in the standard configuration environment.

The essential CI/CD principles are,

   * The system has been architected that supports the iterative releases and metrics help to detect issues in real-time. 

   * The test-driven development keeps the code in a deployable state and works in small iterations.   

   * Developers push the code into production and ensures the new version of the software will work when it gets in the hands of the users. Anyone can deploy any version of the software at a push of a button. 

   * The engineering team should be responsible for the quality and stability of the software they build.

The advantages of CI/CD are,

  1. It detects problems or bugs as early as possible in the development cycle. The risks will be minimized by integrating all the changes from the key members on a frequent basis.

2. As new changes and features are introduced into the source so that the team can competently accommodate these changes.

3. The entire code basis can be integrated, test, and deployed to sufficient frequency that shows the error earlier on the cycle. The feedback will help to build better and quality software. 

4. Since the build is automated and the source is integrated which can be continuously deployed. There is no delay in building the artifacts and satisfying the customer. All builds are systematic build number. This results in a fully trackable build and deployment process. It gives us the ability of any particular version of the software and traceback exact commits or version of the system. 

5. The CI and CD processes have valuable information about source code. It helps to analyze the broader perspective of the team. Is the code coverage increasing over time? 

6. Since the build, integration, and deployment are automated with the help of CI and CD, the team can ship the product faster and more consistently. Some organizations take automation to the extreme and ship the code several times a day. 

DevOps Practices:

           Software Teams perform several tasks frequently such as writing the code, testing, staging, moving the code from development to production environment. Performing all the tasks manually consumes a lot of time and the likelihood of mistakes in the configuration issues and customer frustration. The DevOps process overcomes the challenges in the manual approach. As soon as the new code approaches the source code repository, it can be automatically built, and the test can be run to validate the code. It ensures to run in an integrated manner. Once the code is validated, we can go with our build, Dev, QA, and production deployment. DevOps culture enables and triggers a series of incremental process improvements. Implementing the DevOps culture infrastructure can help you streamline the development process and detecting and fixing the bugs faster. It provides a useful project dashboard, and the team can deliver more business value to user.

      Jenkin is a popular tool for CI/CD and a continuous deployment framework for any platform and technology. It is a low-cost open-source platform and a large active community. It is widely used from small startups to large corporations. This open-source automation tool with plugins built for DevOps purposes. Plugins allow the integration of various DevOps status like configuration management, version control, build, continuous monitoring etc.,  It can trigger the build for every change made in the source code repository. Once the code has been building, Jenkins deploys on the test server for testing. The teams are constantly notified for build and test results. Finally, it deploys the build application to the production server. Jenkins supports 1000's of plugins. The main advantage of Jenkin is to increase developer productivity and brings agility to the development process by automating important tasks. 

           It uses master and slave architecture to manage the distributed build. Master and slave use TCP/IP protocol. The Master's job is to pull the SCM repository from git to subversion. It schedules the build jobs and dispatches to the slave for the execution. Primarily, the master's job is to orchestrate the job across the whole cluster. The master instances can execute the build job directly. The slave Jenkin's instance is a java executable that can run on a remote machine. It accepts a request from Jenkin's master instance and executes the job and report back to status of the master. Slaves run on a variety of OS and additional slave nodes can be added to the architecture as the system grows.

Jenkin Installation:

          In the Jenkin website, open the plugin and you can see 1500+ community plugins. The important plugins are SSH, Git, marvel that you can find and use it. Jenkins can be installed in your Ubuntu Virtual Machine or GCP. To install Jenkin, Open GCP and create new instance for Jenkin to test CI. In connect SSH, open the new browser window and execute the commands. Jenkin must have the latest version of java application. Once you installed JDK by the command sudo apt install default-jdk, open Jenkin documentation and run Debian/Linux commands.


    Once you successfully executed the commands, create the Firewall for Jenkins 8080 port and click the external IP which will open the getting started Jenkins Pages. Jenkins is a secure server, it needs an authenticated user to login and works with them. To unlock Jenkins and run securely, you must provide the default admin username and password in order to log in. Once you entered the secret password, it will securely redirect to the setup wizard and open your dashboard page. This is the central place to manage plugins and all the jobs.


      Now, you can manage plugins and create the jobs. In the global tool configuration, you can easily configure various tools, locations, and installers for the build job in Jenkins so that to work on your automation project.  Jenkins pipeline helps you to build the process of the project by specifying the tasks and order in which they are executed. For ex, build assets, send an email on error, send the build artifacts via SSH to your application server etc.,


     Creating Job in Jenkin: 

         In order to create a new job, click the new item. Once you entered the item name and select the freestyle project. This will create a new job in Jenkins. Basically, the job is an actor. For ex, In order to create a simple job, select config and update the build tab command as echo Hello World and execute shell batch command and save. Now, the job is configured and ready to run it. To run the job, select the job name and build it now. The job has run successfully, you can see some links. In the console output, you can see the command that we put as echo "hello_world".

     Jenkin is a highly scalable framework that can handle 1000 builds simultaneously for large teams or sub-teams. It also supports a plethora of technologies, languages, and frameworks. So, we need to build a scalable and distributed clusters of Jenkins nodes for a demanding level of efficiency.  You must think about the master-slave architecture supported by Jenkins when scaling out. The master node is the central controller node which co-ordinates and assign build jobs across the cluster of nodes. People accessing Jenkins as a web interface running on the master nodes. Running and managing the build jobs are demanding tasks in Jenkins. Ensure that the jobs are not running in master node and made regular backup configuration in master nodes. Slave nodes are quick to set up and should be utilized to run multiple jobs. Moreover to clean up unnecessary plugins. These plugins clutter the whole system and may cause an unforeseen issue. 

Comments

Post a Comment

Thanks for your comments and we are moderating your comments for publishing in our blog post.