Skip to main content

Testing and Production System environments - Jenkins-Docker

In real-world use cases, it's a standard practice to treat development, test, and production systems differently because they have differing security, data, and privacy controls. No code is deployed directly to be presented before the user, firstly it is tested in a testing environment and if it works fine, only then it is deployed in the production system. 

About the project -

In this project, I have made 2 environments- one for testing and other for the production system. The code is pushed by the Developer to GitHub. The code is pulled into our system by a job of Jenkins and then it is tested in a Docker environment for its efficiency and working. If any changes or updates are needed to be done in the code, we do it in the testing environment. After successful testing, the code is deployed for the user.

Setup -

1) Jenkins
2) GitHub
3) Git Bash
4) REDHAT8 Linux - Docker

Jenkins Jobs -

Job 1 -

The developer pushes the code to GitHub. This job pulls it from there and copies to a Test directory. The branch we are in right now is the Test/Developer branch.

Job 2 -

This job launches a testing environment i.e. a Docker container. If the container is already running, it displayes a message.

Job 3 -

This job is for testing the code by getting the Status code. If the status code is 200, the testing is successful and it can be further deployed to the user. If status code is other than 200, testing has failed and we have to do changes/updates in the code.

Job 4 -

After successful testing, this job merges the Test branch with the Master branch.

Job 5 -

This job pulls and copies the tested code into a directory for deploying.

Job 6 -

This job launches a deploying environment to be presented before the user. If the Docker container environment is already running, it displays a message.

Improvements -

Due to less RAM and Processing, I'm not able to deploy large pieces of code. I'm working to solve this problem.


















Comments

Popular posts from this blog

MLOps - Tweaking Hyperparameters Automatically

  A time consuming task while training the Machine Learning models is to  continuously tweak the Hyper-Parameters  to reach our desired Accuracy. It is one of the reasons why most of the ML related projects fail.  This can be resolved upto an extent with   MLOPs = ML+ DevOps In this blog, I'm explaining my MLOPs project which trains and tweaks a CNN model for Cat and Dog prediction from the dataset. My project uses  "Jenkins"  as an automation-tool and  "GitHub"  where the developer pushes the code. Requirements for setting up the project : 1. Git 2. Jenkins 3. Redhat 8 VM 4. Docker Project : Creating Environments : I've created 3 environments (images) in Docker using Dockerfile for running my programs - 1)  env1  - This environment is for running any basic program which uses numpy and pandas. To run the container of env1 - docker run -it --name con_Basic env1 2)  env2  - This environment is for running Old ML programs which use sklearn. To run the container

SIH 2020 : A kick-start from my not-so techie life

How Smart India Hackathon (SIH) participation has helped me to strengthen my competency and enhance my skill-sets? Hello everyone! In this blog, I'm going to talk about how SIH played an important role in building my passion towards acquiring technical skills. Do read till the end to know about all of my experiences. Do you believe in the concept of “IDEA”? Do you follow the principle of “Smart Work”? Well, my SIH experience directed me towards these!  I’m writing this blog to enlighten these topics and I’ll try to elaborate the importance of the above 2 questions in every engineering student’s life! SIH kick-started my non-technical life to a much focused one.   The concept of “Smart work beats hard work” suits my story! So, I decided to participate in SIH 2020 under the Software Problems domain. This domain asked for a Web app/ Mobile app to be made. I was eager to make a Web app as I knew Web development from basic level. Now a team needed to be made! So I communicated w