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.
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
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.
Job1: Pull the GitHub repo automatically when some developers push the repo to GitHub.
Job2: By looking at the code or program file, Jenkins should automatically start the respective language interpreter install image container to deploy code .
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.
Job4: If the app is not working, then send an email to the developer with error messages.
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.