Setting up your virtual server

You need to get an AWS account to follow the remaining steps in this section. Head over to https://aws.amazon.com/ to create an account in case you do not have one already. Once ready, you can sign in to your account and navigate to the AWS EC2 control panel by going to https://console.aws.amazon.com/ec2/v2/, which leverages the Elastic Compute Cloud (EC2) service, the foundation of Amazon's cloud computing services. Once there, remember to select a region of your choice (I usually go with US East) and then click on Launch Instance to kickstart the process of creating a new virtual server on the cloud:

Clicking the Launch Instance button should take you to the page to select your own Amazon Machine Image (AMI). Typically, an AMI, consists of various software configurations necessary to build your virtual server. It includes the following:

  • A template for the root volume for the instance, which includes your server's operating system, applications, and other configuration settings.
  • Launch-permission settings that control which AWS accounts can use the AMI to launch instances.
  • A block-device mapping that specifies the storage volumes to attach to the instance when it's launched. All your data goes here!

We will leverage a prebuilt AMI specialized for deep learning so we do not have to spend time with extra configuration and administration. Head over to the AWS Marketplace and select Deep Learning AMI (Ubuntu):

After choosing your AMI, you need to choose the instance type. For GPU-enabled deep learning, we recommend the p2.xlarge instance, which is powerful yet economical and costs around $0.90 per hour of use (as of 2018). 

P2 instances provide up to 16 NVIDIA K80 GPUs, 64 vCPUs, and 732 GiB of host memory, with a combined 192 GB of GPU memory, as shown in the following screenshot: 

Next up is to configure instance details. You can keep the default settings unless you wish to launch more than one instance, specify subnet preferences, and specify shutdown behavior. 

The next step involves adding storage details. Typically, you have a root volume where you can increase its size if needed and add additional Elastic Block Store (EBSvolumes for additional disk space.

Then, we look at adding tags (case-sensitive and key-value pairs) if needed. We don't need this at the moment, so we skip it.

We focus more on the next step of configuring security groups, especially if you want to access your deep learning setup from outside by leveraging the ever-powerful Jupyter Notebooks. To enable this, we create a new security group and create a Custom TCP rule to open and enable access of port 8888, as follows:

A note of caution here, this rule typically allows any IP to listen to that port (8888) on your instance (which is where we will be running our Jupyter Notebooks). If needed, you can change this to just add the IP address of your specific PC or laptop for additional security. Besides this, we will add an additional password-protection feature to the Jupyter Notebooks later on for more security.

Finally, you will need to launch your instance by creating a key-pair (public and private keys) to connect to your instance securely. In case you don't have an existing key-pair, you can create a new one, safely store the private key file to your disk, and launch your instance, as depicted in the following screenshot:

Do note that it might take a few minutes before your virtual server boots up and launches, so you might need to wait a bit. Often, you might see that your instance has failed to launch owing to insufficient limits or capacity for your account.

In case you face this issue, you can request a limit increase for the specific instance type you are using (in our case, p2.xlarge):

Usually, AWS responds and approves your request in less than 24 hours, so you might need to wait a bit before you get the approval and then you should be able to launch your instance. Once you launch your instance, you can check out the Instances section and try to connect to the instance:

You can make use of a Command Prompt or Terminal from your local system, where you have stored the private AWS key from earlier, to connect to your instance now:

[DIP.DipsLaptop]> ssh -i "my-dl-box.pem" [email protected]
Warning: Permanently added 'ec2-xxxxx.compute-1.amazonaws.com' (RSA) to the list of known hosts.


=======================================================================
Deep Learning AMI for Ubuntu
=======================================================================
The README file for the AMI : /home/ubuntu/src/AMI.README.md
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-121-generic x86_64)

Last login: Sun Nov 26 09:46:05 2017 from 10x.xx.xx.xxx
ubuntu@ip-xxx-xx-xx-xxx:~$

Thus this allows you to successfully log in to your own cloud-based deep learning server!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset