Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit

Permalink
Merge pull request #28 from CLASS/aws-dev
Browse files Browse the repository at this point in the history
Aws dev
  • Loading branch information
amanda-tan authored Feb 9, 2022
2 parents 9bd9e49 + 3e40447 commit e85a37e
Show file tree
Hide file tree
Showing 10 changed files with 497 additions and 443 deletions.
18 changes: 9 additions & 9 deletions content/AWS/01_intro_to_cloud_console.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "dc57021c",
"id": "64325d0f",
"metadata": {},
"source": [
"# Introduction to the AWS Console\n",
Expand All @@ -28,13 +28,13 @@
},
{
"cell_type": "markdown",
"id": "502f2360",
"id": "54c59223",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"id": "5a252bd1-ac08-455f-9f5a-1049676173af",
"id": "2477a2d7",
"metadata": {},
"source": [
"## Setup\n",
Expand All @@ -49,7 +49,7 @@
},
{
"cell_type": "markdown",
"id": "9108a06c-ac48-4c70-a5cd-03f74ff1f67c",
"id": "c72b28be",
"metadata": {},
"source": [
"## Logging in to the console\n",
Expand All @@ -64,7 +64,7 @@
},
{
"cell_type": "markdown",
"id": "930220c5",
"id": "06ba8d29",
"metadata": {},
"source": [
"## Key concepts and components of the AWS console\n",
Expand All @@ -74,7 +74,7 @@
},
{
"cell_type": "markdown",
"id": "22bf4b20",
"id": "b9a21e7b",
"metadata": {},
"source": [
"Figure 2 lists the basic components you will see when you first log in to the AWS console. \n",
Expand All @@ -97,7 +97,7 @@
},
{
"cell_type": "markdown",
"id": "b2240a49",
"id": "14396589",
"metadata": {},
"source": [
"```{admonition} Exercise\n",
Expand All @@ -112,7 +112,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -126,7 +126,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.10.2"
}
},
"nbformat": 4,
Expand Down
126 changes: 54 additions & 72 deletions content/AWS/02_intro_to_compute.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "dc57021c",
"id": "99642f5e",
"metadata": {},
"source": [
"# Introduction to Elastic Cloud Compute (EC2) - Part 1\n",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
{
"cell_type": "markdown",
"id": "502f2360",
"id": "fbcbf455",
"metadata": {},
"source": [
"Recall that the two fundamental components of cloud computing is compute and storage. On AWS, a \"virtual server\" or \"virtual computer\" is known as an **Elastic Cloud Compute (EC2) instance**; sometimes it's called \"EC2\", sometimes it's called an \"instance\" to denote that the ability to build and terminate this server instantaneously, but they all mean the same thing. An EC2 instance is no different from a server that sits under your desk, or your local departmental cluster, or even your local HPC cluster. You even boot up an EC2 instance through the web console, install software and then shut down your instance just like you would a real computer, except that Amazon takes care of the physical machinery while you are in charge of process of creating the computer. In some sense, you can think of utilizing an EC2 instance as renting a server or computer from Amazon! \n",
Expand All @@ -43,10 +43,10 @@
},
{
"cell_type": "markdown",
"id": "bc5d082d",
"id": "17329430",
"metadata": {},
"source": [
"We begin with the AWS console again. Under the \"Build a Solution\" panel, select **Launch a Virtual Machine**\n",
"We begin with the AWS console again. Under the \"Build a Solution\" panel, select `Launch a Virtual Machine`\n",
"\n",
"![Start page for the AWS console](images/console_ec2.png)\n",
"\n",
Expand All @@ -70,64 +70,61 @@
},
{
"cell_type": "markdown",
"id": "b9809503",
"id": "efcd0d76",
"metadata": {},
"source": [
"## Select an AMI (Step 1)\n",
"## 1. Select an AMI\n",
"\n",
"An Amazon Machine Image (AMI) is a template that Amazon uses to describe the operating system, disk type and all the software configuration that is needed to make sure a computer runs smoothly. Imagine that you are purchasing a new laptop; fresh out of the box, the laptop is pre-configured with an operating system (e.g. Windows, Mac OS, Ubuntu etc.), configuration files that tells the laptop what peripherals are attached, and pre-installed software like Adobe PDF reader. An AMI contains all this information so that your EC2 instance runs exactly like it would a new laptop out of the box! There is much more to learn about AMIs and how they can used for collaboration and data sharing but that is not within the scope of CLASS Essentials. \n",
"\n",
"As you scroll through the AMI list (Figure 2) you will notice that the list contains offerings from various vendors (e.g. Amazon, RedHat, Windows, etc.). We will be choosing the Ubuntu operating system for flexibility and versatility (can be used outside of the AWS ecosystem). \n",
"\n",
"To list all the Free Tier AMIs, check the box on the right that says **Free tier only**.\n",
"To list all the Free Tier AMIs, check the box on the right that says ```Free tier only```.\n",
"\n",
"![ec2-ami](images/ec2-ami.png)\n",
"Step 1 - Select an AMI - Free Tier Only\n",
"<img src=\"./images/ec2-ami.png\" width=720 align=\"center\">\n",
"\n",
"Scroll to `Ubuntu Server 20.04 LTS(HVM), SSD Volume Type` Select `64-bit(x86)`. \n",
"<div align=\"center\">Figure 2: Step 1 - Select an AMI - Free Tier Only </div><br/>\n",
"\n",
"![ec2-ubuntu](images/ec2-ubuntu.png)\n",
"Step 1 - Select an AMI - Operating System Selection"
"Scroll to ```Ubuntu Server 20.04 LTS(HVM), SSD Volume Type``` (Figure 3). Select ```64-bit(x86)```. \n",
"\n",
"<img src=\"./images/ec2-ubuntu.png\" width=720 align=\"center\">\n",
"\n",
"<div align=\"center\">Figure 3: Step 1 - Select an AMI - Operating System Selection </div><br/>"
]
},
{
"cell_type": "markdown",
"id": "9c658eed-3cf6-4f46-bde6-f3b481874013",
"metadata": {
"tags": []
},
"id": "20372414",
"metadata": {},
"source": [
"## Choose an Instance Type (Step 2)\n",
"## Step 2: Choose an Instance Type\n",
"\n",
"Choosing an instance type is choosing the hardware for your computing system: you get to pick the number of CPUs and memory size for your instance. \n",
"\n",
"Instance types are group by [**families**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) and denotes whether, for example, an instance is optimized for batch processing (compute-optimized, C-family), optimized for databases (memory-optimized, R-family) or has accelerated hardware (GPUs) for AI or Machine Learning pipelines. \n",
"\n",
"When you choose an Instance Type (below), the screen show additional information about the selected instance type including the number of CPUs, the memory size, the type of storage and information about networking. \n",
"![ec2-ubuntu](images/ec2-ubuntu.png)\n",
"When you choose an Instance Type (Figure 3), the screen show additional information about the selected instance type including the number of CPUs, the memory size, the type of storage and information about networking. \n",
"\n",
"In the Instance Storage (GB) column, you will notice a term called **EBS**. EBS is the acronym for **Elastic Block Storage** and is analogous to the hard disk or boot drive on your personal computer or laptop. More details about EBS and different kinds of disk storage on EC2 instances are beyond the scope of CLASS Essentials. \n",
"\n",
"```{admonition} Note\n",
":class: note\n",
"The four most common types of storage you will encounter on AWS are: Elastic Block Storage (EBS), Elastic File Storage (EFS), Simple Storage Service (s3) and s3 Glacier. In the simplest terms, EBS is analogous to a computer hard drive and EFS is analogous to a network file system (NFS) or shared file system. s3 is AWS's object storage which is discussed [here](03_intro_to_cloud_storage). s3 Glacier is a cost-effective way of storing s3 files that you do not need to access frequently. \n",
"The four most common types of storage you will encounter on AWS are: Elastic Block Storage (EBS), Elastic File Storage (EFS), Simple Storage Service (s3) and s3 Glacier. In the simplest terms, EBS is analogous to a computer hard drive and EFS is analogous to a network file system (NFS) or shared file system. s3 is AWS's object storage which is discussed [here](05_intro_to_cloud_storage). s3 Glacier is a cost-effective way of storing s3 files that you do not need to access frequently. \n",
"```\n",
"\n",
"Here will will select a `t2.micro` instance which is Free Tier Eligible but only has 1vCPU and 1 GiB of memory. The cost of running a **t2.micro** instance is, at the time of publication, as follows: \n",
"\n",
"![Choose an Instance Type](images/ec2-type.png)\n",
"\n",
"Select **Next: Configure Instance Details**."
"Here will will select a ```t2.micro``` instance which is Free Tier Eligible but only has 1vCPU and 1 GiB of memory. The cost of running a t2.micro instance is "
]
},
{
"cell_type": "markdown",
"id": "285aad80-5670-4bdf-b9c3-86439720e9e1",
"metadata": {
"tags": []
},
"id": "ca6a7991",
"metadata": {},
"source": [
"## Configure Instance Details (Step 3)\n",
"![Choose an Instance Type](images/ec2-type.png)\n",
"\n",
"Select ```Next: Configure Instance Details```.\n",
"\n",
"## Step 3: Configure Instance Details\n",
"Step 3 in creating an EC2 instance involves a rudimentary understanding of several key AWS and cloud jargon (Figure 4). While delving deeper into some of the terminology is outside of the scope of CLASS Essentials, we go will through these terms in brief as we learn how to configure your EC2 instance. For the most part, we will **leave the settings as default**. CLASS Intermediate offers a more in depth discussion on cloud concepts. \n",
"\n",
"![Configure Instance Details](images/ec2-configure.png)\n",
Expand All @@ -136,15 +133,15 @@
"\n",
"```{admonition} Note\n",
":class: note\n",
"Recall that we learned about regions in the [previous chapter](01_intro_to_cloud_console). \n",
"Recall that we learned about regions in the [previous chapter](./01_intro_to_cloud_console). \n",
"```\n",
"\n",
"**Purchasing Options** : Throughout your AWS journey, you will hear the term **Spot Instances**. Spot instances make use of the servers that go unused in AWS data centers to minimize costs. Recall that AWS has many data centers spread across the globe and not all their servers are utilized at 100% capacity at all times. Amazon uses Spot Instances as a flexible way to profit from extra capacity. Users have access to Spot Instances through a bidding process, sometimes users can save up to 90% off the on-deman compute instance this way! We will not expand much more on Spot Instances in CLASS Essentials but if you are interested, I2's CLASS Intermediate talks more "
]
},
{
"cell_type": "markdown",
"id": "9c874bad",
"id": "97271ddd",
"metadata": {},
"source": [
"```{admonition} Exercise\n",
Expand All @@ -157,87 +154,72 @@
},
{
"cell_type": "markdown",
"id": "b36239c2-a76b-46e7-a495-d6da6e4598a4",
"id": "32d19e24",
"metadata": {},
"source": [
"## Review Progress\n",
"\n",
"In the previous steps we learned how to launch a virtual machine from the AWS console. We selected an Amazon Machine Image (AMI), Chose an Instance and Configured Launch Settings. Recall that there are 7 steps to walk through to create a new EC2 instance; we will go through each in detail: \n",
"\n",
"1. Select an AMI\n",
"2. Choose Instance Type\n",
"3. Configure Instance \n",
"4. Add Storage\n",
"5. Add Tags\n",
"6. Configure Security Group\n",
"7. Review/Launch"
]
"source": []
},
{
"cell_type": "markdown",
"id": "07b8ec13-c056-4236-ac14-12926bd7f872",
"id": "7820264f",
"metadata": {},
"source": [
"## Add Storage (Step 4)\n",
"## Step 4. Add Storage\n",
"\n",
"Storage on an EC2 instance is akin to a hard drive. Here we will leave the default settings but it is important to know that a hard drive on an EC2 instance is known as [Elastic Block Storage](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html). EBS volumes behave like raw, unformatted block devices.\n",
"\n",
"![ec2-storage](images/ec2-storage.png)"
"<img src=\"./images/ec2-storage.png\" width=720 align=\"center\">"
]
},
{
"cell_type": "markdown",
"id": "a29c2a86-c864-493c-9e3f-0b4cced47dd9",
"id": "309bdc6d",
"metadata": {},
"source": [
"## Add Tags (Step 5)\n",
"## Step 5: Add Tags\n",
"\n",
"[Tags](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) are labels that you assign to an AWS resource. Each tag consists of a key and an optional value, both of which you define.Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. e\n",
"\n",
"![ec2-tags](images/ec2-tags.png)"
"<img src=\"./images/ec2-tags.png\" width=720 align=\"center\">\n"
]
},
{
"cell_type": "markdown",
"id": "45d695b3-c39b-4889-af48-a0bfb901cb32",
"id": "2835744d",
"metadata": {},
"source": [
"## Step 6: Configure Security Group (Step 6)\n",
"## Step 6: Configure Security Group\n",
"\n",
"A [security group](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) acts as a virtual firewall for your EC2 instances to control inbound and outbound traffic. Again, we will not delve too much into networking protocols in CLASS Essentials. We will leave the default values of opening port 22 so that we can securely log in to the EC2 instance that we create. \n",
"\n",
"![ec2-sg](images/ec2-sg.png)"
"<img src=\"./images/ec2-sg.png\" width=720 align=\"center\">"
]
},
{
"cell_type": "markdown",
"id": "5334a614-fb7f-409f-8aba-d1f18c92bc60",
"id": "56318ce3",
"metadata": {},
"source": [
"## Step 7: Review Instance Launch\n",
"\n",
"Next review the details and click on **Launch**\n",
"![ec2-launch](images/ec2-launch.png)\n",
"<img src=\"./images/ec2-launch.png\" width=720 align=\"center\">\n",
"\n",
"You will be prompted to generate a ssh-key to access the virtual machine. For now we will create a new one by entering `essentials-aws` in the key name and clicking **Download**\n",
"![ec2-sshkey](images/ec2-sshkey.png)\n",
"<img src=\"./images/ec2-sshkey.png\" width=720 align=\"center\">\n",
"\n",
"You shoudl now see the following message\n",
"![ec2-confirm](images/ec2-confirm.png)\n",
"\n",
"Congratulations, you have created a virtual machine.\n",
"\n",
"```{admonition} Caution\n",
":class: caution\n",
"\n",
"We will delete this virtual machine later. If you do not, **you will be charged for the running machine**.\n",
"```"
"<img src=\"./images/ec2-confirm.png\" width=720 align=\"center\">"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0a851856",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -251,7 +233,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.10.2"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit e85a37e

Please sign in to comment.