In this segment we'll talk about how to use Amazon Web Services, AWS, to run your Deal II code. So let's go over to the computer, and first, we'll talk about getting set up with AWS and loading the AWS. First, you would sign in, go to aws.amazon.com and then sign in. You can use your existing Amazon account, or there's an option to create a new account there, you can just choose the free account. So now once you're to the Amazon web services, your main page here. At the top left there is a link called ec2, virtual servers in the cloud. And we're going to launch an instance. And to choose the one that has Deal II installed, we'll go to Community AMIs, you can just search for deal_ii, double i. Again, you can see, this is the only machine image that has Deal II installed. If for some reason there was more than one, you would choose one that's ami-93217fa3. That's the one that's been created for this class, at this point, at least. So we'll select that, and I'm just chasing the free tier, the T2 micro, and I'll launch that. Now here you have to create or choose a key pair. So that just links this instance to the key pair that you will download for your own computer. So it's just a security measure, so I can create a new one, we can choose out here, you can create a new key pair. I've already created one, so I just call that deal II key pair, and you can name it whatever you want. And I acknowledge I have access to it, so I launch the instance now. And it's associated with that key pair file that's on my computer. So I'll go and view the instances, so now it's been created, or it's creating, you can see right now it's still pending, it's initializing. But that's all you need to do to get setup with AWS, the next step is to access it. Now it doesn't create a virtual desktop like the virtual machine did that we've talked about in the previous segment. So in order to access AWS, we'll be going through SSH, or something like SSH. All right, so you can see here that the instance is running. And so I'm running Windows right now, and there are a couple ways to access AWS through Windows. And I'm going to show the easier of the two first, it's easier if it works. [LAUGH] So depending on your situation, it may not actually work. So the one I'll show you first is the second option, a Java SSH client directly from my browser. So as it specifies, Java is required, so when I try to run this on Ubuntu with Chromium, it doesn't work, because they're not supporting Java anymore, I have to use Firefox. However, right now in Windows, Chrome is still supporting Java. So for username, we actually change route, it becomes ec2-user. And this will be the same for you, no matter how you're logging into AWS. Notice it automatically has the key pair that I specified before, and it saved the file path where I have saved it before. I had to put that in the first time, so when you do this for the first time, that won't be there, you'll have to type it in. And remember to include the name of the key pair, the file name. You can store it in browser cache if you want to, and then it will save the file pathway. Okay, then press Launch SSH Client, And most likely it will come up with this warning, application blocked by Java Security. It's because they haven't, AWS hasn't updated one of their certificates. And so if you want to use this, in order to use it on your computer, you'll have to add this website to the whitelist of Java. So, you'll notice I went to the Start menu, I have configured Java here already. But if you want, you can type it in down here and search Configure Java, and select it there. And it brings up the Control Panel, what you do is go to security, we're on high security. Then, you do edit site list, and you can add the location that it has listed there. So, I'll type that in. Now hopefully they will update their certificates soon, so we don't have to worry about putting it on Java's whitelist but. And that matches, we can press OK, and that's set up. So after we change the setting in Java, after we add this site to the whitelist, then you have to close out the browser and then reopen it. So after we've added this website to the whitelist on Java, we'll close out the browser and open it back up, and go to aws.amazon.com, sign back in, And go to EC2, now we want to see our instances. We've already created the instance, the machine image. So we'll go to instances and click Connect. Now we should be able to choose this Java client. And we need to change the user name again to ec2-user. And then my, actually it changed where I put this key path. It should be in Example/deal_II_key_pair. Let me just go there really quick, under C:/Example, and right there, deal_II_key_pair. And delete that file because we'll be talking about it later. So now, and I will store that in my browser cache. Launch the SSH Client, and it comes up with this security warning. I accept the risk and I do want to run the application. And it will bring up, In just a second, there it is, okay, and now it's brought up this terminal that accesses AWS. And so it's all ready to go, we can do print working directory, and you can see we're in the home ec2. Dash user directory, do ls, there is a desktop folder and nx example folder. All right so now, we're able to run it, we can for example go into example folder, and it has the same examples that we saw on the virtual machine. Okay, again these correspond to the tutorials. Let's go into step 8, and I did already run this, but just to show you again the process, we do cmake, cmakelists.txt to create a make file. And once you have the make file you can do make run and it will run. Again, this is DL2's elasticity code. And it will create several VTK files. All right, recreate them in our case since I already ran it before. All right, so there it's pretty straightforward on, now it's using this is just like having a terminal open in the virtual machine. Or on your own computer, if you had DL2 installed on your own computer. This is just like using a terminal there, all right? But again, since this is just a terminal, you can't, it doesn't have a way to visualize, it doesn't have a way to edit your files. So in order to do that, you'll have to copy or transfer your files to and from AWS to your own computer. With this MindTerm, which is the Java application here, it's really straightforward. You go up here to the top here, plugins, and then there's SCP file transferring. Click on that and it's very easy. You can choose, for example, a file on our computer. So I'll go to C and example, and let's see over here on EC2 user, I'll make a new directory called Example. So I'm going to go into that. And let's say I want to copy main.cc from my own computer to AWS. I just press this little arrow and it copies it over, done, okay? And I could go the other direction too, with the other arrow. All right, if I wanted to. So it is very straightforward, very easy to use once you have Java set up to accept this application, all right? And again, hopefully Amazon will change that certificate soon, so that we don't need to put it on the white list to make it work. So that's one option. However, if changing the settings on Java perhaps isn't an option for you on your computer, or you're a little concerned about the security risk there, there's another way to connect. And that's using this first option choose a standalone SSH client. Now for Windows we can use what's called a PuTTY and here is the link here that explains how we would connect using PuTTY. All right, I'm going to minimize the screen a little bit, so that we can keep these directions on the screen. Okay, so the first thing is to install PuTTy, so we have the download it gives this link to the download page here. I'll pull this up into another one there for us. And again there are two options here. Go to the download page, you can download it, actually install it on your computer. On your Windows computer, and that'd be down here, putty-0.63-installer.exe. So, you can download that and actually install it on your machine. However, if maybe it's not your own computer and you don't have installation privileges on the computer then we can do it another way. There are three other executables that we want to download. There's putty.exe, there is pscp, you remember when we were using MindTerm we used the scp to transfer files. So this is pscp's, so it's the PuTTYs. We have used PSCP, and then PuTTYgen. PuTTYgen will convert our key pair from the .pem file to a file type that PuTTY recognizes, okay? So I've got these three files, these are executables, in my downloads folder. Okay, so now I can exit out of that and we'll look back at the directions. Now these other directions are, Information about our instance. So I'll exit out here. So for example we will need the main thing that we'll need here is this public DNS address, okay? So let's go back to the instructions. We also need to know where the private key is. That will come up, okay? All right, first let's connect to AWS using PuTTY, and then we'll talk later about transferring files. Okay, so the first thing is to convert the private key type. Okay, so here I'm in this example folder which is where I have my deal 2 keeper.pem. I'm also going to open up my downloads folder. And you can see here PuTTYgen. Okay, this is an executable so I can just run it, I don't have to install it. Okay, so I need to go to load. And these instructions are on the webpage, website here. So it says you'd start PuTTYgen, if you'd install it then it would, you could just go to your start menu and type in PuTTYgen and run it from there. Okay, we download the executable, so that's why we just click down the file and it downloads the folder. Choose SSH-2 RSA, and then we go to load. And again, it's here in example, it went there automatically. Choose all files, and then we choose the .pem. Okay, so it successfully imported it, we'll need to save private key. You can see that's the next step here. Save private key and I'm not going to do a passphrase, and I am going to just rename it or name it the same as my .pem file. However, it is a .ppk file, private party key file now. Alright so I'll save it there. And that's ready to go, you can exit out. Now, to actually start a PuTTY session we'll go to, again I'll go to my downloads folder. If you did install PuTTY then you'd go to the start menu and find PuTTY there. I'll just double click on PuTTY and we're in it. Now let's look at the directions here. So in the host name, you enter user name at the public DNS name. Okay, so our user name is ec2-user, that's going to be the same for all of you, then @. Now we need to go to the instance. Okay? And you'll notice that this public DNS has the public IP, it's the same address there. So I'll copy that into the host name. Go back to the instructions, you see it says to make sure that the connection type is SSH and the post is port 22. All right, now over here in the Category pane, you will go down to Connection and then we'll expand, press the little plus sign on SSH and select Auth. All right, authentication. Now we need to find our key pair. And now it's this .ppk file that we created. So we press Open, and then that's the last thing. And now we just need to press Open again to start our PuTTY session. Okay, again you can say the host key or not, I'm not going to. In this case, it doesn't matter too much. And now we have, again, this terminal open so that we can access AWS. Exactly the same now as it was in my turn. Just use the command line commands, we can see we still have that example folder that we created from MindTerm. Because AWS saves the files when you exit out, okay? So you can see we even still have main.cc. I'm going to delete that for now, though. Okay, all right, so that's empty. Okay, so now we need to look at how we transfer files to and from AWS. Okay, since we won't be editing them from this terminal, okay? So you'd be editing your files on your own computer and visualizing your output files on your own computer, all right? So, let's scroll down a little further on the instructions, and it talks about transferring files. There are actually two ways. I'm just going to talk about using the PuTTY SCP that we downloaded. If you're more comfortable with using a GUI, then you can download this WinSCP. And the instructions are here, but I'm not going to go through them with you, okay? But that is an option. All right, so now to use this PSCP, we're going to open up a Windows command prompt. So you could type that in here at the search, type in command and then choose command prompt. And for those of you who've used SSH on Linux. Or on a Mac, this will be very similar to using SCP on a Linux or a Mac. Okay, so the first thing is we need to specify that we're using PSCP. Okay, now if, again, if you installed it using the installer, you would just type in pscp, which is what it says here in the instructions. However, we didn't install it. We just downloaded the executable. So what we need to do is actually type in the file path. So it's in C :\Users\Greg\Downloads. You can press Tab and it completes the filing, okay? And then the name of the executable is pscp.exe, okay? And then next, we just type in -i, dash i. Now first I'm going to, Well, whether we're transferring from the computer to AWS or from AWS to the computer, the next step is the same. Now we need to specify where our key pair is. So again, I put that in my example folder. And it's called deal_II_key_pair. And again, we use he .ppk since this is PuTTY. Now, for this first example, I will transfer a file from my computer to AWS. So first, I'll specify where that file is, and I'll use the same example of passing main.cc. And now I need to specify where I'm transferring it to. Then, specifically I need to type in my username, ec2-user@. Again, I'll right-click and Paste. Okay, again that's the DNS that we used before to access PuTTY. Okay, and I'll do a colon and then I will put in the path to where I want the file to go. Okay, so that's homeec2-user and that will be the same for everyone. And I want to put it in that example folder, okay? So now if I press Enter, it hasn’t seen this key before. So I’m going to press yes, store the key in the cache, and now it transferred it. So if you go up here to our PuTTY terminal and we do ls, you can see that now Example has this main.cc file in it, okay? Now, to transfer the other way, it's going to be very similar. I'm going to press up to get back to the previous screen. Okay, very similar, so again the first part is to just type in where pscp.execute is, if you didn't install it, -i. Then again, that path to the key pair. Now I'm going to transfer that main.cc back from AWS to my own computer, all right? So it's essentially the same command only switching the last two. So, first I'll do ec2-user@ the DNS, paste that and I want to copy the file home ac2-user\example\main.cc. Okay, so that's the file of origin. And I want to copy it to my example file here. And I can actually rename it if I want to. I'll name it main2.cc just to distinguish between them, okay? I'll press Enter, and, okay, it says there's a problem here it could not identify. It's because I was using a backslash instead of a forward slash. So that's something to watch out for. Windows directories use backslashes, but Linux uses forward slashes. So I need to use forward slashes here in my file path, okay? All right, so now that should've transferred over. We can go to our folder and here it is, main2.cc, okay? And so once you know how to transfer your homework files, your .h.cc [INAUDIBLE] over 2AWS, then you can run it on AWS. Once you've got your output files, you can again transfer those back to your computer to visualize them. All right, so that should have you set to use DO2 on AWS either using Mindterm through Java or using PuTTY. Now in the next segment, I'll talk about using SSH to access AWS from Linux, and it's also the same on a Mac.