Git & Github | Jenkins | Docker
One of the biggest challenges in the industry is the automation and integration of various technologies like Machine Learning, Containerization, Git, Jenkins, etc.
This particular post is a demonstration and an example of the integration of Git & Github with Jenkins and Docker
Step 1: Creating an Image that has Jenkins installed using docker file
We can build the above docker file using the command
docker bulid -t mlopsproject:v2 /root/mlopsProject2
NOTE: /root/mlopsProject2 is the path where the docker file is located.
We can start our container using the following command
docker run -it --name os1 mlopsproject:v2
Create a job chain of job1, job2, job3 and job4 using build pipeline plugin in Jenkins
Job 1: Pull the Github repo automatically when some developer push code to Github repo
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 ).
NOTE: Here we are not looking instead we are using a separate .txt file which developer will give with the code and by looking at the file we should be able to know what code has been pushed by the developer, This is an example that how the developer and the operations guys are working together depicting mindset of DevOps because instead of just pushing the code and let the Operations guy figure out what code is it we are giving a separate file so that the work will be easy for the operations guy to figure out.
Job3 : Test your app if it is working or not.
This particular code will check if the site is working or not if it returns status code "200" then the site is working and if not then there is some issue with the site.
Job 4: If for some reason docker stops then job 4 will automatically restart the docker and after that it will again trigger
job1 to repeat whole process again
:- Build Pipeline for these jobs
Github Repo Link: https://github.com/Pulkit-debug/MLOps_Task2
That's it. We have integrated various technologies mentioned above and automated deployment of the website.