You You You You You You You hear me I Was checking just audio checking audio checking video checking if I can project my desktop and you can see it properly Should be okay should not be having any issues today the other day this laptop was not behaving properly I Think I fixed it. I think it was not a machine problem. Not an update problem, but a user problem like most problems are typically user problems I was messing around and I Did something that I shouldn't have And so my laptop was not responding properly and as a result I had to use the other machine so let's let's resume what we were doing the last time with a recap what We're trying to do at the last time. Let's see who's here Tina and Kenny just two of us. I mean the three of us. That's it Is people are busy, but we'll continue they'll watch recordings. So as you know, we are discussing git Git is a version control system It is also the popular one the one of the most popular ones even Windows uses it to manage Windows source code Windows is gigantic source code really big as big as Linux Probably Linux is maybe a little bit bigger because it's a lot more contribution from a lot more number of people and You know Yeah, so we forget about the size both are good products both use git and that's what we want to understand What is it? So basically if you look at what git is from a pure simple person on the street perspective Git will do something that is you are very very very familiar with You open a Word document and you start writing And then you want to retain its revisions. So you enable what is called review and track changes and so you enable that And now You make a change It will look different. You go back here and delete this letter f And s so I strike it and it keeps track of whatever changes I made That is exactly how git functions now. This is what is happening inside a document You will see that git can handle more complex things like this in a folder From a practical usage perspective. That is what we are really talking about. I am making changes and I can even share this with you Through some other methods like there are methods of sharing like here click to share And I can share it with with you guys on OneDrive and you need to log on to OneDrive and then you can access it And you can also collaboratively edit You can collaboratively edit this document. Do you know this? I don't need to show how to do it. So you already know But that is what is going on in git practically speaking It is controlling versions controlling revisions version control. That's what's going on inside a folder A folder meaning a directory, you know, like we created a folder called alphabets And inside our goal was to construct and fill it up with the 26 files The file names should be A B C like that all the way through Z and we will divide this work and we will do this creation of this folder called alphabets Alphabets or alphabet. What did I choose? Alphabet. So no S there I chose this folder name and we will create this folder collaboratively. We will also divide the work among us So we'll do some part you and some part me and some part like the other people. So we'll divide it and we have to do this collaboratively I think that's the most important part of Understanding collaboratively editing contents of a folder This is what is known as a repository as you know already and on the Concept of sharing, you know, like I shared this earlier On the concept of sharing, you know, like I shared this repository with you concept. You can share it with multiple methods using multiple methods. One of the methods that I will use today is GitHub GitHub will give us a placeholder right now a placeholder where I can put this repository like Like that In the placeholder. So basically that place is already created. I did that the other day. I use GitHub To create this placeholder and I can give access to other people and I will give access to you But for right now, let's stay focused on a linear path to completing the exercise first. So we'll do this collaboratively and See how we go about understanding it the concept itself So I talked about a couple of things I talked about a placeholder I talked about the repository, which is actually a folder And in that folder I initiated my my computer And I have to somehow create or initialize a repository here And then that's the first action. The second action I need to do is make some, you know, changes some edits Changes edits creation delete and modification anything I do edits I will need to do those changes in the folder and then I add those changes Add the changes I make and then fourth one is I make a commit Of these changes what I added. So this step third step number three puts items in the staging area Step number three puts items in the staging area And then this step puts items inside the commit itself. This commit is known by a hash As we will see that hash soon. So let's do that exercise of these four steps very very quickly in a folder in my computer Like right here This is the folder on the left hand side you see that there is this Alphabet folder and on the right hand side you see that the same folder opening command line where I see the items and there you see this git folder is a indication of the fact that This folder was created and is now under the control of git software And that is what I will be looking at as to what this software is doing or git software is doing for us in that folder to To manage the and I'm going to new use a new word now The manage this state or rather I should type it properly manage the state Of the folder It's like the state of the union state of the folder. I want to manage the state of the folder that I'm dealing with like this folder. I'm talking about This one in my computer and I want to very carefully manage the state of that folder. That's the primary goal of this using it Software is to allow us to manage our state of the folder. Like what are we doing with it? What changes are happening? What changes are happening? What changes are in a staging area? Are we committing those changes or are we not committing those changes? That's the kind of control we would like to make on the state of the folder And that's what git software will help us do that and you will see how these things happen in action before I Connect the two this placeholder And the repository itself. I will make establish a connection between my my computer and this folder And the placeholder on github and then I'll hand off a link to you The link is already available to you in slack chat right like right there, but that link is not active yet It is just a placeholder position that I created in github So that is available, but this linkage is not established yet. I will establish that link soon Now let's go back to the folder itself You see these six items you saw me delete the other day. I'll just read them again Or rather I'll for the sake of you know clear clarity of understanding I'll just do this exercise all over again simply. I'll just remove the entire folder Alphabet folder is gone So it's completely gone and now I will create a new folder called Say alphabet and I'm beginning from fresh alphabet beginning from scratch I'm going into that folder and there I create a bunch of files Like that and you can see these files in the atom editor like right here Okay, hold on hold on atom, please open atom open please And there you see them you see these files a b c d e f created because I created them so they show up And that's what I do now. I will initialize the action rather. I should say I will initialize git repository I'll do these four things one, two, three, four. That's what I will do now And so I will do them one at a time. First one is to let this Folder be in control of git software for which I have to initialize So I'll say git Status and it will tell me that it is not a git repository, which is correct. It is not yet So I will initialize git repository. I just did Next what I will do is look at the git status again and this time it will say that there is nothing in the folder in the repository There is nothing on the master branch. No commits yet. There are some files that are Sitting in there. They're not tracked by git software yet Because we haven't made a add commit add statement or a commit action. So these two actions number three and four Are not yet done Item number two. I did I did that here. I make some changes I create these files. So these are not tracked yet You have to start tracking the changes in these files by putting them on a staging area like here and so you can do that by adding To the stage. So I can say that, you know, I want to Ask git to add These files Only I leave the F1 behind and not adding the F file yet So now you see the status You can see that it added and started tracking changes to the files ABCDE but not to F yet because I did not add it To the stage quite yet. So it is now keeping track of what changes I will be making in ABCDE but not F But I want to keep track of F also So I will do that. What I will do is git I'd say git add F and now if I check git status You should see it that it is actually keeping track of all these files You can as a logical action changes to be committed You can commit them or you can just say that I don't want to have these changes Committed in that case, you don't commit those changes But I want to so I will commit these six files into the git commit hash You can see as a consequence that A git commit and I have to pass a message to my team members you that I am Let me just do not disturb this What I will do is git commit and I will add a commit to To commit message to let you know that I added Six files and then I Make a commit when I make that commit. I see that it has given me a hash This hash is basically a way to reference a commit that I made And you can see that I can now see the git log and you see that there is one entry Indicating the same hash saying that nilesh added six files You can see that already now having done this part We can now check git status and you can see that there is nothing that is showing up on the branch Nothing to commit because the working directory is clean Clean means it is synchronized between the folder and git and there is no other Difference between what git knows about the folder and what the folder actually contains See I said these two things are the differences See what git things you have and versus what you actually have there can be a difference And I will soon introduce the difference but right now you see that You know, I make it initialize. There's like a one-time operation I make a change then I add and commit and then I make another change So step number five make another change If I make a change right now Whatever git things it knows has in the folder is different from what it will be in the folder For example, I will now go to that folder and say that I want to make a change Like create another file x And I just did that now the state of the folder is different from what git thinks it is So if you check the status You will find that this untracked file exists that git is not tracked It is called x and I just created that as a subsequent change Now if I want to keep track of that change, I can I can add it And then commit it and that's okay But right now the difference is that you know what git thinks Is it is controlling in the folder is different from what the actual folder contains So now if I in that folder if I list out all the files I have And I remove the file a for example if you check this git status You will find that it is telling you that changes not staged for commit You made a change you deleted the file a and it is not yet in the staging area The deletion is not in the staging area And there is this untracked file left over. I don't know what to do with it Do you want to add it or not? That's the thing that git is not clear about So it is telling you that you know there is this untracked file So do something about it either you add it or you don't add it So that's the next action is to add or not add and then make a commit And when you make a commit you get another hash Whatever changes you make you get another hash And basically that hash is a unique way to reference the state of the union In that point in time So if I could you know potentially delete this deleted a I can say that No, no, I really did not want to delete So I can either create that whole create that file again like creating it again And then say you know git status And it knows that git a is back so the only difference it notices is that There's untracked file called x which needs to be deleted because I'm not supposed to be creating that But maybe I did and maybe it's a valid file for the teams You know for the teams project that we have is to create a folder containing all these files a through z And so x is a valid file that needs to be included So I want to actually add it. I'm just doing somebody else's work, but that's okay So I'm saying git add x and now if you check the git status You will find that it knows that if there is a change that needs to be committed and that changes to you know add this new file So I need to make a commitment now git commit and I'll say a message and I'll say git commit Added x and then I make that commit now you will see that there is a new hash This new hash is different from the previous hash. You can see that git log shows you these two hashes These two hashes are the first one when I add Six files and then a more recent one is this hash when I add x So these two changes I made and I made and added and I committed so now my git repository is starting to build Now what you look at in this picture or rather what the picture I will draw is this idea which is You know these hashes that I mentioned these hashes are unique way to identify the state of a folder at that point in time at which the commit was made Now if you look at this this hash or rather the picture I'm drawing right now. I began with nothing and then I started Added six files and then I made a commit. This is a hash Then I go further and add one more file X and I made a commit. This is another hash So these hashes is what you can use to refer to the state of a folder Any point in time you can go back to this state if you like And if you go back to that state, what will happen is you will see six files and not x So let's go do experiment with that idea. We'll go back here and also put this atom editor on the side and here you will see That if I list my files, I see A, B, C, D, E, F and X If I want to go back to this hash which is containing only the first six files What I will do is I'll say git checkout and then I give it the hash number And that happens when I give that hash ID It will check out that particular state of the folder like that And now if you see on the left side, X is gone Like there. So X is basically gone. Git knows about it, but the folder doesn't have it Git knows because you can always get back to that other hash. You know this hash is there It did not disappear. You see git log still has it It's not showing you in the log, but in the tree you have the whole instance of every single commit ever made So if you want to go back to point in time like this point in time You can by just checking out that hash. You can just say git checkout And then you get to a point where it was including the file X That is also available to us now That's how you are able to traverse on what is called There is a name for it. The name is directed graph You are able to traverse through the directed graph. Essentially it is a bidirectional graph of hashes So if you draw a graph in mathematical graph theory It can look like various nodes connected in an arbitrary fashion And you can pretty much go from one node to another in any direction as you like As long as there is a connection You can even randomly jump from here to here Even if there is no connection as long as you know the hash This hash has to be known Which is known by the fact that you have kept a commit And so this is the idea underneath The concept of git is the idea of a directed graph And this is not what you think of a graph paper graph but more of a concept I think you should read this to understand what graph or directed graphs are in math If you are not familiar with high or other graph theory math You should read that, this particular article It will give you a good idea about what graphs are and what does it mean And all the concepts regarding mathematics behind it However, this can be too mathematical So I will give you a simpler version of the same thing But again, just watch this video I will give you a link later on, you can watch it Git for 4 years old and up That's the video So it is designed for people who are ages 4 and up So that means if you are younger If you are younger than 4 years old, please do not watch That's what I want to say That was a joke Let me grab that link for you And I will paste that link for you in Slack chat And this is the video I would like you to watch This is designed for a very very good, beautiful understanding of what git is And you should absolutely watch it It's a very good video created I think couple of years ago And the person who does demonstrate the concept of git He does that by using Tinker Toys Which are these toys, you know them probably These Tinker Toys are used I think you may have seen this already I did not grow up in this country So I was not super familiar with this the first time I saw But if you go to Tinker toy images search You should find a bunch of images that will look very familiar to you At least for people with kids Or maybe you have played with these when you were growing up So these things You see the structure is very very similar These round things that you have here are the commit hashes And the links are showing you the ability to traverse as to how that node was created In terms of generation of a node or a commit hash As a consequence of building something Like you create something in a folder And you are dealing with state of the folder As demonstrated by this illustration of this Tinker toy That's the concept of how you should think about When you think about git It's graph theory basically But we'll use this graph theory again in another context At least the concept we'll use it again in another context when we are discussing Docker Docker is also very very similar structure But for right now let's focus on the git exercise So we have created up until now Only two Tinker Toys Or two hashes I should say And what I want to do now is in this In this directed graph that I am starting to build It knows the state of the folder In those two different points in time When I made a commit And what I want to do now is my repository I want to make a connection with git hub And that connection I can make with a placeholder I have Placeholder I will make that connection And so this connection is called a remote This remote connection you can establish And for that there is a command right here You can check the Where are we You can check git remote-v And it will tell you there is no remote connection Like the answer was empty And that is what I want to fill it up with a remote connection So I will now go to git hub And find out from them What are the instructions about how do you Connect git hub repository on the placeholder They call it a repository When we start to create this thing But essentially this is You know a placeholder It's not a repository yet We will make it a repository by sending our stuff to it Then it will become a repository So we have an existing repository which we created So we want to push an existing repository from the command line That's exactly what I want to do So what I will do now is take this first command And look at that very carefully What it does is adds a remote To the git location And calls it origin That's the name that it's actually not the origin Because it is not where it was created So maybe origin is not the right name for it It doesn't matter we can choose whatever name you like Just remember what you chose And if you now take this to editor And just make that entry right there And see what we are really dealing with You will find that This is the entry that I want to actually type in my In my terminal to make a remote connection Between what I have And what git hub is providing as a placeholder So that's the placeholder And they have suggested this name origin Which is like a reference to the git hub location You can call it whatever you like It really doesn't matter But I'm just going with their name And so that's the name reference to the placeholder And you want to add a remote connection That's what I want to do now So I'll grab this link This entire command And first of all check that remote connection one more time So git remote I have nothing expected And now what I will do is Establish that remote connection between this folder And the git hub location like that Now that my folder is connected to my git repository I can now check my remote connections again And I see that I have these two references To the thing known as origin Which is what they chose Which is what we kept Which we cannot modify And that reference to origin is actually these two links One of them is this link Which is useful for fetching Like bringing the changes to my local computer And the second is for pushing Which is the same link again But used for pushing So I can use the fetch and the push actions On that origin location Which happens to be this reference on git hub website So now I'm in a position To send my changes Whatever I have in my repository I have these two commit hashes This is my repository This is how it looks like right now And I want to push it Push it to this placeholder That's what I will do now So I'll say git push Pretty much like this Git push My master branch Rather the only branch I have So the only branch I have is this one branch And so that's the branch in my tree And I want to push it So I'll basically go and say push And so it pushes And then we are done Practically At least I am done Now it's your turn So I have this exercise that I started And that exercise is now available in this location You go there and you will find it Those seven items with six files are added And one I added extra The X file Those are now available You see I just pushed Right now However The last commit was made 13 minutes ago And so the first commit was made 17 minutes ago As you know that That is already tracked You can see this repository Now shows you a commit history The commit history is pretty much what I did They added six files This is the first commit entry that I made When I added files A, B, C, D, E, F And then about 13 minutes ago I added one more file called X That change history is available to you Now you can pretty much go right there And make use of this repository To finish off the project that we have assigned to ourselves as a team So if you remember and recall the last time we were discussing Our goal was in this particular exercise Was to fill up this particular folder That I'm talking about With files A, B, C Like that all the way through Z And we want to divide the work I have already divided my work in this part I have done the part of creating files A, B, C, D, E, F Now what I would like to say is G, H, I, J, K These five files let's assign to the people are available right now So let's say Gustavo gets it And so Gustavo will take and create these five files Then we have the next person Kenny So Kenny takes L, M, N, O, P And the next person is Sridhar So Q, R, S, T, U And that is Sridhar And the last person we have available is Tina So she will take V, W, Y, and Z Because X I already did And so you don't need to do that That Z is double So this is Tina This is the work that I am basically assigning arbitrarily as a team leader And what I am suggesting is that you please create these files Like W, V, W, Y, Z and these files assigned to you And you should be able to do that very, very effortlessly Without using the command line Just using this web browser And go into that link And I'll tell you how to do it Now the concept you want to make sure that you can is to First thing, login to GitHub And then fork this entire structure That's how you should begin So if you fork it It will let you create a replica of the entire repository in your control You will see your name pop up in this place of the cloud genius name And once you have that You should be able to just create a new file like that And give it a file name like say G And then go down and say make a commit message I add G Like that And then commit Once you make a commit In your local area you will have a file called G After that you should send me what is known as a pull request That's the idea I will now describe So the action is actually very easy It's just a matter of a few clicks and a few buttons To type these letters to have you proceed the work that you want to do And the actual action is very, very trivially simple But the concept behind it is what I want to focus on is the idea of pull request A pull request as it reads the word itself is a request For me to pull So you have to initiate a request asking me to please pull Remember I pushed And so I send my repository to the placeholder location that you now have access to And so what you will do is in my placeholder that I have Let's call it the alphabet location Or rather to be more specific The cloud genius slash alphabet location That's the placeholder that I was working with And so what I would like you to do is to fork it And when you fork it you will have you at alphabet Another different location created And here you will find the same thing that I gave you What you will do now is to add your changes Like that And make a commit and it will be in this location And what you now have to do is that you changes you made The other changes that you made And so you have to now originate a request asking me To pull your changes So this is the change you made And so this is what you want me to Please pull That is the request that you have to make Otherwise I have no idea that you want me to pull And so you need to create that request and send it to me For which there is a button that will pop up saying send a pull request And so then in that case you will send a PR Which is basically asking me to please pull your changes that you make And when I look at that request from you Which will also pop up in my browser like right here You will see a pull request coming up And that is what I will now examine And see if it meets the requirements of the project that we are dealing with And if so we will discuss in the team And then decide whether or not to accept that particular pull request And that is how we will proceed So I am suggesting now that you please login to github Then click on that link like right here This link here the cloud genius alphabet link Which will take you right to this page And there I would like you to fork it Apparently you have forked it already Tina forked it, Win, Kenny forked it And apparently you guys have done some creations already Lots of that You are doing it right now, I can see it That's good So now once you are done with your changes You want to now commit it locally Like right here within your fork Not mine, this is my area And so you want to fork it which you did And you want to make these changes right here In your fork of the repository After you are done and you are happy with the changes you make You want to then create a pull request This pull request will be a notification to me I can go and actually see what you have So that's not a big issue but the proper way to do that is to actually create a pull request Which I will now look for from you And so this is, I think, Sridhar is doing it He looked at, Sridhar has this alphabet He's forked it and he has done his work Apparently QRSU Those files are created by Sridhar Let's see what other people have done I can see who have forked it Let's see, there are four people who have forked And that are all of you basically Jerseyboy Gustav Jerseyboy has also started working He's doing, what is he doing? What is Jerseyboy doing? Hello Jerseyboy Jerseyboy is at a G Oh, thank you, Jerseyboy Right there, so apparently a G added And yeah, send me a pull request I'm waiting for it, there it comes So there are pull requests now So Nilesh, do we create a new branch? No need to, no need to yet We'll talk about branching soon but not right now So no need to create a branch We just forked the whole thing, right? You forked the entire project It's not a branch but the whole thing available to you We'll copy to you And so that's what you did You'll talk about branches later on Just a little bit after we get through the concepts Of understanding the basic motions of what's going on in collaborative setup So we have two pull requests popping up Let's go do a team review with all of us Like you and I and all together And we'll review these requests The first one created by Mr. Kenny And he has created a pull request Let's go read it He says pull request for LMNOP Okay, let's go match it with the actual task LMNOP right there That looks like exactly what Kenny was supposed to be doing And so you go back here This is like a formal review you want to do, right? So a team member is contributing something You look at the files that he has provided And you see them and you look happy about that So you review the changes And you can leave a comment that yeah, this is looking good So you can say looks good Rather looks good Or something like that Make a comment, submit for review You don't have to do this by the way This review is like a basic step But this change looks good to me I'm showing it to you I think you would agree So with that agreement what I will do now Is that I will merge this pull request So when I merge it Then becomes a part of my repository also So I'll say merge pull request And I confirm it So when I confirm it You see that my alphabet folder now contains LMNOP These are created by Kenny You can see that these 8 commits that he made Are showing up created by WinKW WinKW like that These changes WinKW made And they are now showing up in the tree In the directed graph that we are collaboratively building In the Git repository that we are building We'll see other pull requests also Coming right there There is a pull request here from Tina So let's go see what Tina did So Tina has created 4 files VWYZ Which is I think exactly in line with what Tina was supposed to do Right there And so that looks very very decent We'll go look at the files We'll look at the conversation Maybe and decide that this is something to There is nothing to see here Absolutely Like a silly project So we can merge pull request also And so we confirm that And now I merged Tina's request We'll go look at the other 2 very quickly Added file G from Gustavo Jerseyboy And so here there are 3 files actually GHI And let's go see what changes Gustavo was supposed to be doing GHI JK So I think Gustavo is still working on the other 2 But we now have a pull request from GHI So we'll take that We'll accept as is partial work And we'll take that And we'll say that we can actually Take this pull request and merge it So I confirm the merge and I added the changes So now my alphabet project is growing Our alphabet project is collaboratively growing Because everybody is making contributions We have one more pull request to look at That is this one from Sridhar And so we see that Sridhar has created QRSUT And so let's go compare it QRSTU The same thing that Sridhar was supposed to be doing And so we got that picked up We will basically read the comments And then merge that pull request And one very important thing that I forgot to do Is don't forget that Is in real life You should not forget And I'll tell you what mistake I made The most important thing in collaboration Is to properly thank people That are making contributions So you should come back here and say Thank you, Sridhar That is one of the most important things you should do If you don't do that, it's not a good idea Comment So send a thank you note back to Sridhar For making that contribution If you don't do that Collaboration in the long term will fail Not for technical reasons, for people reasons So that's why it's important to thank everybody For their contribution It fails bad if you don't actually contribute And return thanks So I will make sure that I do it Just to drive the point Thank Gustavo Jerseyboy Comment And pull request For the third one Thank you, Tina Right there This is, I think, a cosmetic point that I'm just doing But I'm trying to drive the concept That it's about the team Not about the tool The tool is what it is But team is actually what is working a project So you should make sure that you thank everybody That's what I would say All he does is win, win, win I should say Kenny is his name, not just win So thanks, Kenny Right there So now what we did is let's see if our project is kind of complete Are we complete? Gustavo, Kenny, Sridhar, and Tina They did the work So we should have 26 files Do we have 26 files? Let's go check You can count them But that's kind of boring So what I will do is I'll synchronize the repository that I have With my laptop So you know I have this folder where I am Connecting the remote placeholder with the repository in a folder that I have locally What I will do is go back to my terminal And there I see git status And what do I see? I see that working directory is clean I say git log And what do I see? I see that there are only these two things that I know of It's added six files by Nilesh And then there's this hash in which I added x I still don't have those changes So if I now list out all the files I have I still have a, b, c, d, e, f, x Only those seven files That is not what I expected All this work we did But you know what? All that work is actually sitting in GitHub So you have here the GitHub location The placeholder location And so you have your own Git Hubs Or rather copies of forks Of fork You have a fork of the same repository also And you did work here, here, and here, and here And what we did was that you send me a pull request So I requested you to send me a pull request that you sent And then I reviewed these changes with you So now I accepted all these requests So now this is the repository Where I have apparently all the work Now my laptop is here I need to have a way to bring those changes down to my laptop So this is a pull action I need to run a pull action on my terminal in the computer On the laptop to bring down the changes that all of you did together And they will come once I run the pull step So pulling is very, very easy I'll have to say git pull And then it is, there it is So now I have Apparently Okay, you're not on a branch So I'll say git reset I think I was toying around with my branching structure I was jumping around between my commit hashes So I'll just say git reset Or I can say git checkout Master to go back to the top of the branch And now I should be able to pull git pull Rather tight properly like that And there I have the files now showing up I can see the files And I can also see git log And you will see the git log shows you exactly the history of the entire Directed graph that we collaboratively created It began with me Here And then I added six files Then I have these other people in the team started doing the same thing You can see them You can see the timeline that they have done it Like that And you can see that changes are happening and you know We're creating And then at some point I merge a pull request From Kenny Then I see that Gustavo further creates Other files And I merge them Also from Tina and from Gustavo again Gustavo actually added one file but it was merged at this point in time Merging happens at this point And then the last merge was from Sridhar Merge number four And now we have a log showing entire history We can check this point in time This one And see that all work after that Will be missing if I check out that particular hash So if I For example if I check out this hash In which we see that Sridhar created you So I can grab that ID And And then say git checkout that ID Sorry Not thank you Sridhar But This ID This one So copy that ID and then If I see my list of files It contains only up to that point in time Like created you S R Q Z Y Where is ZY? It's not merged yet So that's the reason why you don't see them Let me show you the Tinkertoy illustration of the same thing Let me bring it up from a picture perspective Let's see if I can pull it up So I'll show you the Tinkertoy that I was talking about before And here it is If you look at this picture as you see on the sections here The dots, the Tinkertoy dots Or rather what I call These circular dots that I'm pointing at This is the graphical representation of the directed graph As you can see in this software This software is by the way free software It's not open source But it is free You should be able to get it at SourceTreeApp Is it SourceTreeApp? Yeah So I will grab that link And paste it for you And a similar app is available from GitHub For desktop You should be able to use that one also Both are free This is the other app Called GitHub for desktop Both are useful, both are free But both are fortunately not open source If you want to get open source versions You should get GitK And GitK is open source But it's available for Linux only I think So this is the GitK browser Git browser You can grab that from here I don't know if it is available on Windows or Mac But it's useful To be able to visually see what you're talking about From a directed graph perspective And you can see that I currently have checked out This is where my head is Now what is a head? That's a new idea So I would like to discuss that head idea So a head is basically like A turntable head You know this thing? Go back Images You know this thing called turntable And you have this thing called a head That's what I'm talking about Literally that's exactly what I'm talking about Is you can take this head and lift it And move it a little bit closer to the center A little bit away from the center And that decides where exactly your current head is positioned With that idea Is what I would like to now Take that to this picture And here you can actually move this head To any location you want As long as it is within the graph What does that mean? What does that do for us? Why does it matter to move the head around in a graph? So that's what I would like to now show you Compare this representation Of where the current head is Versus what you see on the left side In Atom In Atom I have C, A, B, C, D all the way But not all the files All the files will show up when I take my head To the master So I will have to check out the master location And then my head moves To the master And when I do that You can see that all these files show up They are there You can see them You can also visually see these files In a folder if you like But that's besides the... You can see it in Atom These files exist and they show up You can also traverse the graph By pretty much taking your head And putting it right at the beginning Like right there Double click And it says confirm Change working copy Are you sure you want to go to that point in time Added six files And I say yes please And so now you see It went back straight to the point when I first started With only six files Even X is missing And that is visible from the left side In Atom You can potentially see that The Atom editor shows you X is missing Every other thing is missing apart from A, B, C, D, E, F Those things are gone Now If I take my head From the bottom The lowest position And put it right there And check out this particular commit hash By the way each of these circles Or little dots are a commit hash The colors corresponding to the person That is dealing with it Like probably this person is I think it's Kenny This purple person Is Kenny The green person is Sridhar maybe I don't know who's Maybe Tina So Depending on the person who's making contribution This software will dynamically pick a different color to show The directed graph as to how it is structured In terms of actions people took And then you can basically take your head to any point in time Any of these dots I can take my head to this location And say double click To check out that particular hash And you see that my head moved When my head moved It basically reflects the state of the union At that point in time Excuse me So when I move my head I'm able to traverse through the graph Through the directed graph To any point in time I feel like So if I want to go to this point in time Where we have Z added I can just double click on that dot And I go there And you see my head is now at that edit Z location And you can see that Z has been added And the Z file shows up If you take my head here And move it all the way to the very top You'll see all of these things again And now I see all the changes back So what I'm doing through my mouse clicks And double clicks You can do the same thing in command line By looking at the commit log The git log right here And do the same thing pretty much Like this The git log And you'll see all these entries You will find the appropriate hash that you like And so you can just check out any of these Hashes By pretty much running git checkout And that number And when you do that you will see that this head Also moves This head is currently at the top I will now check out this some number here One of these numbers And you will see the head moving in the software As soon as I checkout In the command line And see the head moves Come on move show it to me Hello head Where are you? Head There it is The head moved To this point in time from when At this blue dot or purple dot And so what you're looking at is How the head moves according to what you want Accordingly the state of the folder also gets reflected In the file system changes to match Whatever that was in that point in time In that structure in git repository You can always go back to the very top By saying Git checkout master Now you're on all the way to the top of this picture And you see the head is not there it moved So the software takes a little bit to move the head And now your head is right at the top Now having seen this part I would like to now describe A couple of other components to it Which are the idea of a branch A branch is something that you can work As a side discussion you want to have With the main line of work that people are doing Maybe you want to create something different For example you want to now incorporate Something inside these files for example I need to write something in the file By the way up until now we haven't actually written anything inside The files are kind of empty Maybe not maybe not But I think you wrote something inside Some of you wrote something inside the files Like G has something H has H file I has I file And A has nothing And that's how we have apparently done So if I now make a change in this G or the H file And I will make a delta here like a modification And I'll say this is now how it's supposed to be written I want to make something different from what we have I want to make those changes in a slightly different location In the directed graph It will still be in the same folder But my state have to shift to a different branch What I'm doing from a picture perspective Is I am again strictly within my laptop GitHub doesn't know None of you would see it None of your forks will have it But in my laptop like right here All these changes are available to me What I want to now do is experiment with something different And so I will now I have this entire directed graph Available to me And I will now create a branch So I'm at the master At the top level And I will create a separate branch Which is going to be A location in the graph Which is going to be different from what I am currently working on Maybe there's work here involved that all of us are still doing To expand and further develop the project But I want to create something separate And I want to play around with a new idea That I have in mind And the team is not involved But I want to just privately work on it I can potentially do that without disturbing the team Without letting anybody know I can privately create a separate branch for me And build this new idea So what I will do now is on the command line I'll say here git Branch And then I'll give it a name Like a new idea Now I have a branch available Now you can see this visually In that software Right there And there is this new idea branch available It was not there before Now I can check out Or rather git checkout This new idea And you will see that my Bold font Which is currently on master Will change over to the new idea branch You can see that happen as soon as I Check out this new idea And I switched You see that I am now The software doesn't show me yet But the dot moved here You can see the dot moved to the new idea branch And currently it is showing me That I switched the branch to new idea So here in the new idea branch I can do whatever I like And maybe I'll just go to that Edit the g file or h file And in that file I'll make some changes Like for example I make a change like Hello file For example And then I save it Now this change I made It is available in a separate branch I can experiment with it I can work with it I can check my log And I see that there is this head Pointing to new idea But origin master and master Are all intact I did not bother Did not disturb them There are separate Changes that I created for the new idea experimentation And I can here do the same things like before I can say git status And I see that this file modified H I can say git add And then I can say git commit And then I can pass in a message Playing with a new idea And then I I make that commit And then I see my git log And I see that my commit tree shows The head pointing to new idea And I have a new commit hash But this hash is not on the main Master branch It is on the side branch And my git is right there visually The same thing showing up in the git log Where my head is pointing to new idea It is a little bit ahead of the master Master is behind This is the master Here It is slightly behind You can see what the differences are Which is basically edits that I made in the edge file I can do this separately And when it comes to real work Playing around with a new idea But I really want to work I can just very, very swiftly Switch to my main master branch Say git checkout master And now my head will move back To the master location And here now if you cat edge file You will see it shows the way it was to begin with Whereas if I git checkout The new idea branch You will see that my cat edge file This hello file edit that I made In a separate branch So the same file is in a different state Because it's in a different branch With a new idea branch As opposed to the master branch If I checkout the master again And cat You will see the old content If I checkout the new idea again And cat You will see the new idea again So the same thing The same file Same set of folders But managed differently by git Because you are changing branches And so it becomes a separate location From a thinking perspective Which is still the same file The same data files The same exact file here Edge file But this is indeed new idea branch And so that's what it shows But you go to the master It just lines up with what everybody else is doing And so we don't have to disturb everybody else And you can just stay focused On what everybody else is working on And you don't bother them And this is how you build a new feature You're creating something new A new idea You go on the side Do some work And when you find that this is a good idea That you want to bring it to the mainstream You just merge it locally You can merge it pretty much like this You go to master And say git merge New idea And then you will see that it merges And it did And so now if you see in the picture In the software here Your master is matching your new idea But your origin master Which is origin master If you remember Is this name called origin Which is the GitHub location They chose to call themselves the origin Which is not the right word by the way But that's what they chose So I stuck with it But this origin master Is behind Because I created a new idea And apparently it's a good idea So I merged it into the master branch And now master is ahead And it matches the new idea branch And my head is also at the top Which is not the origin master But the master in my local computer Like right there And therefore I want to be able to synchronize My changes I made Between my laptop And the origin location So I had to do git push again When I push You will see that the origin master Also matches Whatever I have Whatever I just made a change Which is I created a branch Worked on it Like it Then I merged it to the master And now I want to push You can see the software is already Suggesting you that you can push And you can potentially push your master branch With the changes that you have in your local laptop To the origin location And there it goes So it is pushing visually From a graphical user interface perspective As opposed to typing in the command line number 8 You can visually push And when you do push You see that this master And origin master And new idea are all in line And you can go back to here on github And see that this alphabet folder Or rather the repository Has a edge file showing you playing with a new idea And the edge file itself will say hello file And that's what we did in a separate branch But the branch is local to me My laptop The github doesn't know about that branch Because I never pushed the branch called new idea I did not I chose to not push I could choose to push it by checking And say okay push So I am pushing my new idea branch also And thereby giving it access to you So now as a consequence of this You will see in the alphabet location There is a branch called master And there is a branch called new idea Also available Now this branch is even with the master Even, matching up There is no difference Which is because I merged it already before I pushed And so there is a new pull request Which is coming from jersey boy And so we will have to accept that pull request Apparently that came in again So apparently the JNK was missing So I will review the changes and I like them So I say like And then I go back to merging the pull request And in the merge commit itself I will say commit them Confirm merge And then I will say thanks And comment And I just made another change This change is available locally Only in GitHub And I don't have it So I need to pull it down What I need to do is git pull I need to bring it down right here So I will have to see that I currently do not have the two files That just showed up Thanks to Gustavo Those are I think J and one of those two files I don't know which files But you can see the pull request The good thing with git is that you can see the history And you can see that the pull request was for a JNK Those two files apparently are not there in my folder See JNK are missing And I did not pay attention to it before But that's not a big deal Now that we have This folder in the GitHub location Containing all these files now And the changes I made And also my branch called new idea All of these things are available You will see that the branch called new idea Will lag behind Unless you keep it up to date And that is something that is not necessary To keep branches up to date Because those are temporary branches Temporary ideas that you might want to go on the side Do some work And then you like the changes Then you bring them back into the mainstream And if you don't like the changes You just discard them That's exactly what I will be doing now And so apparently I have taken the changes To my main branch, master branch And I pushed it to GitHub But then Gustavo has sent us These new pull requests That are not there available to me here So I can either run line number 11 In my command line Or I can go do this visually Like right here And say pull And then I will say OK And so it is going to pull And the pull will come down And you can see that the two new tinker toys came up This tinker toy hash called J and a K came up And then the third one for merging That also came along So now my master is all the way at the very top And that is as a consequence of this This new idea is behind the master And that's OK I can get rid of this new idea branch Because it is not really a great idea We took it But we can delete the new idea branch And you can delete it from the remote location also Like that And you can just click to delete and confirm And that deletion will happen on GitHub And so this deletion is happening right now on GitHub And you will see that this new idea branch is not there anymore So if you now try to refresh Say 404, not found So you go back to alphabet And you try to drop down That new idea branch is gone, gone It's missing And that's because it deleted And that is expected So now that we have this new idea also disappeared from my visual display of the Git repository And also from my logs here That is also gone So it's completely eradicated because we deleted the branch So that's the concept of a branching There are a couple By the way, there's a ton of things you can do with Git It is a fairly, fairly powerful piece of software And I must admit that even I don't know all the capabilities of Git And so if you really want to read Git You should read Git SCM, the source of the website here Git SCM is a good website Read that It has extensive documentation There's a reference manual Way too many things you can accomplish with it But what I'm doing right now is just bare minimum Getting to scratch the surface of what Git can do for us It's not a comprehensive Git exercise It's not a comprehensive Git-focused coursework So I'm suggesting that you please read this documentation And don't digest the whole thing in one shot That doesn't make sense Build on step by step From what you need from a usage perspective Whatever you need to do Find out how can you do that thing using Git There's a little cheat sheet for you Use that And slowly build the ability to use Git For every single thing you do from a project management perspective It doesn't have to be coding Doesn't need to be coding Git can store anything Like anything which sits in a folder It can handle Yes, including binary objects, large files And there is a new project available called Git LFS Which will handle even very large files So that's large file storage It's also available as an extension You can add it on if you need that But basically you can store anything and everything in Git There's no such restriction anymore They used to be at one point Not anymore You can just store whatever you feel like In a folder and just have Git manage it for you That's what I would suggest for looking at Git as a piece of software And I think I will just do a couple of things to recap So here I think we discussed this piece We discussed the visual parts We have the folder in a reasonable good shape Maybe it's a good time for us to discuss some questions About Git if you have any Bring them on or we'll take a short break And then move on to the next idea Which is using platform as a service And we'll do that And so questions are welcome No questions That's fine This is Sri Where are we going to use this Git exactly? So just only this is for a version control You are explaining us In the cloud are we going to use this? So let me describe the usage So the reason why we need to know Git Is because we want to work with team members To collaborate And so what happens is Git will be useful not just in the bootcamp In your real life you will find it useful Here's how you'll do it If you're a developer You're already using some version control If you're not a developer But that's okay Because I would say you are a developer Of not software but you're developing Something else What is that something else? So I have knowledge of this Version control TFS So that's why I want to know where exactly We are going to use our Git Correct So TFS is in Visual Studio So Visual Studio now also has Git capability as a First class citizen so it's part of Git It is now part of Visual Studio also You can use Git, you can use TFS You can use any tool But depending on the role of Personalities that we have in our bootcamp You can potentially be a developer of software You can developer of platforms You can be a developer of some infrastructure You can be a developer of something else What I would like to now say is that Since most of us who work on Either the infrastructure level or the IT level Or the platform level or some other level of Making a contribution to the overall project That a company has We will need to use software Even to run IT infrastructure Even to get a machine To deploy a bunch of machines To deploy a particular configuration To set up a database all of those things Are done through software At least in the context of cloud That's how you do it Whether it is public cloud Or whether it is your private cloud open stack Or something else There will be a piece of software that you will run That will enable dealing with IT infrastructure Dealing with software platform dependencies Dealing with source code Dealing with developers Dealing with the configuration of all these things Put together to make things happen for the customer That is what we will be now switching our discussions from the next time Is to focus on delivering an entire solution to the customer There will be people like developers Or platform developers, infrastructure developers And other types of people collaborating together To create something of use to the end user The customer And from that perspective You will use software of some sorts To administer infrastructure You will put your entire design of hardware Of application, of services, of platforms, of dependencies Of everything, every single thing needed To make the customer happy You want to really make the customer happy at the end Because you want to provide them a good service And so you want to deliver that to them And for that you need a design You need IT infrastructure You need software You need platform You need middleware A bunch of other things And then you need your application That the software developer will make And put all these things together And by the way, each and every step Is a software There is no such thing these days At least in the context of cloud Where you are physically lifting a box And setting it up And connecting the wires There is no such thing in the cloud at least And that's where you are evolving In your company You see that happening already in many, many cases You're not directly dealing with hardware And that's exactly what's going on So you're dealing with software Even for simple things like getting a machine allocated And so you need to automate these things You need to automate entire activity that you do On a day-to-day basis And you need to make sure that you are writing software To automate simple things like IT allocations Beginning from the very basics That's where you begin So when you're automating, you're writing some software It may not be a Java software to create a new application But it may be some other software I'll demonstrate those software to you very soon Next time So that's the kind of software you will use And what we are really talking about right now is To define your infrastructure, your software, your platform Your this and that, every single thing in code And since you're writing code now Just believe it or not, you are now a developer Whether you think of yourself as not a developer or not Doesn't matter All of you, you, me, everybody else these days Is a developer of some sort, of something That is engaging with the cloud You are writing some code of some sort Simple, maybe not complex But there is some code It may not look like code But it is programmable It is repeatable It is something that you can automate It is something that you should worry about Putting things in revision control You need to write code to make that happen And therefore you need to track it And tracking means you need to understand The state of the folder Like what was it before, what is it now How will it change What needs to change How do you go back if you make a mistake Those things need to be tracked And you also need to collaborate with other people That collaboration can happen beautifully If you use Git That's where you will use Git on a daily basis You should start thinking like this already If you're not thinking like this, something is wrong So fix it Because you should automate every single action you do in your company Every single thing No kidding, I'm not joking You should seriously think about Every action you do in your company How can you make it automated If there is something that you should really focus on Is that one thing that I will say black and white In these days The best way To retain a job Is to automate it And put yourself out of that job I am not kidding I just said that The best way to retain a job you have A career you have Is to automate your own job And get rid of it By doing that What you're really doing Is you're out of work Because you just lost your job That's exactly how you should behave in your current roles Is to find a way to automate your own job So that it happens by itself So that you're not needed in the company anymore That's exactly how you should think And there is a benefit to that by the way It gives you The best way to retain a job It may not be that same job But I will guarantee that your bosses Will be super happy If you automate your own job And you don't have a job anymore Because it's all automatic And if that happens They will find you another job to automate Do you agree with me? That's how you should think So when you have a job Automate the whole thing And then you don't have a job People in your company will find you A hundred other jobs Just because you are the one who is killing jobs I'm not saying killing jobs As in the evil way of thinking of it But the way is to automate your own job And you can do this It doesn't have to be coding It doesn't have to be your application programming itself Because everything is coding Everything is code In fact, one of the keywords I will say The next class is I'll just say it right now Infrastructure You treat your infrastructure as code So whatever you create in hardware You think of it as I'm going to write code for it I'll give you some quick examples To help you understand what I'm talking about So here is GitHub Just Maybe this is it So here is a way to use something I'll just demonstrate this as a quick example So here it goes This is the command I would like you to be running We'll go more specific I'm just giving you an illustration The command to create a server Will look something like this You will say some software You will say EC2 cloud Server create Use this key parameter Use this login name reference Use this machine image reference Use this machine size reference In the northeast region Asia Pacific And in the G flag I don't know what that means But I just picked up some random example So this is the piece of code you will write To create a new server in the Amazon cloud And yes, you will do these exercises soon Probably starting next Maybe not next class exactly But pretty soon we will do such exercises We will treat cloud infrastructure as if it is code So the key thing to remember is infra as code Whatever you do is code So you have to code Believe it or not You may not code in complex languages But you will code Because you want to automate the thing Automate everything you do And so everything we touch in any cloud needs to be automatic So we'll use a variety of packages to make things happen But at the end of the day you have to really think like a person who is building something very repeatable Another thing that I would like to now mention is this idea Is an idea from an operations management book Or rather I should say it's a textbook I studied for my MBA at University of Michigan And there we had a Nobel laureate, a professor who taught operations management And he used to say this one thing that I still remember He said Routinize the repeatable And this he said in 1999 Or maybe before that I just did my MBA in 1999 So ever since I have been doing this thing Literally this exact one thing Is to routinize everything that I do Which means that I go through the motions of grunt Grunt work To do by hand One time Maybe a second time But the third time I have to automate That is how I believe That's how I do it Every single thing I do is like that Is to make sure that I do the whole thing by hand Like the difficult way, the hard way, the grunt work way The hard way Because I know really exactly what I am doing now Because that first step, step number one of doing anything Find out to do the hard way The second time I'll do it again to refine any missing pieces that I may not have picked up the first time And the third time I really really do everything automatic And this is a way of thinking And this is what the professor said a long time ago at least to me Is to routinize whatever you think is repeatable Because everything that is not routinizable You should leave it for people So if there are certain things that are not routinizable You should leave it for people And if it is routinizable and repeatable Leave it for machines That's how you should divide the work You know, whatever that you can repeatably do very very predictably You just give it to a machine And then certain things you have to do it yourself Because that is not possible to routinize It is not repeatable It is not repeatable For example, when you want to at least think carefully Or come up with a new idea Those actions you cannot automate It's not possible At least I don't know of a way to automate the idea In a new idea creation thing I have no idea how to do it So that is not automatic It is not automatable It is not routinizable So I cannot write code to make a new idea Not possible, at least today So that's the action you need to give it to people In your company And the other actions You leave it for machines Give it to machines Meaning automate every single thing Now in the process of doing these things You need to write code And that means you need to make sure that the code is written in a folder That is controlled by Git Not kidding, that's how I recommend This is the software you should use It is open source It is available to you It is free And it is the most powerful No kidding, better than TFS You should study it I am not saying take my word But just study Git, NTFS and other things That is the reason why Microsoft adopted Git Is because they could not win And so they just admitted to Let me show you a couple of things that you will find Microsoft, did they join the Linux foundation? There we go This is a sign of if you cannot win You just join them That's what happened Microsoft tried They tried to keep close source And keep separate from the rest of the world And then one fine day in 2016 This happened This is a serious thing If you don't understand this Just read it one more time Microsoft joins the Linux foundation as a platinum member No kidding That's one thing You will also see a bunch of other news related to it For example, PowerShell is open source And is available on Linux It's there on Linux PowerShell is the bash shell for Windows, if you will And so this is PowerShell is open and available on Linux You can run it in Docker and Mac and everywhere else you feel like The source code itself is on GitHub And so here is Sathya Showing his picture with love for Linux And one more thing if you haven't noticed Is that Ubuntu I think bash is in Windows There it is So Linux bash is built into Windows 10 Right there This is a Microsoft article So Linux bash or the entire subsystem for Linux Is available as a part of Windows 10 Not older versions But definitely you can see Linux included in Windows 10 That is the subsystem And you can play with it Install How do you install it? I think it comes as a part of Windows 10 feature set You can just enable that Enable the optional feature Enable Windows Online Optional Feature like that And run it in PowerShell and restart And you have Linux right in your Windows machine I suggest that you don't do this right now At least for the boot camp Because of a technical reason I'll tell you why What happens is if you have your machine running say Windows 10 And if you enable this Linux thing You're probably very likely to enable now that I told you If you did not know Don't do that Until after the boot camp And I'll tell you why What happens is Windows has a hypervisor built in It is called Hyper-V And it is currently included in Windows 10 But not enabled by default And therefore that is why VirtualBox is able to run currently Comfortably If you were a Microsoft employee I would have told you to disable Hyper-V Because in Microsoft employees the laptops they have Is enabled by default And therefore VirtualBox fails And that was not the case with you So you don't have it enabled by default So VirtualBox is able to run However if you install this Linux subsystem It will probably enable Hyper-V also Which means VirtualBox will stop working And therefore I am saying Don't Don't do the Linux part in Windows 10 Until the boot camp is over Similarly don't set up Docker for Windows Until after the boot camp Because it runs into the same problem You will have Hyper-V activated And this activation If you activate this then VirtualBox fails And if VirtualBox fails our exercises will not work So that is something that you want to avoid If you still insist on setting up Docker It is okay, nothing wrong with it You just have to go back and deactivate it For VirtualBox to work That is something I want you to be aware of It is okay to experiment Nothing wrong with experimentation as such But just be fully aware of what you are dealing with And then go ahead and experiment There is nothing wrong with experimentation as such So go and set it up Go create a mess I am not saying no But just to reduce hassles for you Just cut down the hassle And avoid setting up Docker for Linux Docker for Windows Right there And also this Linux subsystem that I have talked about Don't set it up You can set it up at the end of May May 31st, go party And if you need help at that time you can still call me And I will still help you Even if the boot camp is over, that is not a problem But I want you to succeed with the boot camp And I want you to be able to successfully work through the exercises we will have Inside that virtual walk that I have given you And that is why I am suggesting That you I guess, yeah, do whatever you feel like Who cares, I will still help you and figure out A way to work it But simpler way is to just not install them At least for now So that is the reason why With that understanding I would like to give you Some homework The homework is to go to your Public library And buy this And rent this book called The Goal This is a textbook This book This book Is a very very short Non-technical book About the upcoming Section in the cloud genius boot camp I will paste a link for you This DevOps section is starting up I think on April 13th And today is 11th So this DevOps thing will start pretty soon I will enable access for you I do not have access to this segment yet But don't worry, I will enable it for all of you And What it requires Is the reading of this book That book Is right here in Slack Coming up It is available in King County Library And it is also available in Amazon And You can buy this one used for $5 Right there And that's a good idea If you want to buy it So use book $5 It's a decent idea It's a good book, it's a short book It's a story book And it has nothing to do with technology Yes, nothing But it's a very very good book And I will tell you Why would I say Let's ask Jeff Bezos Jeff Bezos Top Three books So let's see what he says So Jeff says The top three books he asks His people to read are The Effective Executive This is the one book I am not asking you to read that, but you can This is the second book Innovators Dilemma Not asking you to read that, at least for the bootcamp But here is the third book The Goal A Process of Ongoing Improvement By Eliyahu Goldratt And Jeff Cox That is the book I would like you to read And it is a required reading Apparently In Boeing Through the LTP program You can potentially build the LTP Program for the book That you may purchase So if you decide to buy this book Just check with LTP And see if they will let you purchase this I think it should be okay But I am not sure about LTP This is the ISBN number I think they reimburse you also Not sure yet, so check with LTP About reimbursement But this Is something that I would like you to read And What I have done is Created a book summary For you It is not a long book, it is like Three to four hundred pages It is a story book, it is not technical Not technical at all There is no use of any computer Any reference to Any kind of technology as such Maybe there is machine technology references But there is no reference to any software As such In that book, but I still want you to read it Because it actually is a very good book And is also a textbook In operations management Now why operations management? Because that is what DevOps Some of it is Half the word Ops is actually operations So you need to understand operations Most of you already understand technology But maybe not operations so much And so that is why I am Suggesting that you please read that book And if you don't have time Which is very likely the case I have given you a summary In the book summary is right here And you should be able to see it Chapter by chapter summary is available For you to read And so it is one page basically I want you to read that You should read this summary at least Sometime in the next 5 days 5 actual days As opposed to session days So that was the book summary I should grab that link to you Send it over And I think I already discussed the Amazon ISBN number The book is available in the King County Library also You should go to kcls.org And there is this application called Overdrive Overdrive app This app will let you Connect your account with your This app is available on All these platforms You download Libby and then Connect it to the library Use the library card login password This is the book Should be easy to reserve it and read it If you go that route Another route Which is interesting At least to me Is to actually read the Listen to the audio book Which is I find more interesting Because the reason I find it more interesting is because There are people from different countries That are represented in this book And these different countries will have People from different countries Talk in different accents And I actually like that And so I find it interesting to Listen to people from different countries Speaking in their own accents And that's what the audio book Attempts to create The audible Title is no longer available What? This title is no longer available For you? Fine Then you buy the audio book CD Okay, CD is expensive for no reason So I'll let you decide But read the summary at least Okay, let's see what we have So we discussed Git We discussed a couple of other concepts In the Cloud DevOps segment Already a little bit but I'll come back To our Git discussion I want you to use Git every single way That's possible in any project that you do Because it's a beautiful tool It helps you And so with this I would like to take a break And then switch over to using Git As a developer, software developer To use a platform as a service That's what I will be doing next And so I will now start The timer For the break There we go The break starts right now The break starts right now You you you you you you you you you you you you you you you you I'll put my camera microphone back and we should proceed. Just checking if you are also back. Yes, we're back. Okay, okay. So our next idea will be to understand how developers typically write an application. And we will create a short simple application and send it to a platform as a service to see how it will just run. That's the idea. So for that we have an exercise written down somewhere here. We'll go to that exercise right here. And it is in the technology segment and you should be able to find it somewhere. Where is it? I think this is where it begins. I'll give you a link. So you have the link now. And we'll follow along. It's a fairly simple exercise. But the concepts you will go through in here are, as you will understand, let me start my pen. There we go, pen started. Now back to the notebook. But I'm going to go through the exercise in a picture form in terms of helping you understand what are we really going to do in the exercise. So we have a variety of platforms available as a service. One of them is Heroku. We just use this as an example. There are many more, like Engine Yard. There's a whole list. Maybe I'll just give you a link. This link has a bunch of different platforms defined as a service. Where are that platforms as a service? Yeah, here are some examples of platforms as a service, like right there. AWS Elastic Beanstalk, Windows Azure, Heroku, Force.com, Google App Engine, Apache Stratos. And there are more. It keeps on coming. People keep on developing, building new stuff, and it just shows up as an example. This is one of the oldest ones. And we'll be using this as an example in our exercise. That requires us to have a login. So login is free. The free access I have, I'm just signing on to. What I would like to say is this is the platform as a service we'll be using. As you know already, platform as a service will take an application. At the foundation, they have some infrastructure as a service that they run on. So Heroku runs on top of some infrastructure as a service. And I think they run on EC2 from Amazon. So they run on top of Amazon's Elastic Compute Cloud. And they give you a platform solution. Now, as a developer, you can put your application right on top, so put your app. And then it runs. It runs like a software available as a service. Your software available to your customer as a service. So this is your customer. By using your SaaS, you are the application developer. You deploy this application on the platform. And then the platform makes it available as a service to your customer. That's the usage model. Now, platform as a service, this Heroku itself, is running on the Amazon Elastic Cloud infrastructure as a service. And that is the foundation where it builds on. So that's the layer, the three layers, IaaS platform and software layers, three layers. Now, where do you come into play? This time, you are going to take the role of a developer of software, which means you need to have an application, or rather create an application. And you put that application in a Git repository. And then you push. That's all you do. You push it to Heroku. You pushed it to GitHub before. You will push it similarly to Heroku. When you push an app to GitHub, it shows up right here. Where is that? Here. And it just shows up. You can read it. But this is not running. Where is the difference in when you push an app to Heroku? It runs your app. When you push an app to GitHub, it shows your app. That's the difference. They're functionally very similar. You push to both of them. And if you push it to Heroku, then Heroku is a platform available as a service. So it will run your app as opposed to show the code. It will show the code to you in a browser like that. That's where you see the alphabet source code showing up. And what you see is what you want to do is begin, first of all, building an app and then putting it in a Git commit and pushing it to Heroku. That's the exercise. So it will run. You expect it to run, by the way. It should function. It should totally, totally work just fine. So for that application to build, we need to use the workstation that we have, the Cloud Genius workstation. That's where we'll be doing some steps to make the application itself. Making an application can be a cumbersome job. So we reuse ready-made tools, like ready tools, to construct a framework that will give us a quick, easy way to start constructing an application. This concept is very popular in any language you look at, you know, Ruby, Python, Java, Go, whatever. So people use frameworks, ready-made frameworks, to make their work easy. So for example, in the Ruby language, which is what we will be using, we have the Rails framework, Ruby on Rails. This framework is available for you. It is version 5.2, and you can download it. By the way, it's open source. This framework is created by this person. His name is this guy. He is the founder of a company called 37Signals. They have a new name these days called Basecamp, and that's their product. And this product is how it started. This guy started building it, this guy. And David started building that company, that product, and that product is very popular. These, you know, they have a variety of products. You can actually look at the pricing and all that. But all this product set is built on top of the underlying foundation, which he decided to open source in form of a framework so that other people using the Ruby language can use to quickly create applications using the Rails framework. The idea here is that the framework gives you a straight jacket guided Rails approach, guided Rails. So you have guided Rails that you can just put your application and it will build quickly. That's the whole idea behind using a framework, is that it gives you skeleton, it gives you structure, it gives you guided Rails so that you can quickly get up and running. Now, the drawback of using this model of approach or this approach of using some kind of a guided structure or using a framework is that you have to do it their way. Do whatever they require. You have to follow their guidelines and stick to their way. There is a book on this topic called The Rails Way. How to do things the Rails way and you can buy this book on Amazon if you are into Rails development or Ruby development. And that book will guide you what is the most efficient quickly, the most efficient route to building an application using Rails. If you know this application called Twitter, this initially began as a Rails application long time ago. And these days it is not based on Rails, Twitter is not. But this application that we just used a little bit ago, this is still Ruby on Rails on the backend. The entire GitHub website is Ruby on Rails. So by the way, like that, there are many other applications, many scale websites constructed using Ruby on Rails as a framework that this gentleman created. And since it is Ruby language, it is also available as a gem. You can go to RubyGems website and look for Rails and you will find that Rails is a gem. It is a ready-made Ruby package. It has been downloaded 127 million times. And it is also available on GitHub with 39,000 stars. It is the source code for that. And it has 3,400 contributors. There are 66,894 commit hashes. That many changes have been made, 34 different branches and so many releases. The 5.20 is the latest stable release available here. And there are other work that's happening that people are still committing and making further changes to Rails source code even as late as five hours ago. Somebody did something. That's happening. It keeps on happening. People will keep on building new stuff. They will not stop. But it doesn't mean that you have to take all that changes all the time, you can just stick to a branch or rather a tag and stick to the version 5.2.0 and lock. And that's the release. This release was made two days ago as you can see here, two days ago. And that is what we are talking about in the 5.20 tag which is available as a release here on the gem's website 5.2.0 released April 9th, two days ago and that we can use. So that is Rails and we'll use it pretty soon. As you know, we'll be using the Ruby language. So like Ruby, there is Ruby on Rails. So what if you're using some other language, Python, for example. So there are Python frameworks. There are a ton of them. There are Python language frameworks available like, I'll just give you a couple of names. There's Django is one. This is one framework called Django. It is also open source. If you're using Python, this is the way to go. There are other Flask, I think is the name of framework also available in Python. Flask framework is a small framework. It is also very popular. You can use that. If you are using Java as a language, you will probably be aware of the Spring framework, which will help you create Java software very, very quickly using the Spring framework. So what these frameworks basically do is give you a skeleton structure already to begin with. So what I want to do now is go to the virtual machine and look at the exercise steps that we have in mind and we'll just follow along to create our application. Then push it to Heroku and then we are done. That's the exercise. So the machine starts. We'll go to the exercise itself. It is written down here in our link somewhere. Where is that? Here. That's the link. So create a Heroku account. You probably have it already. You created a login. So that's where you should use as a login name and password you should have already. So once you have that, you need to install this software on your workstation. That's the line you need to grab and run it in your workstation, like right here. And go to the workstation, open a command line and run. This line will install the tool belt. It'll ask you for a password. The password is cloudgenius. So you need to create the password. It will proceed. It will update whatever is needed to make the tool functional. And then we will log in using the command line with the Heroku tool to connect to the platform as a service we have on wherever the thing is. It's probably somewhere in the Amazon cloud. So that's where Heroku runs on the infrastructure provided by. I think I have an emergency call. So let me just get it. This is an emergency. We have a problem going on. So standby, please. So we have a trouble in where I live, in my home. That's what the people are coming to fix. And that was the reason I had to take that call. So let's continue. This tool has set up correctly. The repair people are coming in to help fix the problem that we have. So now we have the Heroku tool belt functional in our machine. And you can use the command called Heroku. Now we need to connect this with the cloud, the Heroku cloud. And so what I like to do is grab this machine and put that in the 50% screen. And then grab the website here also on the other 50%, like 50, 50, like that. That will help us expedite some of the copy pasting that I will be doing a little bit. And that's what I will be using. So what I want to do is, first of all, using the Heroku software that we have running here, I would like to log in. So Heroku auth login. And by doing that, I think it's auth colon login. So by doing that, I will need to type my login name and password from heroku.com website. So I'm doing that right now. Typing my login name, now I'm grabbing my password. And I will grab my password and paste it right there. And so here is my password. Copy it and paste it. Paste it. So it logged me in. Nice. What I want to do now is I have a logical connection between my command line here with the Heroku tool build software and the Heroku cloud running on top of the Amazon cloud that we have, a connection established. What I would like to now do is to let Heroku know that I will be using a public-private key pair. So I'll say that, you know what, please add my keys. So Heroku, please add the keys. So it says, yeah, I found a key. Do you want to send it to Heroku, the public key? So I will say, yeah, please send the public key. This is the idrsa.pub, public key. Please send it to Heroku. So I say, yes. So it sends. And as a consequence, you should be able to see that key right here in Heroku account, a key uploaded. I have probably tons of keys there. But you should see your key showing up in the Heroku account somewhere here in the dashboard. And you will also probably receive an email notification saying that somebody uploaded a key pair, a public key, to your account. So I should see a key somewhere showing here that maybe the email is coming. The email will come from Heroku saying you added a key. So that's fine. That email is expected. Next, what I want to do is to proceed further and understand how do we build an application. To build an application, what I want to do is to use a framework already made, like quick, and get to the point of end result as quickly as I can. Basically, I am asking this gentleman to write code for me. I'm asking this guy to help me write the code because I don't want to repeat the steps that he has already done. So I will use his framework, the Rails framework, and just quickly get to a point where I can use it. So that's what I want to do, which requires me to configure and install that Rails application right here in this machine. This machine, we need to have the Rails gem installed. As you know, Ruby language packages are called gems, and they are available on RubyGems website. So I'll use the gem install command to install the Rails gem. And this is the specific version that I have interest in. So I'll be using that particular version of Rails and install it right here. And so it should finish installing very quickly because apparently I have already installed it before. And then I need to let my command line know that I have the Rails gem installed. So I can do very easily R-B-E-N-V rehash. And this step is unique to Cloud Genius Workstation because we have the ability to run multiple versions of Ruby in this workstation. There are lots of bits and pieces of software included. So this step is not necessary in other computers. It is only with this machine you need to let it know which version of Ruby and which versions of gems you tend to use, so you have to rehash your gems. That's what I just did. This step is actually not necessary in other computers. Next, what I've noticed is that people do this exercise multiple times to get really a clear idea about what Heroku is, what platform the service is, and how do we make use of these things. And so they repeat that exercise multiple times, at least two or three times, easy. And so what happens as a consequence is that they leave older folders from a previous attempt behind, and they run into trouble. That's why I have this step here, to delete any stale folder called the My App. So you have to get rid of that folder that you may not have. So I'm deleting that folder. It doesn't exist. But I'm doing that step. I have the step written down here, primarily for people who are repeating the exercise because as a consequence of this exercise, there will be a folder called My App already created in your workstation. You want to remove it when you're starting afresh. That's what we just did. Now, another thing to remember as we discuss these concepts here is that you want to have this application you write magically run on the Heroku website. And so you need to conform to how Heroku expects your application environment and how it connects to a database and all that little detail. And as you know, Heroku uses the Postgres database. They like to use that database, which is a good idea. So you should also use the same Postgres database in your workstation. And typically, when you start a new Rails application, they don't use Postgres database. They use a SQLite database, which is not what you want because you want to match exactly what Heroku will need. And so you want to get the same exact setup that Heroku has or will have in your laptop right here. And so what I'm doing essentially is in my laptop, I will get Rails. I will also get Postgres database. And then I will use these two tools to build my application. And thereby, I'm mimicking whatever Heroku has. They have PG, and I will ask them to get the Rails version that I have noted, like 4.2 something. Whatever that version, I will tell Heroku to please use the same matching version that I have in my computer, like right here. I have decided 4.2.7.1. So I'll tell Heroku to use this version. I'm also doing the same thing, but PG is Postgres database is what Heroku uses. I will have the same database installed in my laptop. So basically, we are matching item by item. That's the next idea here, is to prepare Postgres SQL database. That database is what we need to install in our laptop right here. So we'll grab, oops, hold on. We'll grab that step and run it. And then we'll grab the second step, which will actually install the Postgres database in our laptop right here. So this should do it very quickly, I hope. And then the installation of Postgres database itself after that, like this. And this should finish installing Postgres already, because by the way, Postgres is already installed in the VM, in the machine. You have it already. So you can potentially skip that step, because it is already the newest version installed. So you have that thing already installed. We'll move on. What happens is when you install Postgres SQL first time, it expects you to interact with it using a user called Postgres. The current user you have is called user, which shows you that you are user at CG. That's the username you have. You want to change the username temporarily to the Postgres user. So you can see that the user changes like that. And you are now the Postgres user, acting like a Postgres user. So different username. And with that user in place, what we would like to do is we would like to create a new database user interactively. And we would like to create a user named user in the database like that. And so the name of the user should be USER. Name of the role should be user. Shall that new role be a super user? So say yes to it. We want to get administrator control over the database. And we have to create a new user called user. So we just did that and said yes. And apparently that user already exists because the workstation has database. And I think I have run this exercise already in the previous attempt. That user existed already. So the failure error was the role called user already exists, and this step was unnecessary. But I just did it to illustrate to you that that is something you would do if you're doing it the first time. Next one, I want to create a place where the database will sit. This is also known as creating a database, by the way, which should also exist. And so it will fail, saying it already exists. So that is the reason why it does not do anything but just fails out, saying you already have that database. So these two steps are a one-time step on the database. So now we have to come out of this user, back to the regular user, so we just log out. And then we are back to the regular user called user. Next, I want to do is to allow Ruby as a language to interface with this database, for which we require another gem. This is called PG. This PG gem allows you to connect to the database and operate on this database using the Ruby language. That's what this gem install PG will do. By the way, this is already existing in the machine, so you can potentially skip it, but it doesn't hurt to install these two steps. So I'm just going to install them. It doesn't hurt. It will say that you already have it. And then gem install PG. This PG gem will enable you to use the Ruby language to connect with the Postgres database. Then this particular step finishes. If you're still running into some error, you may want to run spring stop as a command on the command line if you run into an error, which is not likely, but I just have that note here. If you run into an error, you can stop the spring stop to bypass the error. The next step is on the next page. So we'll go to the next page. And here, we have to understand what we are really creating. And for that, a brief discussion on what is model, view, and controller. The idea of MVC, this is something I want you to understand. If you know this already, please tell me that you know it already so I can skip. What I want you to know is these acronyms you may have heard of. They are patterns of development. Model, view, controller is the name that people use. There are various names of the same thing. Model, view, controller. Do you know these things already, or are you familiar with them somewhat, or would you like to have a short discussion on this? Let me know. If you say that this is already familiar, we'll skip it. If you say that a good few-minute discussion will be useful, I will describe that. Could you do a few-minute discussion, if possible? Thank you. Thank you. Yeah, yeah. OK, we'll do that. So the idea of MVC is a way of thinking and a way of separating pieces of code in separate folders. That's how exactly I look at it. What I just said is it's a way of patterns of development, meaning when you write code, you want to write code for these things in separate folders to organize better, to make sure that people who will read your code in a team setting will really understand very easily what part of the code is doing what. That's the whole idea behind MVC. It's not complex, not really complex. It might sound complex and scary. It's not. It's just a way of organizing how you write different pieces of code in different folders. So basically speaking, that's what it is. But let's put an example to it to help us further understand what's going on. So let's look at a application that I want to build. And the application will look something like this. It will look like this. Here's my browser. And in the browser, I will see how many cats are in the home and how many dogs are in the home. I see currently these numbers. That's the view that I see in a browser. So all the code that is responsible for showing me the view sits in a separate location. We will call it the view folder, as simple as that. Because this is the piece of code I will write that will make the view of this app. This app is ridiculously simple. It just shows you the view of the app. It's ridiculously simple, it just shows you how many cats and how many dogs are in this home right now. So right now, it's showing me this, which means there is one dog in the home. And by the way, there is one dog. And so that's the piece of code I will write. And I will save that piece in the view folder. Simply, that's the view part of the code. Because this code will be responsible for changing this number to 2 if another dog comes into my home. Or if, for example, if my wife decides to walk the dog, the dog goes out of the home, so this number becomes 0. This change is happening from 0 to 1 and 1 to 0. And then when my dogs come back home, the number 0 becomes 1. And these changes are driven by some logic, some control logic, I should say. With this control logic is what is driving what changes from 1 to 0 or 0 to 1. And that control logic will look at how many dogs are entering, how many cats are entering, and all that. And it will be responsible for controlling the behavior. That's the piece of control logic, which will be stored in a controller folder, simply speaking. That's what I would like to store this piece of code that controls my application in a separate folder, which is distinctly different from what the view logic is, how it shows to the user. Maybe the view is not these numbers 0 and 1, but a picture of cat and a picture of dog showing like that. Maybe the view is different. That's the second component called controller component. And a third component is the data component, which is the actual numbers, like how many cats are here. So there is a database store, which will actually store data for how many cats, how many dogs. And this will actually mathematically store the number of dogs, number of cats, like that. This is not a view, because view can be in terms of how many dogs I have, or how many cats I have, or how many cats walk away, or how many dogs go on an evening walk. Maybe all of them are gone. And so as a consequence, the numbers in the database will change to 0 and 0. The view will show blank. This is what people see. This is what the data is stored. And that is not what people see. So if you now recap, what we just did is that we had a model of the data, which is in a database, which actually stores the data for how many cats, how many dogs, are in the house at a given time. It could be 0, could be 1, whatever that number is. So this is where you store the data itself. And the code to be responsible to manage the data in the database is also known in the fancy language. People use the word model or data model to make it more complex. But it's just data. I don't like the word model. It unnecessarily complicates things. It is just data. But people like to call this, you use the word model for it. So fine with it. I am fine with it. Just so whatever you're doing with the data, you write that piece of code in a folder called model, or data model, or data, or whatever you call it. I don't care what you call it. But just classify the pieces of code in a separate folder so that people will understand, oh, that piece is dealing with the data interactions. That piece is dealing with the view display. And the third piece is actually deciding what's going on. So the view, as you show it to people, will actually make it look like you don't even need to use these words. You can just say, in my view, I have these cats and these many dogs. You can just say like that. And so as a consequence, or rather, the view is the consequence. The actual number of dogs will be two, and cats will be two. And when these numbers change to, say, 1, 1, then the view has to change to 1, 1. The view changed because the data changed. So this is a result. The consequence is the view. The actual action is happening in the control logic. That's where you write the controller pieces of code. This third piece, which is the model, the view, and the controller piece, the three pieces collaboratively together function pretty much like this, model, view, controller. The controller will manipulate the data. And when the data changes, it will manipulate the view, or the view code will manipulate itself. But this is the piece of puzzle that is generally known as MVC. If you look at this MVC idea, there are other models, other ways to describe the same thing. So if you look at just MVC as a query on Google, nah, not Moreno Valley College. MVC pattern. So here, model, view, controller is an idea. It is the same thing I just mentioned, where if you look at this picture, it's probably a good idea to look at. So you see the model. Model updates the view. View is what the user sees. User is what uses the controller, which manipulates the data in the model. That's how the cycle is. I hope that's clear to a good understanding, at least to help us understand what this thing is. And there are more of these variations of the same thing. There are model, view, adapter, hierarchical model, view, controller, model, view, presenter, model, view, view model, and MVVM, and it goes on and on. So people who have nothing else to do will come up with these names. They come up with the random names and just confuse everybody. That's not the idea. The idea is to simplify how you think about what pieces of code you write in which folder so that other people who read your code will understand what the heck you wrote. That's the whole idea. To simplify other people's understanding. And people will generate random complex sounding words to confuse everybody and confuse the heck out of everybody. So what are we talking about? Nothing. Just simply classification of your code to help other people understand what you wrote. As simple as that. OK. I hope that was a simple enough MVC discussion. Questions are welcome any time. You can read this. I will skip. So now what we need to do is to actually begin creating an app. So now that we have in our application, where is that? In this location, we have our Rails installed, Postgres database installed, Postgres user created, and all that. I want to now begin creating. I think I missed something. Let me go back. I think I probably skipped a step somewhere. Where did that go? I think that step I missed. Somewhere in here, down below, there are some steps that I missed. Yeah. Here, the last few. I did not do this step, apparently. So that's the step I think I missed by accident. So I'll create that. I'll go through those steps. We have to create a new application using the Rails framework, which is as simple as this line, one line. And we'll run that one line here. You will see that my current folders, they look like this. That's what I currently have. And I will create a new one to hold my application. And that folder will look like, OK, come on, copy, please. Copy this and paste. So now, once I run this, there will be a lot of steps showing up. Because Rails will kick in. And it will create a new application. And it will create a new folder called My App. And it will do a lot of connection with the database, the Postgres database. And you will see lots of lines coming up. But at the end, there will be a new folder, My App. That's where you will find your app already created as a skeleton. Let's go see it. So I'll just hit Enter. And let it go. It'll do lots of things. And it'll do lots of installations also for us. Lots of gems will come down. And they'll become ready and all that usable. All that good stuff is happening right now. It is running a bundle install step for you, meaning it is going to go to the RubyGems website, download a bunch of gems, and make that all ready and available for you. Because that's what DHH is doing for us. This gentleman is actually the one who's writing code right now. I am not. I'm just sitting. But that person is actually creating a piece of code for us to consume. We'll use it. Because we are following the Rails way. We are waiting for this action to finish, creating the new application skeleton. And as soon as that thing finishes, we should proceed to the next step, which is to, first of all, understand MVC, which we discussed a little bit. And then the next step is next lesson. Should take us to the actual creation of pieces of code that you and I will create. This guy is still doing the thing. And you saw that it finished whatever it was supposed to be doing. It completed the bundle install, and 12 gem file dependencies, and 60 gems now installed, and all that. OK, something happened. Let's see what happened. So we'll go and refresh. What happened? We have a new folder. OK, what does the folder contain? Well, let's go inside first. What does the folder contain? It contains a bunch of things already. Oh, this is our app. Let's go open it up in Atom Editor to find out what it contains. So Atom is opening up. You will see that this contains our app. And out of all these things that we currently have, you will examine. Let's go item by item. What do we have here? So at the top level, you have the MyApp folder, in which we are. And in there, you will have the application itself. So this is a nicely organized structure of how you write code. And you will now see the MVC way of writing code. You will see a controller folder. You will see a models folder. You will see a views folder already. These three folders are already created for us. And if you want to write a controller piece of logic, you absolutely will go right in that folder. If you want to write code for showing some view, you will write that code in that views folder. If you want to write some code about data handling, you will write in the model folder. If you want to send out email notifications, you will use the mailers folder. If you want to write some helper applications to assist your main application controller, you will write them in the helpers folder. If you have some static assets to show, you will put them in the assets folder, like images, for example, or JavaScripts, or style sheets, or things of that nature. You will put them in the assets folder. And so it's a logical way of dividing your work in separate clean folders that have a meaning associated with it. And that's how the application itself is structured. So by doing it this way, this is also known as the Rails way. If you do it this way, Rails will help you in building your app very, very quickly, effortlessly, in a matter of hours. Literally. If you follow their way. But if you are on your own way, that's okay too. But then you're not using Rails. You know what you're doing, and you deal with yourself, and you will be handling your own handling of each of these things, like model view controller is the approach you can take. You can take several other approaches, but then you are on your own. So you deal with your problems. Rails is not in the question. But that is where you will store your application that you create. There are some additional folders here, bin folder, configuration folder, and database, dbseeds folder, library folder, logs, and public, and test, and a bunch of other things. They're not that critically important for us right now. You just need to leave them there. What we want to focus on is a couple of other things here. One of the important things that we need to worry about is this file called gem file. This file is a list of all the gems that this particular project will use. And so here is the list. It has a list of all these gems. The Rails gem, 4271. It magically put that number there because we wanted it to take that gem. It uses the PG gem, the SAS Rails gem, the ugly fire gem, this version, the Coffee Rails gem, the jQuery Rails gem, the Turbolink, the jBuilder, the SDoc, and all these gems. They are coming from the RubyGems website. So when Rails ran bundle install, it was looking at this gem file and installing all these 14 gems. There are 14 of them, by the way. And so there are these gems called Web Console and Spring and ByBug and a bunch of other, SDoc, jBuilder. And so all these gems with specific versions called out will get installed and are already installed because this thing ran bundle install for us. You can run bundle install yourself if you like. But that's going to be moot because it's already done. So it just tells you the gem, 12 gem file dependencies and total of 60 gems now installed. Okay, so that's what this created for us. So now we would like to create our own controller. And our goal in this particular application that I want to build is not about cats and dogs, not this, but even simpler, very, very simple. So it's trivial. It's more like Hello World. So what I want to show is, I like to show when people visit our application, I want to show them the time right now is whatever the time is. So whatever the time right now is, it should show up. That's the app. That's it. I would like to create an app that shows the time, the clock app. This is my clock app. It will show a time of right now depending on the user's browser. At that point in time, it will just show the time. That's the entire app. So we want to create a view to show the time. And we like to create a controller to welcome people. When people visit our website, say some url.com or whatever that DLD, top level domain is, followed by slash, then we need to let them visit this site. And that page should render. This page, also known as the welcome page, should show that the page should pop up. So I need to write a piece of logic that looks at the url coming in and send a page to welcome people. I want to call it the welcome controller. So I'm writing a welcome logic like that. In fact, I'm not even writing. I'm generating it. I am going to generate that logic right here. As a consequence, you will see something happen. Let's see what will happen. By the way, before I run it, I break it, I break it. Before I run it, what I want to do is I want to git initialize and then git add and then git commit. So now I have my entire folder called my app in git control under the new hash, the new commit hash. This is the commit hash I have. And I have kept this in my git repositories control. So now I can see git status and I see that there's nothing to commit because it's all clean and it's all been committed already. Now I will generate a new controller. So when I generate a new controller, you will see what happens. It creates new files and puts them in the right folders. For example, it created an application controller called welcome controller and put that in the controllers folder in the app folder in here. This is a new file. It created automatically and you can let me just close Atom and open it up again to help us understand a little bit better. So I'm closing Atom and I'm opening Atom again. And this will show you in Atom what the changes are. So Atom is able to understand Git and as a consequence, you should see some of the things are in green color. The green color shows that you created something and that same green color pops up in here as well as in the controllers folder and in assets folder. There are some new JavaScripts and a new style sheet. And these are the new files created, all the green items. You can see they are basically there's a welcome file in the view section. So we should go to the views folder. And in the welcome folder, there's a new folder created for us. There's a test unit created for testing in the test folder. So we should be able to see that in the test section right there. There's a controller for welcome controller testing. And so these structures are automatically generated for us. So you don't have to worry about missing a thing or two because it generates it for you and it puts them in the right folders already. Having understood this piece, let's go further. And what I want to do now is to actually create the view. A view that I want to show people is to show them the time. And so I will have to have a HTML file pop up. And that file I need to create. I need to create that file right in our folder here. And this file will go create in this location. App view welcome, meaning app, and then views, and then the welcome folder. That's what I would like to have that file created. Create a new file index.html right in that view section or the welcome subsection. Create that. The file popped up there. This is the file. It is empty right now. So I need to fill it up. And what I will do is fill up very, very simple HTML code to indicate the time. And this is the actual code I will write now. Everything else is generated. So I'll grab this piece of code and drop it in there. And let's go see the code, what that code is. So it's very simple. The code is basically showing in line number two. It says the time at this moment is, and this is the actual Ruby expression of the current time in the user's browser. Whichever browser they have, the current time zone set, that time will pop up on their machine. So the time.now is a Ruby expression indicating the current time of the user's browser. So this is the expression of Ruby evaluation. It will then express the time and show up in a string and will show up right in place of this expression. So it will show the time at this moment is and the time at that moment. That's what we'll show when we run this app. So we'll close the view right now. And back to the command line. So we created a new view. We also generated a controller for us. Let's see what else. We have to now decide what happens when a user visits the website. That action needs to present the view to the user. That's the action. So for that, we need to change the routing of our application's logic. What happens when somebody says visit this Cloud Genius website followed by slash, meaning go to the root of the page. When somebody visits that page, it shows you this view. That action is called routing of logic. You can change the route to some other route and you can say that go to cloud dev ops. And then if you enter, the logic will understand that the user wants to visit the dev ops segment. So it will present the view corresponding to cloud dev ops like right there. And it will generate the view and show it to you. Cloud dev ops shows up. Same thing again with any other view. So you want to go here to Nilesh as a route. So here information about Nilesh will pop up like right there. And that's how a routing logic works. You want to create such a routing logic for the main route, which is the slash route with nothing. Slash as in slash followed by nothing. So that route we want to create for which we need to configure our routes. So we'll go to the routes file. There's a file already there. You want to go look at it in the configuration right there. And there is a routes file already right here. And in that file, what I want to really do is to uncomment line number six like this. Remove the hashtag. Uncomment. By doing like this, what I'm saying is whenever a user lands on the root of the website, which is the slash route or the main route, send them to the welcome index page. Show them the welcome index view, which is our view in the application. Views, welcome, index. That view should be shown to them, which is the one we just wrote. That's the routing logic I put in in my routes configuration. In the config routes.rb, I modified my route route asking my application to show them the welcome index view. And then I save my route. So my routing is now in place. Next, what I will do is to test out my application locally right in the workstation right here. I want to see my app. Is it working? I can very easily run it locally. Rails, please run it for me. I'll say Rails server. So it runs. And it tells me that I need to go to port number 3000 on the local machine. So we'll open localhost port 3000 and see what we have. We should see the application right here when I visit localhost and then port number 3000. And I see something. What do I see? OK, so the app runs, at least in my local machine. It tells me exactly what I expect. Hello, Clump Genius. The time at this moment is, and then whatever the time is. This time is on the machine. The machine is in universal time zone. As you can see, it is 1.52 a.m. tomorrow on April 12th. That's how the machine is configured. And so it is UTC time zone. That's why it's showing you that time. That's what you see. So this is running fine in a local machine setup, which means I am happy about it. Which means I'll break this server and then review my Git status. I see that there is a modified configuration for the routes configuration. I see that there are a bunch of files I created, these files. Actually, I did not create them. I generated them. I did create a view in the welcome file, in the welcome folder, in the app view. That is the only contribution I made. Everything else was created by DHH, the person who created Rails. I just used their software and then I added my piece of view. The view is what you just saw when the application opens. Now I want to put all of these things in a Git commit, which means I git add and git commit. Like that. Now you see that Atom stopped showing the green color because they're not new anymore. So Git status should show clean. And now git log should show you the two entries, initial application generated, and I created my application. So two commit hashes show up, one and two. This is the first one. This is the later one. Now we check git remote. We have no remote connections. So what we need to do is to establish a remote connection between my folder and Heroku. So I can push. And once I push, I'm done. Literally done. So let's see what we need to do. So we saw the app running locally and all that good stuff. Then we go next step. And we have to somehow get a remote connection. So for that to happen, we need to edit our gem file a little bit. And that is necessary. It is necessary because we want to match what Heroku expects. And so Heroku expects us to use this gem called Rails 12 Factor. And they want us to use this Ruby version. We want them to use this Ruby version. So we have to communicate to, let's see what version of Ruby we have. It is 2.3.1. So we want to let Heroku know that I want to use 2.3.1 version of Ruby. So I need to add that line into my gem file. So here in my gem file, that one, I need to let Heroku know that I intend to use this version of Ruby. And Heroku is telling me in the documentation that you need to use this gem in production. So I'll add both these lines in our gem file and synchronize what we are doing in here and what Heroku would do there, basically match it. So here we go. Two new items added. One is a new gem. And this is an indicator to Heroku that I will be using Ruby Rails, sorry, Ruby 2.3.1. So closing that file. And we modified our gem file, which means we need to bundle update. So we'll run bundle update again right here on the command line. And what this will do is install that missing gem, which is the Ruby 12 factor gem. And that piece will be installed. We should look for it in the list here. It should be there somewhere, right there. Rails 12 factor gem got installed. And then we'll further proceed forward. What we want to do is our username that we have in our machine is the user user, right there, user user. Our database user is also called user. And the role is also called user. And these details, Heroku has no idea what the username is on your laptop because it's probably different. So we want to anonymize it in a fashion that Heroku will understand and will work smoothly and seamlessly with Heroku. So we want to make a couple of changes in addition to what we did for our database interaction. But we need to modify our database connector in the configuration for database in that file called database.yaml. And specifically remove this line called username myapp from this file. So we'll do that. We'll go to that file and remove this reference to username myapp. That is unique to our laptop. So we will have to go to our configuration and look at our database yaml. And there is a line called username myapp, which should be somewhere at the bottom, like right there. The line should be deleted because the Heroku cloud has no idea whether you call your folder myapp and whether your username is myapp or not because this is going to be running in production in Heroku. So that is not relevant. So we'll strike it and save. And so what we are really telling Heroku is that this database myapp development should be run under the role of myapp as opposed to a username called myapp. That's what we have removed. With that done, we would like to cross-check what our database yaml looks like with what we have in this particular website. So you see there is a default section that looks like this. Let's go compare it side by side. It's easier to do side by side comparisons. So we'll adjust our 50-50 screen real estate like that. And then look at database yaml. And here you will find that there is this section called default at the very top. It actually most of this at the very top is commentary. So you can just remove that commentary. All the hashtags are comments. So we can remove them and then you find that this section called default shows up. Adapter, Postgres SQL, Encoding Unicode. There are more comments here. Line number four and five are comments. Pool five. Then we have a section on development with a database called myapp development. So we have exactly that matching. Then there are more comments. We can remove them. To simplify our reading, ease of reading, so we'll just remove all these commentary. And then we have a test section for default and myapp test. That's what we have here. And then we have, just to clean up, this commentary can also go. We have line number 14, also more commentary. So we remove all the commentary there. And then this is what we have. We'll save all the changes we made. The actual change we made was this line deleted after this line called user name. My app was removed from the production section. So now we have a database YAML file that matches what we have here already item by item. And with that change, we'll close this file and go back to our git status and find out that we have made some changes. So we need to make sure that those changes are captured. So git status should show us that there is a gem file modified. Gemfile.lock is a consequence of running bundle update. That is also modified. And config database YAML is also modified. So we'll need to make these incorporation into git add and git commit. And then git log should show you three entries. The database edits we make, application created. And now you are storing your application in the git repository. And now you want to create a placeholder for your app on Heroku.com. Just like we created a room for our GitHub repository, you have to create a room for our Heroku app. Sorry. Room for our app on Heroku website. So currently we don't have any room in Heroku for us. So we can see that we don't have it by checking for a git remote. There is no remote connection. So we'll create a new room for us by running another command. The command is called Heroku create. So this Heroku create command, what it does is creates a placeholder for us to run our application there, like that. So it creates this application placeholder. As a consequence of this, you will find that there's a new remote connection right here. This remote connection is not connecting to GitHub, but it is connecting to Heroku. You have a fetch connector and a push connector. We are almost done with the exercise, by the way. So now the last step is to push our app. So we'll say git status, and then we push. And we are done. By the way, exercise is complete. Now expect to see Heroku showing us a complete website with HTTPS secure and a URL given to us showing us our app. That URL will be, by the way, they already gave it to you, right there, right here. This is the URL we expected to show up. And we will reach that location right now. And then you will find there is nothing because the application is currently actually doing a bundle install in Heroku right now. You can see that it is actually installing Ruby 2.3.1, running the bundler command and fetching all the gems from RubyGems website. And then it will package it up all nicely, install all these missing pieces in Heroku for us in our application and run gem install bundler and all that will do for us. And as a consequence here, you will have this thing showing us your application. It is not ready yet because we know it is still doing its thing. But now it tells you that it is verifying the deployment. It was done deploying. So you should now visit the app at that location. So let's go visit right there. And what do you see? You see exactly what you expected to see. And you see that the time at this moment is whatever it is. And here is the link. You should see it. Oh, by the way, I missed H. So here is the link. You should see it. It is completely deployed and I didn't have to do anything. I didn't do anything other than what did I do? I did check my remote connection. I created a placeholder in Heroku. I checked my remote connections again, checked my git status, and I push. Then I'm done. That's how you use a platform as a service. You match exactly what their requirements are with what your requirements are and synchronize and push. You don't have to worry about machines. Don't have to worry about service, scaling, deployment, size of the machine, how much RAM, which network, which VPC, which oh my God, nothing, none of that. Because this is a different use case. Let them handle with all the complexity that we dealt with before. We saw how a VPC can be in terms of the detail that is needed to make things happen. Yes, even that one will be automated, but that's a different role. This is a developer, software developer role. They don't need to worry about infrastructure. They just push, make it push, and they're done. They expect an application to show up like this, complete with a certificate. And it did. So that's what platform as a service is. Now with that, I will stop recording. I'm still open for questions, and I will ask you to please read that book summary. I will enable access for you. In the meanwhile, you could also order the book and read it. If not right away, remember to read it at least at some point because it is actually a good book. No kidding. You will stand to benefit. By the way, let me tell you this is the book that I told you about the book I said. What was the book? The goal book. The goal book has nothing to do with technology. Nothing. But still read it. It is actually a good book. Hey, I see that the goalie book is $2.99. $1.99 also there. That's the way to get it. Not on Amazon, but on Barnes and Noble. $2. Much cheaper. Now I cannot click on that link because it is going to be disabled for me. If I click on that link, boom. That is an advertisement blocker. So that's a different thing I will discuss later on. I have an ad blocker in my home network that doesn't allow any ads to appear. And so if I click on an ad by deliberate choice, nothing happens. But that's a different discussion we will have later. That's a different tool. I think you should use that. You should absolutely use that tool. It's beautiful. It cleans up. In fact, this is how it looks like. It cleans up your entire home network. Like you can see domains that I'm blocking currently, 121,000 and all that. So you'll see a lot more detail. We'll discuss these also. But for right now, let us stop recording. And I would like you to.