Task 2

Task 2

In this task of mlops training I am going create a complete Jenkins Pipeline from pulling the code from github, creating the suitable build environment, building the package till testing the code. I will represent the whole workflow of the task.

Pre-requisites: RHEL8 or Centos8 as base operating system, installed docker services.

First of all we will create a docker image with jenkins configured in it using Dockerfile. As soon as we run this docker image our jenkins service starts in it. Below is the Dockerfile I created to build the image.

No alt text provided for this image

Now we will build the image and run it. But while running the image, do not forget to expose port 8080 of the image as jenkins run on port 8080 by default. Now when you build the image your o/p at the console should be like as follows.

No alt text provided for this image

You will also gwt the initial admin password at console which will be used later. Now in you web browser access the port XXXX of your (here XXXX is the port number that you have assigned to port 8080 of jenkins container image which in my case is 5000). It will get us to the first login page of jenkins where the initial admin password will be used.

Now comes the part of jenkins. Here I will create 5 jobs as follows.

Job1: The task of this job is to pull the Github repo automatically when some developers push repo to Github. Here the role of build trigger and github webhook comes in play. This job will also create a directory named "webcode" in the local host.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Job2: This job will do an interesting work.  By looking at the code or program file,this Jenkins job will automatically start the respective language interpreter install image container to deploy code. In this task I am taking PHP code as example, i.e., if code is of PHP, then Jenkins will start the container that has PHP already installed and start deploying the code. This job will be automatically triggered by job1.

No alt text provided for this image
No alt text provided for this image

Job3: This job is ment for testing the the app if it is working or not. This job will also be automatically triggered by Job3.

No alt text provided for this image
No alt text provided for this image

Job4: If the application in the deployment environment is not working then it will send an error notification to the developes via email. But we need to configure jenkins for sending emails.

No alt text provided for this image

Job4 is triggered by Job3:

No alt text provided for this image
No alt text provided for this image

We will also create an additional job say Job5 which will keep on checking if container image in which the application is deployed is working or not. And if nit working then it will relaunch that container image. It will keep on checking the running container at every 5th second.

No alt text provided for this image
No alt text provided for this image

We used Jenkins build pipeline to do all the job chaining so lets install the pipeline plugin and have a look at that.

No alt text provided for this image

This is the overall view the workflow of task assigned to me in my MLOps training.

Thank you for having a look at this and feel free to contact in case of any querry.

To view or add a comment, sign in

More articles by Akash Saini ( Akki )

  • Expert Session on Red Hat OpenShift

    Yesterday an expert sessions was held on Red Hat Openshift container platform organized by LinuxWorld Informatics Pvt…

  • A use case study of how Netflix uses services provided by AWS.

    Online content provider Netflix can support seamless global service by using Amazon Web Services (AWS). AWS enables…

  • __Getting started with Big Data__

    This article is for those who want to know basics of Big Data like what is big data, what is the need of it in the…

  • A Self Reflection of mine

    Here I am writing a self reflection of mine, what I knew 2 months age and what I know now in the world of Machine…

  • Instance Segmentation Using Mask R CNN

    Here I am going to perform instance segmentation of Cars using Mask R-CNN model. I will be using the Supervisely a Web…

  • MLOps

    I completed one of the tasks given to me by Sir Vimal Daga, a world record holder, during my industrial training under…

  • Do not remain just sitting, Fight against Corona....

    Yes, today the situation we are in is very tough. This pandemic is a tragedy happening all around the world.

Explore content categories