In the previous demo, we used the Vim command line, Ed, to create our part, the finishing file.
We created a pod called Engine X with a couple of labels and we use the Engine X image.
Now, while this works well, the Vim editor is quite basic and it can be quite difficult to make use
of them if you want to create and edit long or even large number of YAML files.
The same goes with notepad or other tools in windows.
They are very basic and prone to errors.
They don't really tell you if you made a mistake.
The Cuban netas object definition files using Yamas can be developed much easier using I.D. tools.
Now there are many ideas out there that are free to use, such as those from jet brains, intelligent
idea and pie charm.
Adam is another free tool eclipse or net beans that a lot of Java developers use.
And all of these come with support for Yamal files.
And they will help in highlighting errors in a Yamal file and make making sure that you develop them
right.
But they won't natively tell you if there are errors within the coronets manifest files that you are
developing.
For example, if you typed in the wrong property name or if you are using a dictionary instead of a
list.
And that's where you need some kind of an extension or a plugin that could help point those out for
you.
So those tools that can first verify the structure of your YAML file and the syntax, making sure that
works fine.
And also point out errors related to coronets.
Right.
Support for communities.
And so these ideas come with support for extensions and plug ins that can help with that.
And those plug ins could either be free or paid.
Now, one IDC that we found that is freely available and works on all different operating systems and
also has a free extension for Yamal.
Validation for cabernets is the Microsoft.
We show studio code IDC.
It's easy to set up and get started.
And so we will use that as our IDC for the rest of this, for the rest of the demos and discourse.
Now, you don't necessarily have to use the same tool.
Feel free to use any idea of your choice and try to find a plugin or extension that can help with developing
coronate.
Is Yamal files for the idea of your choice?
So in this demo, we're going to first install a V.
S code.
So here I am at the code dot.
We shall sudheer dot com website.
And since I'm running on and a boon to base distribution, I'm going to download the Debian package.
It should automatically list the right version to download for you.
Depending on your operating system and it has its sights here.
We show studio code is free and open source software.
We will wait for the download to complete.
The download has been completed, and since it's said to be in package, I'm just going to install it
directly on my system.
So let's wait for the installation to complete.
The installation has been completed now, and I'm going to launch V.
S code once open.
This is what it would look like after a fresh install.
So we will go to the extensions section first and search for YAML and look for the extension, which
is published by RedHat.
This is the extension that has support for cabernets, YAML files in most cases.
This particular Yamal extension is installed by default.
But if it's not in your case, then you'll see that here and you can go ahead and click on the install
button to install and enable it.
Now, before we get started with developing overlanders definition files, using this extension, we
have to make a small change in our settings to configure we as code to use the amole extension for communities
files.
Right.
So by default, this Yamal extension provides basic Yamal validation functionality to enable cabernets
support.
We must configure it to work with Yamal files that we plan to develop.
So there are two ways to do it.
One way is to click on this gear icon on the Yamal file Yamal extension and go to extension settings
and scroll all the way to the bottom where there is a Yamal as chemos option and click on the edit in
settings dot Jason file option.
Now this will take you to the settings dot data on file.
This file may or may not have some content already based on other extensions or configurations that
you might have already done.
So if it's a new installation, it might look empty like this.
So whatever it may be, our goal is to simply add a small section of code into this file.
It should have the ammos keema section if you came here following the path that I showed you.
We're going to add an entry for Cabernets Kemar support.
We add as Keema for Koban, that is for all Yamal files using the star dot Yamal pattern.
Okay, so we're basically saying that we want to use Carbonetti schema for all YAML files that we develop
using we as code.
If you don't really want to do that, if you don't want to use T Carbonetti schema for all the ammo
files instead if you plan to create.
Communities, fires using a particular pattern.
Then you can specify that pattern, our extension here.
OK.
So we will just leave it as it is.
Now, this is case sensitive as well, so make sure that you use all small case for the word coronets
in this file.
So one thing that you'll have to do is to reload the visual studio code after making this change so
it takes effect.
So just exit and restart the code at this point.
Now, another, we get to these settings that Jason file is to use the control plus P shortcut, keyword
search bar would open at the top.
And then there you type in settings, dot Jason.
And then go to the settings Dages and files from there.
But if this doesn't work, use the gear.
I can approach that, that I just showed.
OK.
So here again, as you can see, that this file has already been saved, so we don't have to do anything
else.
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
it up again.
Once it is up, I'm just going to make sure that the Yamal extension is enabled.
And so we don't have an option to enable or install here, which means that he has already enabled.
OK.
So let's now open a folder on our system.
So in this case, I'm going to open the directory called Net is for Beginners, which is where our poor
definition file resides.
The one that we created earlier with the editor in the previous demo.
For the purpose of this demonstration, let's create another file.
So click on a new file and let's call it in the next stop, Yamal.
So now we are going to create a new YAML file using the we show studio code editor and we'll make use
of the Amole extension that we just installed.
So we'll see how that works.
But to make this work.
First, we have to create the first root level property or the element called EPA version, and which
for part will be we won.
Now, once you put that in the cabinet support, part of the Amole extension we installed kicks in and
then it'll start suggesting additional properties and performing validations.
So not that you must have that one line in the first lining for the rest of the submissions to work.
OK.
Now, if I type in K for kind, it will suggest the available root level properties starting with K.
And it suggests kind.
So if I just press tab it will auto finish it.
Auto completed for me.
And then press control space bar and type P.
And it will show you the list of all different objects that are available starting with P.
So in this case we are interested in part.
So I'm going to select Parred.
And if I hit, enter and press em, then metadata is suggested.
And again, it controls space and it will suggest supported options.
The Yamal extension knows that this metadata is a dictionary.
So it has already, you know, kind of intended the lines to the right for me.
So I'm going to add a name, feel here.
And again, we use the control space to complete.
And you will notice that there is this error indicated here below the name.
And it is expecting a string type field here.
So as long as this is empty, it will continue to show that error.
So let me add a name of the part which could be in the next dash, too.
And as soon as I complete that, you'll see that the error indicator is gone.
So now, again, if I hit enter, you'll see that it maintains the right invitation and it keeps it
had the same particular line.
As the child of metadata, which is name.
So now the next one that I'm going to add is label.
Again, press control space and it will order complete the label for me.
And now if I press tap, it knows that labels is also a dictionary.
So it has maintained that additional formatting.
No, here, it won't suggest any properties or labels because labels could really be anything.
So it's up to you to decide what labels to add or for that part.
And that's why there's no suggestions here.
Now I will add a label such as Environment and set it to production so that that would be the only label
that I want to add right now.
So now to go back to the root level again, I'm just going to press backspace twice and it takes me
to the level of metadata and in the same vertical line.
So now the next thing that we want to add is a spec section.
Can we make use of the control space?
Shortcode.
And it will suggest options.
Not that if this addition does not include what you are expecting, then there is probably something
wrong with the format of your file.
So you're probably not in the right place to add that file.
So that's an additional support the extension provides to prevent you from creating a file with an incorrect
structure.
So I had a tab to choose that suggestion, and the extension knows that for part, what comes directly
underneath the specked section is the container section, and that containers is a list.
So it has created a list here with the first element already populated and waiting on you for the name.
So let us set a value for the name of the container.
Here we can use in Genex.
And if I hit Enter, it maintains the right indentation for me to add another container and say we would
like to specify an image for the first container.
So if I make a mistake here, for example, if I add an image property and set it to say Engine X again,
it knows that there is an error because and if I just highlight on top of that, it says bad indentation
for a mapping entry.
So we have to make sure that all properties of a single container are correctly aligned under it.
One thing to remember here is that it doesn't really validate if the image name that you're using are
valid image names to the names of images you specify or the names that you use for your part or containers
or the labels that you assign to objects could really be anything.
So those are not validated and it won't give you an error if you used an image that's not available
on Docker registry.
So that's up to you to make sure that you get those right.
However, it does validate certain fields.
That has to have value supported by communities such as the kind feel at the top being set to part or
a deployment.
So if you used a value other than a kind that is supported by Pineda's, then it will throw an error.
OK.
So now if you want to add another element to this array, we can do that by hitting enter and using
backspace to go back to the same level as the previous element.
And I can add additional containers here.
For example, add a new area element with the hyphen.
They let us, for example, say Busi Box as the new name of the new container.
And the image is set to basic box as well.
So now our code is clear.
And as you can see, there are no errors.
Now, I don't really need the second container for now, so I'll just go ahead and delete this line
and make sure that everything else is as clean.
OK, so now let's save this file.
Now let us check out another property of the editor.
So if we click on the outline field here, we can see the entire data structure of the YAML file.
And in a graphical format.
So this is the YAML file on the on the right.
And here you can see the four root elements here, the kind and if I click on this, it'll highlight
the line where we have the root element.
So we have the API version, which is V one.
We have kind.
Which is part.
And you'll see that it also has the other two root elements.
For example, metadata, which is the dictionary, as you can see with this curly braces here, which
indicates a dictionary.
And if you open that, you can see that the the children of metadata, which the first one is labels
and labels, is also a dictionary object, which has a value of iani.
So a presence in a hierarchical or tree kind of structure, and similar to that, we also have the specked
section, which is a dictionary which has an area code containers.
And you can spot an area using the double square brackets.
And if I narrowed down the first element of the containers, three, which is the element zero has two
values, key value pairs, which has an image which is equal to Engine X and which has a name and next
as well.
So this is quite handy to help you explore the structure of the file.
If you're not sure what's wrong and where.
So we have successfully created our part definition file, easily using the Yamal extension and the
auto completion features so we can now create a part from this YAML file, from the command line, as
you normally would.
So you go to the terminal and just type the ALLAS command and you can see that the the next YAML file
is is here under the cabinet is for beginners directory.
And just let us quickly view this file.
And you can see that it's exactly as it's supposed to be.
And you can now create a part using the cubicle to create or apply command and passing in this file
as input.
OK, so in this in the upcoming coding exercises section, you will first game practice on getting the
Yamal files right?
OK.
So if you are already familiar with Yamal files and the formatting etc, then, you know, feel free
to skip those.
But if you are new, then we have we've created this coding exercises so that you get really, really
comfortable with Yamal files, especially the cabinets Hammil files before you actually head into the
real labs.
So just like the coding exercises that you worked with earlier.
Feel free to work through these.
And then once you're done with these coding exercises, then you'll have the real lab environments where
you will explore existing parts in creating new paths on real covenant's clusters by developing hamo
files.
OK, so that's it for this lecture and I will see you in the next one.