Train the Deep Learning model using Docker Container with automation tool called Jenkins …

Nithish Kumar
3 min readJun 20, 2020

Task statement :
→Create a Image using Dockerfile , and then launch the container using the Image... Whenever u launch the container it will run code of training the model …
→Now the developer change/modify anything in his code, then automatically Jenkins pulls the files from GitHub and run Container .. If accuracy is less than required accuracy then Jenkins retrain the model using the same container … If accuracy is good, Jenkins send a mail to user …

Step 1: Created a Docker image using Dockerfile … Here is the Dockerfile using TensorFlow as a base image …

→ To make an image from Dockerfile .. use Command as “ docker build -t dldocker . “ ← It will create a docker image ….

docker image

Step 2: If the developer modifies the file, then automatically Jenkins triggered itself and download the files into workspace … Do the things for Jenkins job1 …
→ provide github url …
→ give * * * * * to the Poll SCM ,,, So that it checks everytime the github …
→ cp the files to workspace ..

Step 3: Now create a job2 in Jenkins … We need to deploy the code in the docker container using Docker image dldocker:latest ….
→ In build triggers ,

→ And then , In build section , select execute shell ,,

  • cmd “ sudo python3 …….. ” → It will print the accuracy of the model ….
  • cmd “ sudo cp …… ” → It will copy the accuracy.txt from container to
  • jenkins job2 workspace …. Accuracy.txt file is used for email purpose …

→ In post-build Ssection , select Editable Email notification ….. provide ur email details for sending the accuracy to ur mail ..

Step 3: Its time to check the accuracy of our model .. If it is less than 90 , the model again trained by container … For this , we need some code in Build section …

Done with coding part … Lets go for the outputs….
Job1 Console o/p :

job1

Job2 Console o/p : My model has gained the accuracy of 75% …

job2

Job3 Console o/p : Retrain the model for the second time… Got 91% … Model perfectly trained …

Build pipeline for the entire job ….

Done with task part … Thanks for reading ….

Worked along with Vyshnavi Talla … Thank U sister ….

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Nithish Kumar
Nithish Kumar

Written by Nithish Kumar

Aspiring DevOps/Cloud Engineer. #Believe in you.

No responses yet

Write a response