Hello guys, My name is Nikhil Gupta and welcome to this video series. Our today’s topic is automation. so today we are going to see what role does automation play in devops okay so before understanding the role of automation we need to understand what is automation? As we all know there are many places where humans have been replaced by robots okay, for example earlier the factories in which laptops or other devices were assembled there 20 to 30 people used to work and in whole day they used to assemble 15 to 20 devices okay ,now those humans have been replaced by robots okay, so these robots are nothing but machines so here in these machines you just have to provide all the materials at one end, where on other end you will find the assembled laptop so in this what happens? You didn’t need human interference so humans were removed from the whole process so this thing has its advantages also like work has become easy and disadvantages also like humans have been removed so we won’t be able to understand if there would be any problem okay. so this was about normal automation which we see.
Now how is this related to our coding? So in coding also there are many things which we repeat again and again okay, for example when you write any code as you save it, you need to build it after building it we need to test it. So if you look at this process from software engineering’s point of view then you will realize that as I save my code after that what I need to do? In software engineering if we are talking about devops then our next process will be building it after that process is completed it will be tested and after being tested that thing will be deployed okay, so as we all know even if I make small change in our code then how big the impact is, now in this process one more thing is noticeable that the whole team of software engineers can be upto 100 if project is large okay.
Now if my project is big and so many people are involved so everyday some or other person might make changes, so as soon as any change occurs then this whole process needs to be done again . now we all know if we make even small change in code we need to build it again because that small change will change the whole file and the whole package okay. so I need to complete the process of building now. If I need to build it again then I need to test it again whether the new package is working properly or not. So in short what is happening due to small change we have to repeat the whole process okay.
So here we are repeating this whole process again and again instead of doing it manually we can automate this process okay, now you can apply this thing at any phase of devops so if you have noticed something in devops that I have to repeat this process again and again and if that process is repeating more than two times you can say more than 1 time also but for now we will keep minimum so if it is repeating than 2 times what will you do? You will automate it so you will give some trigger now here, we need to understand one thing in automation we have triggers, now what do we mean by triggers? You need to do something so that the computer will run it on its own okay. so the trigger can be of 3 to 4 types so the first is the frequency trigger. In frequency trigger what happens is you will give specific time like it should run after every 5 days or after every one hour or after every one year so this will be our frequency trigger which works after specific time.
Next we have an event trigger, event trigger means when something is happening or if a developer has saved his code somewhere then as soon as he saves it here one thing is triggered, which event is triggered? which event? Save event has been triggered so if I make any changes or something then an event is created, event means nothing but if you are performing something and that is affecting your whole source code or software engineering’s any part so that can be called as event okay, so if any one event has been created and because of that you want to call some other thing then that also you can do that trigger is known as event trigger okay.
Now apart from this we have a third trigger known as remote trigger, in remote trigger what happens? Whatever your code is the action in that will be triggered when? When someone remotely press that trigger means you don’t know what its condition is, that condition will be triggered remotely okay, so like this we have three triggers available through that you can trigger automation like when to run which thing okay now why was it needed?
If you automate anything then your code will be fast okay and if any code which I have written or 100 people are working and out of that 100 people 1 person has changed some file now after changing file we need to build it, test it and then deploy it, so if this whole process I divide among many people like one person will write code and then other person will build code and third person will test it, now what happens? If some person changes something in any code then again this whole process needs to be repeated and I need to allot 2 people for that one builder and one tester, so if we have 5 to 10 people and these 10 people are updating code in every 15 minutes then my builder and tester will need to focus completely in every 15 minutes and repeat the same process again and again so in order to avoid it we bring automation in this okay.
How will we bring automation in this, so to bring automation we have trigger available as that person saves the file trigger for build will be activated and that event will be triggered then as build trigger ends which event will start? Testing now this is only possible if your testing process is same means the process which you have to follow is same okay ,now first question here is will it be always same so yes it will be absolutely same, how? Because our task is almost similar and if you have a test in that what you need to test? First you need to test whether the code is running accordingly or not okay.
Now we will see some benefits like what are the benefits of automation? First benefit is that your speed is increased here, if a person has edited something in code then what happens next second person will be build it and third person will test it, so time will be consumed in transferring code from one person to another so if instead that we use trigger then it will increase the speed. Second thing is if the tester is not available or he is on leave okay, then we will not be able to test it at all right ,so during this time also our automation proves helpful means even if a person is not available still the work will not stop okay, so this is benefit of automation, as humans require break but on other hand machines never demands for holiday, humans need good salary whereas machines will never demand for salary it just needs good electricity supply.
Humans need lunch break, even machines need break no doubt but it will be for short period just for cooling down and if you keep it somewhere cool then it will consume much less time, so you can see machines work fast and efficiently and it is not demanding for salary or break and the work is also dedicated, if allot some human then he will chat with others means he will do other things also apart from his work but machines will give their all efforts in working okay, so these were benefits of automation.
Now we will see its disadvantages. so first disadvantage is 1 machine is working equal to 30 people okay .so here those 30 people will be unemployed so these unemployed people will not be able to find job anywhere easily because if their job includes repeating again and again then it will be replaced by machines, so these things are difficult for humans and unemployment is increasing so now is this thing applicable for programmer, means if we are in IT field so is it applicable for us? Can our work be taken over by automation? So, yes this is possible so in today’s date we have an AI available and its name is GPT, you can search it on internet also, so this AI is proven and tested and it is created in such way if you type that in notepad that ,you want an app in which if you write hi then it will send that hi to other person means it can send your message to other person and the other person can also reply to us, so if you even write this much then whole application will be generated and give to you okay. So this GPT3 system is that advanced that if you just write your requirement in notepad as in what you want it will give you the same application as per your requirement. So this machine can create applications and can code so this GPT 3 writes the entire code manually on its own and it takes hardly 5 to 10 minutes for coding for advanced applications which if we try to make then we will need a minimum 15 days.
So you can imagine if you want to create a messaging app then you will require minimum 15 days because we need to create front end, back end and then we need to store those messages somewhere so lot of time will be consumed in this whereas on other hand if you use machine it will be done even before you are done with your lunch, so application is getting ready so quickly so here one question arises if we have GPT3 then why do programmers are still hired for these tasks? so the reason behind it is there is not much awareness about GPT3 okay and second thing is our client’s demand is never static they can change it anytime today they will ask for something and tomorrow they will ask for something else, so as people changes their demand you need to change code and even in today’s date there is no such application which can satisfy someone’s demand 100 percent it means the applications which are creating nowadays if we see according to that then almost it will take minimum of 10 years for GPT 3 to become that perfect that it can make such perfect applications through our demands okay.
So even if that is accomplished then you will need at least such programmer who can write code for AI, means AI will write code for everything else but we will need someone to write AI’s code so if we see programmer’s field is secured as compared to others but yes everywhere robots, machines and AI are replacing humans in every field and every job okay.
So we will go back to our main topic that is use of automation in devops . so as we saw the most common thing is, if anything is repeating in devops then we can automate that thing and if we see it in detail then if you are changing anything in code then you need to build it, now what happens in building is if we have 15 people then out of those 15 people if 1 person changed something or two people changed something then our code in which one person is changing something and then uploading it then our automation will ask other 15 people also whether they have any changes, if yes then upload it okay, so it will gather all the code and then build it and after building it will inform us if there is any error so it will inform developer that your code is successfully running and if some error is occurring then it will send back and when it is built successfully after that it will go in testing phase, now what happens in testing phase? We have four types of testing as we discussed in the last point. first is you have to check whether you program is working or not means if I am expecting it to work as calculator then it should at least add, subtract, divide and multiply okay, so in calculator you will check whether it is performing all mathematical actions or not after that you will check for edge cases in that, edge cases means divide by 0 so that is an edge case right because we cannot divide by 0 so in such cases it will check how it is handling edge cases okay.
Next we check for malicious code so we can automate that also as we know if vulnerability is there then its whole list is available on internet like we have these many vulnerability and for that the tool which we have is OWASP that is open source through that we can test the whole application like whether it has any vulnerability and it is fully automated means you don’t need to run any test manually so if you just run tool then it will be done automatically you just have to connect it with event means as soon as my code will be built its testing should start okay.
So after testing is done, next comes deployment .so yes we can automate deployment also, what we have to do is the code which I have on my computer after building so we want to deploy that code so deploying it means we have to send it to client or online, now for sending it to client we have different tools available for automation, so after deployment we have release so in release also we can add this thing okay and same thing can be done for monitoring also.
Now how can we add automation in monitoring. so normally when we monitor we cannot focus on client completely means you cannot give all the time to customer for monitoring, so in that you add automation in which if any event is triggered like, if any application crashes in his mobile then in automation you can feed as soon as the application crashes log should be sent to us okay or if there is any other problem in application then keep a trigger so as soon as that event is triggered its log should be sent to you so that you can check it okay . so this was all about automation of devops.
Now what tools do we have for that so for automation in devops the tools available are as I said they are different parts so the first part is our integration, for integration if we need to automate then the tool available to us is Jenkins okay ,so it automates integration, second tool if I want to automate testing then I have two tools one is selenium which is sued for both mobile app and web app, it is mostly used for web app or for windows app or we can say desktop app and second is appium so this appium is mostly for mobile and mobile web . Mobile web means responsive which can be seen on mobile also and computer also so for that appium is used okay.
We have one more tool and its name is ansible, so this tool belongs to redhat and it is used to manage infrastructure means if you want to deploy something or if you want to close any service and then restart it like if your code is building or for sometime you want to do something on triggering event so for that you can use ansible, this tool is made for automation only okay.
If you have any comments or questions regarding this course then click on the discussion button given below this video and post it there, and you will be able to discuss the course with learners.
Jay prashant kakade
Its a great platform to learn if u a student instead of putting your time n money out in classes n all get the knowledge as much as you can