002 [Hands-on] Cloud Shell - 1

  • last month

Category

😹
Fun
Transcript
00:00Another way to interact with the Google cloud platform resources are a cloud shell.
00:07And throughout this whole course, our main recommendation way to interact with the cloud
00:12services will be on a cloud shell because that is like a command line utility.
00:18So let's see some of the features of cloud shell and then we will move towards how to
00:23start or activate the cloud shell.
00:26So the first one is, it's a Linux instance and you can access it from the browser.
00:34So you do not need to install anything directly from your browser.
00:38You can connect with the Linux instance and inside the Linux instance, you can write all
00:42those command line utilities to interact with the different resources available inside the
00:47GCP.
00:49You can manage all your infrastructure and develop your application directly from the
00:53browser and that is one of the most beautiful thing.
00:58Next one, as I told, no installation is required with just one single click, you will be able
01:04to enter inside the cloud shell and from there, there will be some command line utilities
01:09are available like a Gcloud.
01:11So Gcloud is one of the very important SDK tools are available, which is by default pre-bundle
01:17installed inside this cloud shell and through various commands are available in this Gcloud,
01:23you can interact with the different services available in GCP.
01:27You have by default installed all those development stuff like Python, Java, Docker, Git and many
01:33more stuff.
01:34I'll show you what are the things which is already pre-bundled with that.
01:39And it is always up to date with Google Cloud Shell, you do not need to even update this
01:45Gcloud utility, you will always get a latest version of Gcloud.
01:51So what we'll do?
01:52Let's just go to this particular link or I can just simply search for Cloud Shell.
02:06And mostly, the very first link will appear like Cloud Shell, Google Cloud Platform.
02:12There are many more features are available, so that will be the online development and
02:18operation environment.
02:19And there is a full-fledged shell editor is also available, full power access from
02:24anywhere.
02:25So from anywhere you can access this Cloud Shell, it's a developer ready environment.
02:31So as I told, you have a complete Cloud Shell editor is available, I will show you how we
02:36can activate it and how we'll just have a walkthrough in this particular video about
02:42this Cloud Shell and later on, we will see that how we can create those buckets from
02:47this command line utility.
02:49So we have already supports for Go, Java, NodeJS, Python, C Sharp, .NET, Minikube, Kubernetes.
02:58Your favorite tools are already pre-bundled and installed like MySQL, Kubernetes, Docker,
03:04Minikube and many more things.
03:06Yeah, so that one of the very important thing is 5GB of persistent storage disk, you will
03:13get it.
03:14So with every single Cloud Shell, Google will provide you 5GB of persistent storage.
03:20So you do not need to worry about losing of data, but there will be one cache here.
03:25So later on, I'll tell you that what exactly those caches are, because this is like an
03:30ephemeral virtual machine.
03:32So the moment you restart, everything will be lost apart from one single place that is
03:37nothing but your home folder.
03:39All right.
03:40So without wasting much time on this different feature, let's just explore those features
03:48directly inside the browser.
03:50So what I'm going to do, I'm going to sign in into new tab.
03:55Let me sign in with our active account of GCP.
04:00Provide your password.
04:04All right.
04:05And let's just go to console.
04:12Now you can see in the resources card, we have one bucket what we created while exploring
04:20this web console part.
04:22Now we are going to learn about another way to interact with this GCP resources.
04:27So on a top navigation or a panel bar, you can see there is one option like activate
04:34cloud shell.
04:35So just click upon it and there will be one pop-up appear on the bottom of your screen.
04:41So that will be a cloud shell terminal.
04:45You can even scroll up and down also.
04:48So this way you can make its height little bigger or smaller.
04:54So this is like a complete full-fledged Linux machine Google has provided to you to interact
05:00with the different resources.
05:02And most important thing, as I told, a command-line utility gcloud through which the various services
05:08you can provision, which is by default bundled with this ephemeral virtual machine.
05:15All right.
05:16So let's just focus upon some of the features.
05:19But before that, let me just increase the font.
05:22So it will be visible to you.
05:25So there are a lot of options are available.
05:27One is open editor.
05:28I'm just going into terminal setting first.
05:32And inside the terminal setting, we have a text size.
05:35So let me just make it a large.
05:37Yes, that's perfectly OK.
05:40Now, you can see currently my project, my first project and its ID is central-muse-300815.
05:49So by default, when I open this activate-cloud-shell, by default, this is the default project got
05:59selected inside the shell also.
06:00So every single call you do to provision any kind of resources to interact with any kind
06:05of resources, all those calls are completely authorized and authenticated.
06:11So there is no point to discuss about how it is going to get authenticated.
06:18All right.
06:19Let's see a few more features.
06:21So from terminal preference, you can change the font.
06:25I'm just going to continue with the same one.
06:29We have a copy setting.
06:31So the moment you select something, it is by default copy.
06:34So that is all preferable options.
06:35So let's say this is the command they are suggesting me to use it.
06:40The moment I copy or select it, it is just got copied.
06:44And based on whether you are a Windows machine, Linux machine, equivalent, Ctrl-V or Command-V,
06:50you can always use it to paste your stuff.
06:54All right.
06:55Let me just go back.
06:56Now, you can see there are many real estate, it is already being occupied.
07:02So what I'm going to do, I'm going to write one simple command like ps1 is equal to in
07:09quotes $.
07:11So what happens that this whole part will be wiped out.
07:15But before it gets wiped out, I just want to highlight one more thing that this is like
07:19a complete Linux machine cell they have provided to us.
07:24And this is the project in which we are going to provision all our resources.
07:29So let me just execute this one.
07:32Oops, I have to write I guess export.
07:38Yes, so we are inside this $ sign.
07:44So it won't be visible this many space.
07:47So when you write a very big command or a very longer command, in that case, you will
07:52have a much more real space.
07:55All right.
07:57Let's see is there any other thing we can do.
07:59There are some keyboard shortcuts and scroll bar.
08:02So let's just keep it remaining stuff as it is.
08:05Now what we will do, yes, a few more options.
08:10I want to show you that if you want to restart your machine, you can always do it from here.
08:16Now the moment you restart, you can see we are currently in a working directory of home
08:22GCP training 2020.
08:25Now you might be thinking that this particular cloud cell has been connected with one project.
08:32So that is like a by default project got set up, but it has no connection with any
08:37of the projects.
08:39Even if your billing got exit this $300, you don't have any billing account.
08:44Still this particular cloud cell has been attached to your email ID.
08:49That's why this particular email ID based on that they have created one user inside
08:54this cloud cell.
08:56So even if you don't have any credit card or anything, it's inactive credit card, still
09:01your cloud cell will always work.
09:04But you won't be able to provision any resource.
09:06So there is no point to go ahead.
09:08Alright, restart.
09:11If you want to let's say upload some file, you can always do it from here.
09:14So what I'm going to do, upload, let's say this cat1.
09:20So cat1 got uploaded.
09:21If I just do ls, and you will be able to see this cat1.jpg got uploaded in my current working
09:28directory.
09:29Remaining two file was already exist in my case.
09:33If you want to download some file, you can just download and provide the path here, it
09:38will be downloaded.
09:40And we have a users quota and users statistics.
09:44So these two are very important.
09:46So what I'm going to do, let me click on users quota.
09:51And here I want to highlight one thing that cloud shell has a weekly users limit.
09:57So if you reach this limit, you will need to wait for next cloud shell again.
10:03So what they are saying that every single week, you will be able to use this 50 hours.
10:07And till now for this particular week, I haven't even started using it, this is the first time.
10:12So so far, I have just used a zero hours of 50 hours of quota limits.
10:19And it will be reset again on 19th Jan.
10:22Currently it's 14th Jan.
10:24So it will be reset on 19th Jan.
10:26So it got reset on 12th Jan.
10:30Alright, so 50 hours of free usage of cloud shell you will get with every single account
10:36on every single week.
10:39And we have a users statistics also.
10:42So if you need more information, you can use it.
10:46I don't think is there any other special things about it, but whatever uses you do, if you
10:53want to share with Google, you can always do it.
10:56Alright, let me just cancel it.
10:59And we have some of the things about the cloud shell privacy policy help you can always see.
11:06Alright, next one will be if you let's say want to minimize it.
11:10So you can just simply minimize it and on your cloud web console, you can just start
11:16working upon it.
11:17So let me just close this transfer file stuff and again, you can even restore it or maximize
11:24and whole cloud shell terminal will appear.
11:28Now there are two more things.
11:31First of all, if you want to open the same thing into a completely new window, so you
11:36can just click upon it and the same cloud shell will be opened into a completely new
11:43tab.
11:44So you can see we'll have now even bigger real hashtag.
11:49So we can work even comfortably that what's going on.
11:54Now apart from that, we have an open editor also.
11:56But moment I shifted from this tab to this tab, the next immediate tab on this cloud
12:03shell, you can see your session was transferred to another browser tab.
12:07You can disable this from this Tmux setting, but that's okay.
12:12We want to work from here.
12:14So that is another cool feature.
12:16And there will be one more thing I want to show you, which is open editor.
12:20So if you just click on open editor, it's unable to load code either because third-party
12:26cookie got disabled.
12:27So I'm not sure how to enable it.
12:32Two third-party cookies got blocked, site cannot use them.
12:36So what I'm going to do or open into a new window, they are suggesting opening into a
12:40new window.
12:41Let's just try with that.
12:45Yes, so this is like a cloud shell.
12:50And let me close this editor.
12:53Exactly on a same current working directory, we'll have all those files are available like
12:59cat1.jpg.
13:00You can see there will be one file I got created earlier, we have a readme.cloudshell.txt.
13:08So this is like a full-fledged editor.
13:10From here, you can create a new file, edit the file, we have selection, view, go, debug,
13:16terminal, everything is available.
13:18So it's like a full-fledged editor Google is giving you inside your browser and a complete
13:23terminal is also available with you.
13:26Alright, so that is about the cloud shell.
13:30There will be a few more things I want to discuss about the cloud shell.
13:32So I'm just going to reconnect on my main window and let me just close the remaining
13:39two stuff.
13:42So here what Google cloud shell will offer to you.
13:46So as I told, we have by default Python is installed.
13:50So we are inside the Python.
13:51So Python 2 is anyhow debricated.
13:53Let me just come out from here.
13:56And if you just want to wipe out everything, there will be a shortcut like Ctrl-L or you
14:01can just simply use like a clear command.
14:04So python-version and you can see we have Python 2.7.16 got installed.
14:13Let me try with Python 3.
14:17Let's see whether Python 3 is installed or not.
14:19Yes, Python 3 is also installed.
14:22Let's try with Node.
14:24Yes, Node is also installed.
14:27Let's try with Java.
14:30Yes, Java runtime is also installed.
14:33So you can see with this virtual machine, lots of developer tools, all those command
14:38line utility is also available.
14:41Let's try with one of our very favorite tool like a git.
14:45And git version, yes, git is also installed.
14:48We have not just the programming language, but we have a docker also.
14:52So I'm not sure whether this is yes, docker is also installed.
14:56Let me try with, is there anything what we can try?
15:01Java, Python, I think .NET, let me just, yes, .NET is also there.
15:10Let me press Ctrl-L and everything will be just wiped out.
15:13So you can see that is the beauty here that majority of developer level tool, what you
15:19require, you do not need to install anything.
15:21But apart from that, there will be one more utility I want to show you.
15:25And that is nothing but a gcloud.
15:27Yeah, so gcloud is one of the very important thing through which you are going to interact
15:33with different resources.
15:35Although this video is anyhow getting a bit longer.
15:39So what I'm going to do, gcloud is a special command line utility specifically for providing
15:45resources.
15:46So what we'll do in the next video, we'll have a detailed discussion on this gcloud.
15:52And what exactly gcloud are?
15:54And gcloud has always most up-to-date versions are available inside the cloud shell.
16:00Alright, so that is all about this video.
16:03See you into next video.
16:04We'll have a continuation on this Google Cloud Shell.