WEBVTT 00:00.540 --> 00:07.800 In the previous demo, we used the Vim command line, Ed, to create our part, the finishing file. 00:08.610 --> 00:15.390 We created a pod called Engine X with a couple of labels and we use the Engine X image. 00:16.140 --> 00:22.650 Now, while this works well, the Vim editor is quite basic and it can be quite difficult to make use 00:22.650 --> 00:27.810 of them if you want to create and edit long or even large number of YAML files. 00:28.350 --> 00:31.800 The same goes with notepad or other tools in windows. 00:31.860 --> 00:34.560 They are very basic and prone to errors. 00:35.070 --> 00:37.590 They don't really tell you if you made a mistake. 00:38.520 --> 00:47.400 The Cuban netas object definition files using Yamas can be developed much easier using I.D. tools. 00:48.160 --> 00:55.080 Now there are many ideas out there that are free to use, such as those from jet brains, intelligent 00:55.080 --> 00:57.090 idea and pie charm. 00:57.630 --> 01:04.470 Adam is another free tool eclipse or net beans that a lot of Java developers use. 01:05.280 --> 01:07.890 And all of these come with support for Yamal files. 01:08.250 --> 01:15.180 And they will help in highlighting errors in a Yamal file and make making sure that you develop them 01:15.180 --> 01:15.540 right. 01:16.230 --> 01:22.250 But they won't natively tell you if there are errors within the coronets manifest files that you are 01:22.250 --> 01:22.770 developing. 01:23.010 --> 01:28.710 For example, if you typed in the wrong property name or if you are using a dictionary instead of a 01:28.710 --> 01:29.250 list. 01:30.260 --> 01:37.110 And that's where you need some kind of an extension or a plugin that could help point those out for 01:37.110 --> 01:37.320 you. 01:38.280 --> 01:45.660 So those tools that can first verify the structure of your YAML file and the syntax, making sure that 01:45.660 --> 01:46.170 works fine. 01:46.590 --> 01:51.440 And also point out errors related to coronets. 01:51.730 --> 01:51.920 Right. 01:53.190 --> 01:54.300 Support for communities. 01:54.960 --> 02:00.240 And so these ideas come with support for extensions and plug ins that can help with that. 02:01.020 --> 02:04.890 And those plug ins could either be free or paid. 02:05.490 --> 02:14.160 Now, one IDC that we found that is freely available and works on all different operating systems and 02:14.250 --> 02:17.160 also has a free extension for Yamal. 02:17.160 --> 02:20.910 Validation for cabernets is the Microsoft. 02:20.970 --> 02:23.260 We show studio code IDC. 02:24.210 --> 02:26.280 It's easy to set up and get started. 02:26.370 --> 02:33.380 And so we will use that as our IDC for the rest of this, for the rest of the demos and discourse. 02:34.270 --> 02:37.230 Now, you don't necessarily have to use the same tool. 02:37.590 --> 02:45.000 Feel free to use any idea of your choice and try to find a plugin or extension that can help with developing 02:45.000 --> 02:45.480 coronate. 02:45.500 --> 02:49.170 Is Yamal files for the idea of your choice? 02:50.310 --> 02:53.040 So in this demo, we're going to first install a V. 02:53.070 --> 02:53.640 S code. 02:54.480 --> 02:57.110 So here I am at the code dot. 02:57.240 --> 02:59.220 We shall sudheer dot com website. 02:59.460 --> 03:05.700 And since I'm running on and a boon to base distribution, I'm going to download the Debian package. 03:06.060 --> 03:11.100 It should automatically list the right version to download for you. 03:11.120 --> 03:14.280 Depending on your operating system and it has its sights here. 03:14.790 --> 03:17.700 We show studio code is free and open source software. 03:18.300 --> 03:20.400 We will wait for the download to complete. 03:22.340 --> 03:26.910 The download has been completed, and since it's said to be in package, I'm just going to install it 03:26.910 --> 03:28.080 directly on my system. 03:39.910 --> 03:41.980 So let's wait for the installation to complete. 03:44.160 --> 03:48.790 The installation has been completed now, and I'm going to launch V. 03:48.800 --> 03:51.540 S code once open. 03:51.780 --> 03:54.690 This is what it would look like after a fresh install. 03:55.350 --> 04:04.470 So we will go to the extensions section first and search for YAML and look for the extension, which 04:04.470 --> 04:05.910 is published by RedHat. 04:11.550 --> 04:17.280 This is the extension that has support for cabernets, YAML files in most cases. 04:17.490 --> 04:21.090 This particular Yamal extension is installed by default. 04:21.720 --> 04:26.790 But if it's not in your case, then you'll see that here and you can go ahead and click on the install 04:26.790 --> 04:29.640 button to install and enable it. 04:30.500 --> 04:36.240 Now, before we get started with developing overlanders definition files, using this extension, we 04:36.240 --> 04:44.040 have to make a small change in our settings to configure we as code to use the amole extension for communities 04:44.220 --> 04:44.820 files. 04:44.970 --> 04:45.240 Right. 04:45.930 --> 04:53.360 So by default, this Yamal extension provides basic Yamal validation functionality to enable cabernets 04:53.360 --> 04:53.940 support. 04:54.240 --> 04:58.470 We must configure it to work with Yamal files that we plan to develop. 04:59.040 --> 05:00.270 So there are two ways to do it. 05:00.360 --> 05:08.010 One way is to click on this gear icon on the Yamal file Yamal extension and go to extension settings 05:08.160 --> 05:15.930 and scroll all the way to the bottom where there is a Yamal as chemos option and click on the edit in 05:15.930 --> 05:17.720 settings dot Jason file option. 05:18.540 --> 05:20.940 Now this will take you to the settings dot data on file. 05:21.480 --> 05:27.420 This file may or may not have some content already based on other extensions or configurations that 05:27.630 --> 05:28.740 you might have already done. 05:29.190 --> 05:33.120 So if it's a new installation, it might look empty like this. 05:33.930 --> 05:39.380 So whatever it may be, our goal is to simply add a small section of code into this file. 05:40.580 --> 05:46.180 It should have the ammos keema section if you came here following the path that I showed you. 05:46.460 --> 05:49.970 We're going to add an entry for Cabernets Kemar support. 05:50.420 --> 05:57.320 We add as Keema for Koban, that is for all Yamal files using the star dot Yamal pattern. 05:57.820 --> 06:04.100 Okay, so we're basically saying that we want to use Carbonetti schema for all YAML files that we develop 06:04.130 --> 06:04.980 using we as code. 06:05.290 --> 06:11.330 If you don't really want to do that, if you don't want to use T Carbonetti schema for all the ammo 06:11.330 --> 06:13.970 files instead if you plan to create. 06:15.090 --> 06:17.360 Communities, fires using a particular pattern. 06:17.870 --> 06:20.930 Then you can specify that pattern, our extension here. 06:21.370 --> 06:21.590 OK. 06:21.740 --> 06:24.220 So we will just leave it as it is. 06:25.310 --> 06:31.210 Now, this is case sensitive as well, so make sure that you use all small case for the word coronets 06:31.480 --> 06:32.050 in this file. 06:33.220 --> 06:38.470 So one thing that you'll have to do is to reload the visual studio code after making this change so 06:38.470 --> 06:39.190 it takes effect. 06:39.610 --> 06:43.690 So just exit and restart the code at this point. 06:44.360 --> 06:52.260 Now, another, we get to these settings that Jason file is to use the control plus P shortcut, keyword 06:52.360 --> 06:54.250 search bar would open at the top. 06:54.850 --> 06:57.190 And then there you type in settings, dot Jason. 06:57.670 --> 06:59.920 And then go to the settings Dages and files from there. 07:00.550 --> 07:02.620 But if this doesn't work, use the gear. 07:02.620 --> 07:05.830 I can approach that, that I just showed. 07:06.960 --> 07:07.070 OK. 07:07.180 --> 07:12.160 So here again, as you can see, that this file has already been saved, so we don't have to do anything 07:12.340 --> 07:12.730 else. 07:13.750 --> 07:19.750 So what I'm going to do is I'm going to close this with your studio code editor and I'm going to open 07:19.750 --> 07:20.440 it up again. 07:24.610 --> 07:28.840 Once it is up, I'm just going to make sure that the Yamal extension is enabled. 07:33.260 --> 07:38.630 And so we don't have an option to enable or install here, which means that he has already enabled. 07:44.610 --> 07:44.770 OK. 07:44.900 --> 07:48.590 So let's now open a folder on our system. 07:48.620 --> 07:53.130 So in this case, I'm going to open the directory called Net is for Beginners, which is where our poor 07:53.130 --> 07:54.590 definition file resides. 07:55.070 --> 07:59.390 The one that we created earlier with the editor in the previous demo. 08:04.160 --> 08:07.370 For the purpose of this demonstration, let's create another file. 08:08.930 --> 08:12.800 So click on a new file and let's call it in the next stop, Yamal. 08:17.600 --> 08:22.790 So now we are going to create a new YAML file using the we show studio code editor and we'll make use 08:22.790 --> 08:24.950 of the Amole extension that we just installed. 08:25.550 --> 08:26.730 So we'll see how that works. 08:27.860 --> 08:29.060 But to make this work. 08:30.170 --> 08:37.910 First, we have to create the first root level property or the element called EPA version, and which 08:38.110 --> 08:39.740 for part will be we won. 08:40.550 --> 08:46.520 Now, once you put that in the cabinet support, part of the Amole extension we installed kicks in and 08:46.520 --> 08:51.170 then it'll start suggesting additional properties and performing validations. 08:51.800 --> 08:58.610 So not that you must have that one line in the first lining for the rest of the submissions to work. 08:59.160 --> 08:59.410 OK. 09:00.170 --> 09:06.160 Now, if I type in K for kind, it will suggest the available root level properties starting with K. 09:06.290 --> 09:07.880 And it suggests kind. 09:08.480 --> 09:12.470 So if I just press tab it will auto finish it. 09:13.000 --> 09:14.240 Auto completed for me. 09:14.720 --> 09:17.450 And then press control space bar and type P. 09:17.660 --> 09:21.830 And it will show you the list of all different objects that are available starting with P. 09:22.520 --> 09:24.140 So in this case we are interested in part. 09:24.210 --> 09:25.820 So I'm going to select Parred. 09:30.400 --> 09:34.830 And if I hit, enter and press em, then metadata is suggested. 09:34.990 --> 09:40.270 And again, it controls space and it will suggest supported options. 09:41.050 --> 09:44.800 The Yamal extension knows that this metadata is a dictionary. 09:44.830 --> 09:49.550 So it has already, you know, kind of intended the lines to the right for me. 09:50.110 --> 09:53.110 So I'm going to add a name, feel here. 09:53.320 --> 09:56.200 And again, we use the control space to complete. 09:57.470 --> 10:02.560 And you will notice that there is this error indicated here below the name. 10:02.590 --> 10:05.890 And it is expecting a string type field here. 10:05.950 --> 10:09.940 So as long as this is empty, it will continue to show that error. 10:10.450 --> 10:14.300 So let me add a name of the part which could be in the next dash, too. 10:14.670 --> 10:17.950 And as soon as I complete that, you'll see that the error indicator is gone. 10:17.980 --> 10:25.810 So now, again, if I hit enter, you'll see that it maintains the right invitation and it keeps it 10:25.960 --> 10:27.880 had the same particular line. 10:29.060 --> 10:31.700 As the child of metadata, which is name. 10:32.840 --> 10:35.850 So now the next one that I'm going to add is label. 10:36.200 --> 10:40.700 Again, press control space and it will order complete the label for me. 10:41.120 --> 10:45.380 And now if I press tap, it knows that labels is also a dictionary. 10:45.410 --> 10:50.000 So it has maintained that additional formatting. 10:50.340 --> 10:56.690 No, here, it won't suggest any properties or labels because labels could really be anything. 10:56.960 --> 11:01.290 So it's up to you to decide what labels to add or for that part. 11:02.000 --> 11:05.150 And that's why there's no suggestions here. 11:05.720 --> 11:12.590 Now I will add a label such as Environment and set it to production so that that would be the only label 11:12.590 --> 11:14.150 that I want to add right now. 11:14.960 --> 11:21.170 So now to go back to the root level again, I'm just going to press backspace twice and it takes me 11:21.170 --> 11:25.400 to the level of metadata and in the same vertical line. 11:25.910 --> 11:29.840 So now the next thing that we want to add is a spec section. 11:30.140 --> 11:32.410 Can we make use of the control space? 11:33.570 --> 11:34.010 Shortcode. 11:34.070 --> 11:36.320 And it will suggest options. 11:37.190 --> 11:42.500 Not that if this addition does not include what you are expecting, then there is probably something 11:42.500 --> 11:44.750 wrong with the format of your file. 11:44.870 --> 11:48.350 So you're probably not in the right place to add that file. 11:49.040 --> 11:54.950 So that's an additional support the extension provides to prevent you from creating a file with an incorrect 11:54.950 --> 11:55.550 structure. 11:56.740 --> 12:03.760 So I had a tab to choose that suggestion, and the extension knows that for part, what comes directly 12:03.760 --> 12:08.830 underneath the specked section is the container section, and that containers is a list. 12:08.840 --> 12:15.070 So it has created a list here with the first element already populated and waiting on you for the name. 12:16.030 --> 12:18.790 So let us set a value for the name of the container. 12:18.910 --> 12:20.770 Here we can use in Genex. 12:21.150 --> 12:28.810 And if I hit Enter, it maintains the right indentation for me to add another container and say we would 12:28.810 --> 12:32.120 like to specify an image for the first container. 12:32.140 --> 12:39.580 So if I make a mistake here, for example, if I add an image property and set it to say Engine X again, 12:39.610 --> 12:47.920 it knows that there is an error because and if I just highlight on top of that, it says bad indentation 12:47.920 --> 12:49.330 for a mapping entry. 12:49.750 --> 12:55.250 So we have to make sure that all properties of a single container are correctly aligned under it. 12:56.710 --> 13:03.310 One thing to remember here is that it doesn't really validate if the image name that you're using are 13:03.310 --> 13:10.330 valid image names to the names of images you specify or the names that you use for your part or containers 13:10.810 --> 13:14.920 or the labels that you assign to objects could really be anything. 13:15.010 --> 13:21.610 So those are not validated and it won't give you an error if you used an image that's not available 13:21.610 --> 13:22.870 on Docker registry. 13:23.500 --> 13:26.380 So that's up to you to make sure that you get those right. 13:26.800 --> 13:30.490 However, it does validate certain fields. 13:30.550 --> 13:37.570 That has to have value supported by communities such as the kind feel at the top being set to part or 13:37.570 --> 13:38.170 a deployment. 13:38.590 --> 13:46.390 So if you used a value other than a kind that is supported by Pineda's, then it will throw an error. 13:47.520 --> 13:47.680 OK. 13:47.850 --> 13:54.580 So now if you want to add another element to this array, we can do that by hitting enter and using 13:54.580 --> 13:58.510 backspace to go back to the same level as the previous element. 13:59.050 --> 14:00.970 And I can add additional containers here. 14:00.970 --> 14:04.380 For example, add a new area element with the hyphen. 14:04.890 --> 14:11.110 They let us, for example, say Busi Box as the new name of the new container. 14:11.480 --> 14:14.680 And the image is set to basic box as well. 14:15.370 --> 14:18.590 So now our code is clear. 14:18.820 --> 14:20.590 And as you can see, there are no errors. 14:21.520 --> 14:26.290 Now, I don't really need the second container for now, so I'll just go ahead and delete this line 14:26.320 --> 14:29.590 and make sure that everything else is as clean. 14:30.710 --> 14:33.130 OK, so now let's save this file. 14:34.510 --> 14:36.980 Now let us check out another property of the editor. 14:37.060 --> 14:43.900 So if we click on the outline field here, we can see the entire data structure of the YAML file. 14:44.020 --> 14:45.790 And in a graphical format. 14:46.270 --> 14:48.550 So this is the YAML file on the on the right. 14:48.580 --> 14:54.700 And here you can see the four root elements here, the kind and if I click on this, it'll highlight 14:54.700 --> 14:56.950 the line where we have the root element. 14:57.310 --> 14:59.590 So we have the API version, which is V one. 14:59.620 --> 15:00.410 We have kind. 15:00.430 --> 15:01.110 Which is part. 15:01.120 --> 15:05.080 And you'll see that it also has the other two root elements. 15:05.140 --> 15:11.260 For example, metadata, which is the dictionary, as you can see with this curly braces here, which 15:11.290 --> 15:12.300 indicates a dictionary. 15:12.310 --> 15:20.050 And if you open that, you can see that the the children of metadata, which the first one is labels 15:20.440 --> 15:24.460 and labels, is also a dictionary object, which has a value of iani. 15:26.760 --> 15:32.050 So a presence in a hierarchical or tree kind of structure, and similar to that, we also have the specked 15:32.050 --> 15:35.020 section, which is a dictionary which has an area code containers. 15:35.650 --> 15:38.230 And you can spot an area using the double square brackets. 15:38.710 --> 15:44.800 And if I narrowed down the first element of the containers, three, which is the element zero has two 15:44.800 --> 15:51.520 values, key value pairs, which has an image which is equal to Engine X and which has a name and next 15:51.520 --> 15:51.940 as well. 15:52.540 --> 15:57.070 So this is quite handy to help you explore the structure of the file. 15:57.490 --> 15:59.800 If you're not sure what's wrong and where. 16:00.430 --> 16:06.220 So we have successfully created our part definition file, easily using the Yamal extension and the 16:06.220 --> 16:12.190 auto completion features so we can now create a part from this YAML file, from the command line, as 16:12.190 --> 16:13.630 you normally would. 16:14.260 --> 16:21.100 So you go to the terminal and just type the ALLAS command and you can see that the the next YAML file 16:21.100 --> 16:24.550 is is here under the cabinet is for beginners directory. 16:25.060 --> 16:27.850 And just let us quickly view this file. 16:31.630 --> 16:34.370 And you can see that it's exactly as it's supposed to be. 16:35.690 --> 16:42.470 And you can now create a part using the cubicle to create or apply command and passing in this file 16:42.500 --> 16:43.100 as input. 16:44.320 --> 16:51.550 OK, so in this in the upcoming coding exercises section, you will first game practice on getting the 16:51.550 --> 16:52.710 Yamal files right? 16:53.010 --> 16:53.170 OK. 16:53.350 --> 16:59.110 So if you are already familiar with Yamal files and the formatting etc, then, you know, feel free 16:59.110 --> 16:59.710 to skip those. 16:59.740 --> 17:06.490 But if you are new, then we have we've created this coding exercises so that you get really, really 17:06.490 --> 17:12.940 comfortable with Yamal files, especially the cabinets Hammil files before you actually head into the 17:12.940 --> 17:13.560 real labs. 17:13.780 --> 17:17.070 So just like the coding exercises that you worked with earlier. 17:17.560 --> 17:19.770 Feel free to work through these. 17:20.170 --> 17:25.690 And then once you're done with these coding exercises, then you'll have the real lab environments where 17:25.690 --> 17:33.370 you will explore existing parts in creating new paths on real covenant's clusters by developing hamo 17:33.400 --> 17:33.910 files. 17:34.470 --> 17:38.250 OK, so that's it for this lecture and I will see you in the next one.