Code Monkey home page Code Monkey logo

task3_0's Introduction

ml+dev

๐Ÿณ ๐Ÿณ ๐Ÿณ ๐Ÿณ ๐Ÿณ ๐Ÿณ

:bowtie: In Machine Learning need to change the model several times to find the best accuracy model manually. So this required lots of efforts and time for making a machine learning model precisely. so there's is obvious need to automate all this process of tweaking the code and retesting until the model gives a good level of accuracy .So here comes the role of Devops , Using Devops we can automate all these so it will save a lot of time and the developer can work on other project with a free mind.

๐Ÿ™ I am using jenkins for automation,github for deployment our code,and docker image for trainig our model.

Before going to problem statement i need Docker image for trainig my model . this image depend on our model. In the my case i train a deep learning model so i need my image contain some deep learing modules. so i create Dockerfile for creating my custom image.Here i am creating 6 jobs for automation and for visual i use build pipeline plugin

๐ŸŒ Docker file

DOCKERFILE

โ„๏ธ PROBLEM STATEMENT :

๐Ÿผ JOB 1 : Pull the Github repo automatically when some developers push repo to Github

๐Ÿ’พ Job2 : By looking at the code or program file, Jenkins should automatically start the respective machine learning software installed interpreter install image container to deploy code and start training( eg. If code uses CNN, then Jenkins should start the container that has already installed all the softwares required for the cnn processing).

๐Ÿป Job3 : Train your model and predict accuracy or metrics.

๐Ÿฌ Job4 : if metrics accuracy is less than 80% , then tweak the machine learning model architecture.

๐Ÿง Job5 : Retrain the model or notify that the best model is being created

๐ŸŒž Job6 : Create One extra job job6 for monitor : If container where app is running. fails due to any reason then this job should automatically start the container again from where the last trained model left

๐Ÿ”ฅ EXPLANATION

:trollface: JOB 1:-

๐Ÿ‘€ Created a job named job1 for retrive the data from github ,the developer when commits it pushes to github automatically using git post-commit hook and github webhook triggered job job1 is pull the data from the github and store in the task3 directory. in case directory alredy created then rm the directory and make new directory and store the github data.

๐Ÿ Pull the data from github repo.

job

๐Ÿ‹ Copy github pull data in local task3 directory

job

๐Ÿข After running job1

job

๐Ÿ’Ž JOB 2:-

I creat a job2. this job2 trigger when job1 succesfully run. in this job check the python code according to our code create a container let suppose in the my code i use keras module so keras use for deep learning model training . so i use grep command for grep keras if keras is grep then it give the exit code 0 so it mean in the our code we use keras . it run the deep learning container . here we use two condition when if the keras is grep then run the deep learning container else run the machine learing container but here i use same image for machine learning and deep learning model both. i mount the local directory with my docker container.so here i mount my task3 directory with my docker container /home directory for accessing the data.

๐ŸŽง Trigger when job1 succesfully run

job2

๐ŸŒˆ For creating a container i use below script

job2

:shipit: After succesfully run the job2

job2

๐Ÿ’ฅ JOB 3:-

๐Ÿ‘‰ I creat a job3 for training my model and this job3 run after job2 successfully run the container.so here i run my python model.py file in this file train the model and if the model accurcy is greater then 80% then it is save the accurcy and the trigger the job5. job5 is send the message with model accurcy to developer . so here Job5 trigger bcz here i use Triggers build remotely so in model.py i use curl cammand for tigger job5 and job4. but in the case my model got less the 80% accurcy then job4 is trigger it tweak the machine learning model. and train the model. here also save my model for train model and in case my model.py file not get 80% then i use full in job4.

๐Ÿ”ฅ Trigger after job2 run succesfully

job3

โ›„ Run succesfully job3

job3

๐Ÿ JOB 4:-

๐Ÿ’ป I creare Job4 for in the case our model.py file model not got 80% accurccy then job4 is trigger and it run the vpp.py file.after model.py successfully run then it save the model. So in the vpp.py i use save model. here i use pre train model .so here i use transfer learning. bcz in real world traing a model required lots of time and resoucres. so we use pre train model technique. but when use same model the every layers always unique name so here i use count variable and give the unique name also save the count variable value it helpful in the job6. so when i run the vpp.py file some time i lose my accurcy it means every time pre train model not helpful so always efforts on our main model. so when our vpp.py get 80% accurcy then job5 is triggers.

๐Ÿ’พ Trigger when the job3 not get 80% accucrcy

job4

๐Ÿ“ง JOB 5:-

I create job5 when we got the 80% accurcy then job5 run the mail.py and send the email to the developer that you got best accucry and % of accurcy. and job5 trigger when my JOB3(model.py) or JOB4(vpp.py) get 80% accurcy.

Trigger when the job3 or job4 get 80% acc.

job5

Email

job5

:octocat: JOB :-

I create job6. it is trigger when the job2 , job3 , or job4 are failed. first of all job6 check the our code type like CNN or simple ML code . then if the check the container runing or not in case container is stop then start the container or if the container is not running then run new container and check if the model is already save then run the vpp.py otherwise run the model.py file. So i saved a file this contain count value bcz when job6 is run the vpp.py then in case job4 are runing save the model but due to any reason job4 is failed so when job6 is trigger then it need every layers name unique otherwise give the error so i save the count value so job6 is trigger then that use uniqe value that is not use in job4 model runing time.

๐Ÿ“Œ trigger when the job2,job3,job4 is faild

job6

๐Ÿ› Running the below script

job6

๐Ÿ˜Ž Visual of our automation using build pipeline plugin

build pipeline

task3_0's People

Contributors

vishnupal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.