1 00:00:01,130 --> 00:00:04,490 All right if you're still here watching this video I'm going to assume that you want to go through the 2 00:00:04,630 --> 00:00:09,940 up process and run all of our code in a development environment using Google Cloud which is going to 3 00:00:10,010 --> 00:00:15,360 unequivocally solve all of our performance issues let's first get started with a quick overview of how 4 00:00:15,360 --> 00:00:19,470 we are running communities on our local computer right now and how we're going to run it through Google 5 00:00:19,470 --> 00:00:20,380 cloud. 6 00:00:20,420 --> 00:00:23,430 This is a diagram of what's going on on our machine at present. 7 00:00:23,430 --> 00:00:24,630 We got your computer. 8 00:00:24,630 --> 00:00:28,110 We are running a single Cuban 80s node now on there. 9 00:00:28,110 --> 00:00:30,890 We could possibly have many different pots. 10 00:00:30,930 --> 00:00:36,000 At present we probably only have one pod that authentication pod but eventually we're gonna have many 11 00:00:36,000 --> 00:00:37,300 different pods. 12 00:00:37,500 --> 00:00:43,440 We can open up our browser and access that node using the ingress engine X server we just configured 13 00:00:43,470 --> 00:00:45,480 in the last couple of videos. 14 00:00:45,480 --> 00:00:47,700 So that's what's going on right now. 15 00:00:47,700 --> 00:00:52,560 Here's what's going to happen once we start to move all this stuff out to Google cloud your computer 16 00:00:52,620 --> 00:00:56,790 is still going to be running say a browser or something like that trying to access our different pods 17 00:00:56,820 --> 00:00:58,700 and test out some code manually. 18 00:00:59,010 --> 00:01:03,500 But our entire communities cluster is going to be running on a Google Cloud virtual machine. 19 00:01:03,780 --> 00:01:07,750 So no longer are we going to be running Cuban ads on your computer whatsoever. 20 00:01:07,770 --> 00:01:10,930 Instead we're going to leverage some remote computer. 21 00:01:10,930 --> 00:01:16,880 So we're gonna have a node somewhere out on the cloud that's running all of our different pots. 22 00:01:16,890 --> 00:01:21,300 Now the reason this starts to get really relevant is that you have to really understand what scaffold 23 00:01:21,300 --> 00:01:22,430 is doing for us. 24 00:01:22,440 --> 00:01:26,790 You see scaffold is going to be the real tool that's going to allow us to set everything up on google 25 00:01:26,790 --> 00:01:29,490 cloud very very easily. 26 00:01:29,490 --> 00:01:34,110 You might be curious why we're using Google cloud at all by the way as opposed to NWS or something like 27 00:01:34,110 --> 00:01:34,400 that. 28 00:01:34,740 --> 00:01:38,000 Well scaffold was actually developed by teams at Google. 29 00:01:38,010 --> 00:01:42,150 So scaffold has a very very tight integration with Google Cloud in general. 30 00:01:42,150 --> 00:01:45,900 That's why we using Google Cloud in particular. 31 00:01:45,920 --> 00:01:46,190 All right. 32 00:01:46,370 --> 00:01:49,690 So here's what's going on behind the scenes with scaffold. 33 00:01:49,850 --> 00:01:55,100 We're going to add in some additional configuration to scaffold and tell it that we wanted to use some 34 00:01:55,310 --> 00:02:02,170 node hosted on Google cloud as opposed to a local node on our machine scaffold you might recall is not 35 00:02:02,170 --> 00:02:06,760 only going to create all of our different services and deployments and all that stuff it is also in 36 00:02:06,760 --> 00:02:12,270 charge very critically of handling changes that we are making to our project as well you might recall 37 00:02:12,270 --> 00:02:16,650 that there are two types of changes that we can make to a file or a project when we're making use of 38 00:02:16,650 --> 00:02:17,610 scaffold. 39 00:02:17,610 --> 00:02:21,450 We either make changes to a file that is syncs or unsafe. 40 00:02:22,230 --> 00:02:28,640 So if you go back over to our scaffold config file right now we listed out the sync section right here. 41 00:02:28,640 --> 00:02:34,280 And this meant that any time that we made a change to a file matching that pattern just take that file 42 00:02:34,310 --> 00:02:37,850 and sync it with a corresponding pod inside of our cluster. 43 00:02:37,850 --> 00:02:41,090 So in that scenario we were not rebuilding any image or anything like that. 44 00:02:41,090 --> 00:02:47,490 We were just taking the change file and sticking it directly into a pod so this diagram is laying out 45 00:02:47,490 --> 00:02:54,160 that scenario the case in which you make a change to a sync file so on your computer you're going to 46 00:02:54,160 --> 00:02:58,150 be writing inside of your code editor and at some point time you're going to change a sync file. 47 00:02:58,240 --> 00:03:01,240 So in our case again that's going to be a typescript file. 48 00:03:01,240 --> 00:03:07,090 Then whenever we save that file scaffold will detect that change scaffold will then be configured to 49 00:03:07,090 --> 00:03:13,960 reach out to Google Cloud to reach out to the node that is running this specific pod and take that change 50 00:03:13,960 --> 00:03:16,680 file and stick it directly into that pot. 51 00:03:16,810 --> 00:03:23,060 And that's how updates are going to be processed now scenario two where we change a knot sync file is 52 00:03:23,060 --> 00:03:27,800 a little bit more complicated and that's the real thing I want to show you with these two diagrams. 53 00:03:27,800 --> 00:03:32,600 I want you to understand what happens when we make a change to a file that will not be automatically 54 00:03:32,600 --> 00:03:39,810 injected into a pod so let's imagine that we make a change to say our package not JS on file when we 55 00:03:39,810 --> 00:03:40,730 change that file. 56 00:03:40,740 --> 00:03:45,690 It does not get automatically injected into a pod because we did not listed inside the string section 57 00:03:45,690 --> 00:03:46,740 right here. 58 00:03:46,830 --> 00:03:51,000 Whenever we make a change to the package not just on file that is a sign that we want to completely 59 00:03:51,060 --> 00:03:57,650 rebuild our off image and then update some corresponding deployment inside of our cluster. 60 00:03:57,770 --> 00:04:03,820 That would be at scenario number two where we change an unsinkable file so on our computer we're going 61 00:04:03,820 --> 00:04:08,710 to open up our Ed and we'll make a change to a file that is not listed in the string section again something 62 00:04:08,710 --> 00:04:15,790 like the package that JS on file scaffold will detect that and it's going to add in an extra step scaffold 63 00:04:15,790 --> 00:04:22,540 is going to reach out to a service that runs inside of Google cloud called Google cloud build this service 64 00:04:22,600 --> 00:04:28,510 is all about building Docker images to scaffold is going to take all of our source code for your project 65 00:04:28,830 --> 00:04:34,790 that's going to upload it to Google Cloud bit built along with the docker file for that specific project. 66 00:04:35,080 --> 00:04:41,470 Then on Google Cloud built some builder process is going to build our image for us the whole reason 67 00:04:41,470 --> 00:04:46,120 that the image is being built on Google cloud it just so we decrease the number of resources that are 68 00:04:46,120 --> 00:04:48,450 being consumed on your local machine. 69 00:04:48,610 --> 00:04:53,470 In addition building the image is going to be a lot faster because Google Cloud servers have extremely 70 00:04:53,530 --> 00:04:56,250 extremely fast internet connections. 71 00:04:56,470 --> 00:05:00,370 And as you're going to see a little bit later on we're eventually gonna have a couple of projects or 72 00:05:00,370 --> 00:05:06,700 subs projects inside of our project that have very large numbers of dependencies maybe not very large 73 00:05:06,700 --> 00:05:11,960 numbers but we can have dependencies that require downloading something like 200 or 300 megabytes. 74 00:05:12,010 --> 00:05:15,580 So if you are on a slow computer it might take or have a slow internet connection. 75 00:05:15,580 --> 00:05:18,960 It might take you a long time to re download all those dependencies. 76 00:05:19,010 --> 00:05:25,030 Anytime that we have to rebuild an image by making use of Google Cloud built you are going to be able 77 00:05:25,030 --> 00:05:30,700 to install all those dependencies in a matter of seconds as opposed to possibly a matter of minutes. 78 00:05:30,730 --> 00:05:36,250 So Google cloud build is going to be in charge of rebuilding all of our images once the image is rebuilt 79 00:05:36,730 --> 00:05:41,830 scaffold will then reach out to the corresponding deployment on our node and tell that deployment that 80 00:05:41,830 --> 00:05:48,150 there is a new image available the deployment will then restart restart all of our pods using the latest 81 00:05:48,510 --> 00:05:51,070 updated image okay. 82 00:05:51,110 --> 00:05:51,700 So that's it. 83 00:05:51,800 --> 00:05:54,050 That's what's going to be going on behind the scenes. 84 00:05:54,100 --> 00:05:57,850 So in the coming videos we're gonna do a pretty good amount of setup. 85 00:05:57,950 --> 00:06:00,580 We're going to of course have to sign up for a Google cloud account. 86 00:06:00,620 --> 00:06:05,600 We're going to create a project we're going to set up a Cuban entities cluster on Google Cloud. 87 00:06:05,690 --> 00:06:11,390 We're going to configure Google cloud build we're going to configure it scaffold then to use google 88 00:06:11,390 --> 00:06:14,420 cloud build and this remote cluster as well. 89 00:06:14,420 --> 00:06:17,030 So it really is a pretty good amount of setup. 90 00:06:17,030 --> 00:06:22,430 And again all this stuff is being done so that we can have a development environment running through 91 00:06:22,430 --> 00:06:29,200 Google Cloud which in theory should be way faster than local especially if you're on an older machine. 92 00:06:29,280 --> 00:06:31,830 So we really do have a good amount of work before us. 93 00:06:31,860 --> 00:06:34,890 So let's take a pause right here and get started in the next video.