Task2 (MLOps)

Task2 (MLOps)

Problem Statement :

1. Create a container image that’s has Jenkins installed using Dockerfile. 

2. When we launch this image, it should automatically start the Jenkins service in the container.

3. Create a job chain of job1, job2, job3 and job4 using the build pipeline plugin in Jenkins.

4. Job1: Pull the GitHub repo automatically when some developers push the repo to GitHub.

5. Job2: By looking at the code or program file, Jenkins should automatically start the respective language interpreter install image container to deploy code ( eg. If code is of PHP, then Jenkins should start the container that has PHP already installed ).

6. Job3: Test your app if it is working or not.

7. Job4: If the app is not working, then send an email to the developer with error messages.

8. Create One extra job job5 for monitor: If the container where the app is running. fails due to any reason then this job should automatically start the container again.

Task Description :

1.Create a Dockerfile (for installation of following softwares)

# Running Jenkins URL with the help of "wget" command of Linux.

# Installing Java for running of Jenkins.

# Installing Python3 for running python code.

# Installing net-tools , so that we can check IP of our container/OS.

No alt text provided for this image

For creating our own customized image and hence Running it with following command-

docker build -t myjenk:v1 .

For launching a docker container

docker run -it --privileged -p 8081:8080 -v /:/host --name jenk myjenk:v1 
No alt text provided for this image

It will expose 8081 port through port number 8080.

Lets start with Jenkins

Now our jenkins is ready to use. It will give temporary password.

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

Job1: Pull the GitHub repo automatically when some developers push the repo to GitHub.

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

Job2: By looking at the code or program file, Jenkins should automatically start the respective language interpreter install image container to deploy code .

No alt text provided for this image

Job3: Test your app if it is working or not.

With the help of curl command, we will see whether our webpage is working properly or not.

For success , the code is 200.

No alt text provided for this image

Job4: If the app is not working, then send an email to the developer with error messages.

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

Job5 for monitor: If the container where the app is running. fails due to any reason then this job should automatically start the container again.

No alt text provided for this image


GitHub link :




To view or add a comment, sign in

More articles by Anurag Prasad

  • Creating AWS EKS Cluster using eksctl and launching pods

    Task Description :- Implementing EKS Cluster with different AWS Services Like EC2 , EFS, ELB and EBS. Creating Fargate…

    4 Comments
  • CONTAINERIZATION-Launching OS in a single click

    PROBLEM STATEMENT : Create container image that has Python3 and Keras or numpy installed using dockerfile. When we…

  • TASK 1 - DevOps

    Problem Statement : JOB 1: If Developer push to dev branch then Jenkins will fetch from dev and deploy on dev-docker…

Others also viewed

Explore content categories