SlideShare a Scribd company logo
1 of 26
Download to read offline
Amazon Web Services for scientific computing
Alexander Novikov
June 18, 2015
Alexander Novikov AWS for scientific computing June 18, 2015 1 / 21
1 Overview
2 Ipython Notebook example
3 Other stuff
4 Cleaning up
5 Troubleshooting
Alexander Novikov AWS for scientific computing June 18, 2015 2 / 21
Summary
1 Start 1 or 1000 configured servers in 5 minutes;
2 Run anything you want (you control OS and software);
3 Vary the size of your server (from micro instance to 32 cores 244 Gb
of RAM, to 4 GPUs onboard);
4 Pay per hour;
5 1 server for 100 hours cost the same as 100 servers for 1 hour.
Alexander Novikov AWS for scientific computing June 18, 2015 3 / 21
Amazon sell books don’t they?
Alexander Novikov AWS for scientific computing June 18, 2015 4 / 21
Amazon Web Services – AWS
We focus on Amazon Elastic Compute Cloud – EC2.
Alexander Novikov AWS for scientific computing June 18, 2015 5 / 21
Ipython in a cloud
You will run Ipython Notebook on AWS server in Frankfurt.
If you don’t have an AWS account but want to follow the tutorial, go to
the spreadsheet from my email and claim one of the servers.
Alexander Novikov AWS for scientific computing June 18, 2015 6 / 21
Running a server
1 Log into the AWS console;
2 Click on EC2;
3 Choose a region (Frankfurt is the closest; N. Virginia and Oregon are
cost effective);
4 Click Launch Instance (server);
5 Choose Ubuntu 14.04 (HVM);
6 Choose t2.micro (it’s free);
7 Next;
8 Choose the size of the root drive;
9 Name your instance;
10 Click Review and Launch;
11 Now review and click Launch.
Alexander Novikov AWS for scientific computing June 18, 2015 7 / 21
SSH keys
AWS use ssh keys to protect your connection to the server.
Name your key, click download, and save it in a safe location.
On Linux, you will need to restrict the access to the file:
$ cd Downloads/
$ chmod 400 key_name.pem
Alexander Novikov AWS for scientific computing June 18, 2015 8 / 21
Connect & update
On Linux and Max, connect with ssh tool
$ ssh -i tutorial.pem ubuntu@52.28.135.168
On Windows, convert your key to ppk and connect with PuTTY (user
name is ubuntu, ssh key file is key_name.ppk).
Update the server
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo reboot
Alexander Novikov AWS for scientific computing June 18, 2015 9 / 21
Install miniconda
Download the installer
$ wget https://repo.continuum.io/miniconda/...
Make it runnable and install (use tab for autocompletion)
$ chmod +x ./Miniconda-latest-Linux-x86_64.sh
$ ./Miniconda-latest-Linux-x86_64.sh
Now reconnect to the server (ctr + d to disconnect) and install conda
packages
$ conda install ipython ipython-notebook
Alexander Novikov AWS for scientific computing June 18, 2015 10 / 21
Networking
Generate an HTTPS certificate (you can leave the defaults for all the
questions)
$ ipython profile create nbserver
$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 
-keyout mycert.pem -out mycert.pem
Hash your password
$ ipython
from IPython.lib import passwd
passwd()
Alexander Novikov AWS for scientific computing June 18, 2015 11 / 21
Configure Ipython Notebook
Let’s find and edit the configuration file
$ find ./ -name "*notebook_config*"
$ nano 
.ipython/profile_nbserver/ipython_notebook_config.py
Add the following lines after c = get_config()
c.NotebookApp.certfile = u'/home/ubuntu/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:207eb1f4671f:92af6...'
c.NotebookApp.port = 8888
Alexander Novikov AWS for scientific computing June 18, 2015 12 / 21
Nano
Nano is a command line editor.
Essential commands (like ctr + o for saving and ctr + x to exit) are listed
on the bottom of the interface.
Alexander Novikov AWS for scientific computing June 18, 2015 13 / 21
Almost there
Run the notebook
$ ipython notebook --profile=nbserver
Find the public URL of your server in AWS console (e.g. https://
ec2-52-28-135-168.eu-central-1.compute.amazonaws.com:8888)
and open it in a browser.
Aaand it doesn’t work.
Alexander Novikov AWS for scientific computing June 18, 2015 14 / 21
Security groups
Go to the Security Groups tab and open incoming traffic on the 8888 port.
Alexander Novikov AWS for scientific computing June 18, 2015 15 / 21
Tmux
If you close the terminal now, the program will be killed.
Use tmux to run it in the background and be able to see the output.
$ tmux # Create new terminal.
$ ctr + b d # Detach from the current terminal.
$ tmux attach # Attach to an existing terminal.
Alexander Novikov AWS for scientific computing June 18, 2015 16 / 21
Terminating a server
When you terminate your server it’s hard drive is erased.
1 Next time you have to configure the server from scratch;
2 You cannot store any data (experiment results).
Alexander Novikov AWS for scientific computing June 18, 2015 17 / 21
Amazon Machine Image – AMI
Template from AWS instances are launched;
OS + software;
Launch different instance types from the same AMI;
You customize (install custom software, services, config, etc) and
make your own AMI;
AWS Marketplace makes it easy to launch a number of popular
applications (e.g, MongoDB, Cafee, OpenCV, etc.).
Alexander Novikov AWS for scientific computing June 18, 2015 18 / 21
Elastic Block Storage – EBS
Create a permanent magnetic or SSD volume of any size;
Connect (disconnect) the volume to any server in its data center
(availability group).
Alexander Novikov AWS for scientific computing June 18, 2015 19 / 21
Spot instances
Bid $X per hour;
If current price > bid, instance terminates;
You pay the market price, not the bids.
Alexander Novikov AWS for scientific computing June 18, 2015 20 / 21
Workflow
Create a small instance, set up all the software, download all the data;
Make an AMI;
Start a powerful spot instance (or a dozen) from your AMI;
Create a permanent volume and connect it to the instance;
Process the data (in tmux!) and write the results into the volume;
Terminate the instance.
Alexander Novikov AWS for scientific computing June 18, 2015 21 / 21
Other stuff
Run a program on a server and see its GUI on your laptop (ssh -X);
Use scp to download data to and from your server;
Use df -h to see all the disk mounted to the server;
Use htop to see running processes;
Set up a monitoring so when your server stops working you get an
email;
Explore AWS bill https://console.aws.amazon.com/billing;
Apply for an AWS academic grant.
Alexander Novikov AWS for scientific computing June 18, 2015 22 / 21
Cleaning up
Got to the console and terminate your server;
Go to the volume tab and remove all your volumes;
Alexander Novikov AWS for scientific computing June 18, 2015 23 / 21
Unprotected private key
If you see this message when trying to connect
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0660 for ’tutorial.pem’ are too open.
It is required that your private key files are NOT
accessible by others.
This private key will be ignored.
bad permissions: ignore key: tutorial.pem
Permission denied (publickey).
Just set more restrictive permissions for your key file
$ chmod 400 key_name.pem
Alexander Novikov AWS for scientific computing June 18, 2015 22 / 21
Full volume
Your program says «Cannot write a file»?
Check your volumes, they are probably full. To list all mounted volumes
and their sizes use
$ df -h
Alexander Novikov AWS for scientific computing June 18, 2015 21 / 21
Slow down
Everything start beeing slow?
You probably burnt all your volumes I/O capacity. Wait so it can restore
or order a bigger volume (see https://docs.aws.amazon.com/AWSEC2/
latest/UserGuide/EBSVolumeTypes.html for details).
Alexander Novikov AWS for scientific computing June 18, 2015 21 / 21

More Related Content

What's hot

AWS Webcast - Amazon EC2 Masterclass
AWS Webcast - Amazon EC2 MasterclassAWS Webcast - Amazon EC2 Masterclass
AWS Webcast - Amazon EC2 MasterclassAmazon Web Services
 
How To Create instances in AWS EC2 | Edureka
How To Create instances in AWS EC2 | EdurekaHow To Create instances in AWS EC2 | Edureka
How To Create instances in AWS EC2 | EdurekaEdureka!
 
Amazon EC2 Systems Manager (March 2017)
Amazon EC2 Systems Manager (March 2017)Amazon EC2 Systems Manager (March 2017)
Amazon EC2 Systems Manager (March 2017)Julien SIMON
 
Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)Jason "JP" Pomerleau
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Julien SIMON
 
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...Amazon Web Services
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Julien SIMON
 
AWS Compute Services
AWS Compute ServicesAWS Compute Services
AWS Compute ServicesSabir Mustafa
 
Amazon Ec2 Application Design
Amazon Ec2 Application DesignAmazon Ec2 Application Design
Amazon Ec2 Application Designguestd0b61e
 
Don't think about the difficulty Let's try to connect easy to IPv6 network w...
 Don't think about the difficulty Let's try to connect easy to IPv6 network w... Don't think about the difficulty Let's try to connect easy to IPv6 network w...
Don't think about the difficulty Let's try to connect easy to IPv6 network w...Namba Kazuo
 
CI&CD with AWS - AWS Prague User Group - May 2015
CI&CD with AWS - AWS Prague User Group - May 2015CI&CD with AWS - AWS Prague User Group - May 2015
CI&CD with AWS - AWS Prague User Group - May 2015Vladimir Simek
 
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity OptionsCreating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity OptionsAmazon Web Services
 
Training AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCacheTraining AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCacheBùi Quang Lâm
 
Amazon Web Service EC2 & S3
Amazon Web Service EC2 & S3Amazon Web Service EC2 & S3
Amazon Web Service EC2 & S3Pravin Vaja
 
(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...
(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...
(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...Amazon Web Services
 
VMware and AWS together (June 2017)
VMware and AWS together (June 2017)VMware and AWS together (June 2017)
VMware and AWS together (June 2017)Julien SIMON
 
Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)Julien SIMON
 

What's hot (20)

Amazon EC2
Amazon EC2Amazon EC2
Amazon EC2
 
Amazon ec2
Amazon ec2Amazon ec2
Amazon ec2
 
AWS Webcast - Amazon EC2 Masterclass
AWS Webcast - Amazon EC2 MasterclassAWS Webcast - Amazon EC2 Masterclass
AWS Webcast - Amazon EC2 Masterclass
 
How To Create instances in AWS EC2 | Edureka
How To Create instances in AWS EC2 | EdurekaHow To Create instances in AWS EC2 | Edureka
How To Create instances in AWS EC2 | Edureka
 
Amazon EC2 Systems Manager (March 2017)
Amazon EC2 Systems Manager (March 2017)Amazon EC2 Systems Manager (March 2017)
Amazon EC2 Systems Manager (March 2017)
 
Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)Introduction to Amazon Web Services (AWS)
Introduction to Amazon Web Services (AWS)
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)
 
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
Running Lean and Mean: Designing Cost-efficient Architectures on AWS (ARC313)...
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)
 
AWS Compute Services
AWS Compute ServicesAWS Compute Services
AWS Compute Services
 
Amazon Ec2 Application Design
Amazon Ec2 Application DesignAmazon Ec2 Application Design
Amazon Ec2 Application Design
 
Don't think about the difficulty Let's try to connect easy to IPv6 network w...
 Don't think about the difficulty Let's try to connect easy to IPv6 network w... Don't think about the difficulty Let's try to connect easy to IPv6 network w...
Don't think about the difficulty Let's try to connect easy to IPv6 network w...
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
CI&CD with AWS - AWS Prague User Group - May 2015
CI&CD with AWS - AWS Prague User Group - May 2015CI&CD with AWS - AWS Prague User Group - May 2015
CI&CD with AWS - AWS Prague User Group - May 2015
 
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity OptionsCreating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
Creating Your Virtual Data Center: VPC Fundamentals and Connectivity Options
 
Training AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCacheTraining AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCache
 
Amazon Web Service EC2 & S3
Amazon Web Service EC2 & S3Amazon Web Service EC2 & S3
Amazon Web Service EC2 & S3
 
(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...
(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...
(BAC304) Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum...
 
VMware and AWS together (June 2017)
VMware and AWS together (June 2017)VMware and AWS together (June 2017)
VMware and AWS together (June 2017)
 
Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)
 

Viewers also liked

Architecting in Cloud : Your Guide to Amazon Web Services
Architecting in Cloud : Your Guide to Amazon Web ServicesArchitecting in Cloud : Your Guide to Amazon Web Services
Architecting in Cloud : Your Guide to Amazon Web ServicesEdureka!
 
Architecting in Cloud : Your Guide to AWS
Architecting in Cloud : Your Guide to AWSArchitecting in Cloud : Your Guide to AWS
Architecting in Cloud : Your Guide to AWSEdureka!
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud ComputingEdureka!
 
AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)
AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)
AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)Amazon Web Services
 
AWS Webcast - Active Directory on AWS
AWS Webcast - Active Directory on AWSAWS Webcast - Active Directory on AWS
AWS Webcast - Active Directory on AWSAmazon Web Services
 
Intro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesIntro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesAmazon Web Services
 

Viewers also liked (7)

Architecting in Cloud : Your Guide to Amazon Web Services
Architecting in Cloud : Your Guide to Amazon Web ServicesArchitecting in Cloud : Your Guide to Amazon Web Services
Architecting in Cloud : Your Guide to Amazon Web Services
 
Architecting in Cloud : Your Guide to AWS
Architecting in Cloud : Your Guide to AWSArchitecting in Cloud : Your Guide to AWS
Architecting in Cloud : Your Guide to AWS
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)
AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)
AWS re:Invent 2016: Amazon EC2 Foundations (CMP203)
 
Amazon EC2 Masterclass
Amazon EC2 MasterclassAmazon EC2 Masterclass
Amazon EC2 Masterclass
 
AWS Webcast - Active Directory on AWS
AWS Webcast - Active Directory on AWSAWS Webcast - Active Directory on AWS
AWS Webcast - Active Directory on AWS
 
Intro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesIntro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute Services
 

Similar to AWS EC2 tutorial

Leveraging Elastic Web-Scale Computing with AWS
Leveraging Elastic Web-Scale Computing with AWSLeveraging Elastic Web-Scale Computing with AWS
Leveraging Elastic Web-Scale Computing with AWSAmazon Web Services
 
OSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom FifieldOSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom FifieldOSCON Byrum
 
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2Amazon Web Services
 
How to build an event-driven, polyglot serverless microservices framework on ...
How to build an event-driven, polyglot serverless microservices framework on ...How to build an event-driven, polyglot serverless microservices framework on ...
How to build an event-driven, polyglot serverless microservices framework on ...Animesh Singh
 
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon DrangeHåkon Eriksen Drange
 
Ubuntu Cloud at Florida Linux Show
Ubuntu Cloud at Florida Linux ShowUbuntu Cloud at Florida Linux Show
Ubuntu Cloud at Florida Linux Showzoopster
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 
Lab Manual Managed Database Basics
Lab Manual Managed Database BasicsLab Manual Managed Database Basics
Lab Manual Managed Database BasicsAmazon Web Services
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017Amazon Web Services
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetesWilliam Stewart
 
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakiGoogle Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakijavier ramirez
 
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul MaddoxAWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul MaddoxAWS Riyadh User Group
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdfNigussMehari4
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administratorsSharon James
 
How automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous DeliveryHow automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous DeliveryEdmund Siegfried Haselwanter
 
Startup guide for kvm on cent os 6
Startup guide for kvm on cent os 6Startup guide for kvm on cent os 6
Startup guide for kvm on cent os 6Carlos Eduardo
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetesBen Hall
 

Similar to AWS EC2 tutorial (20)

Leveraging Elastic Web-Scale Computing with AWS
Leveraging Elastic Web-Scale Computing with AWSLeveraging Elastic Web-Scale Computing with AWS
Leveraging Elastic Web-Scale Computing with AWS
 
OSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom FifieldOSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
 
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
 
How to build an event-driven, polyglot serverless microservices framework on ...
How to build an event-driven, polyglot serverless microservices framework on ...How to build an event-driven, polyglot serverless microservices framework on ...
How to build an event-driven, polyglot serverless microservices framework on ...
 
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
 
Ubuntu Cloud at Florida Linux Show
Ubuntu Cloud at Florida Linux ShowUbuntu Cloud at Florida Linux Show
Ubuntu Cloud at Florida Linux Show
 
London Hug 20/6 - Vault production
London Hug 20/6 - Vault productionLondon Hug 20/6 - Vault production
London Hug 20/6 - Vault production
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Lab Manual Managed Database Basics
Lab Manual Managed Database BasicsLab Manual Managed Database Basics
Lab Manual Managed Database Basics
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakiGoogle Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
 
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul MaddoxAWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
AWS reinvent 2019 recap - Riyadh - Containers and Serverless - Paul Maddox
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
How automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous DeliveryHow automated cloud infrastructure setups can help with Continuous Delivery
How automated cloud infrastructure setups can help with Continuous Delivery
 
Startup guide for kvm on cent os 6
Startup guide for kvm on cent os 6Startup guide for kvm on cent os 6
Startup guide for kvm on cent os 6
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

AWS EC2 tutorial

  • 1. Amazon Web Services for scientific computing Alexander Novikov June 18, 2015 Alexander Novikov AWS for scientific computing June 18, 2015 1 / 21
  • 2. 1 Overview 2 Ipython Notebook example 3 Other stuff 4 Cleaning up 5 Troubleshooting Alexander Novikov AWS for scientific computing June 18, 2015 2 / 21
  • 3. Summary 1 Start 1 or 1000 configured servers in 5 minutes; 2 Run anything you want (you control OS and software); 3 Vary the size of your server (from micro instance to 32 cores 244 Gb of RAM, to 4 GPUs onboard); 4 Pay per hour; 5 1 server for 100 hours cost the same as 100 servers for 1 hour. Alexander Novikov AWS for scientific computing June 18, 2015 3 / 21
  • 4. Amazon sell books don’t they? Alexander Novikov AWS for scientific computing June 18, 2015 4 / 21
  • 5. Amazon Web Services – AWS We focus on Amazon Elastic Compute Cloud – EC2. Alexander Novikov AWS for scientific computing June 18, 2015 5 / 21
  • 6. Ipython in a cloud You will run Ipython Notebook on AWS server in Frankfurt. If you don’t have an AWS account but want to follow the tutorial, go to the spreadsheet from my email and claim one of the servers. Alexander Novikov AWS for scientific computing June 18, 2015 6 / 21
  • 7. Running a server 1 Log into the AWS console; 2 Click on EC2; 3 Choose a region (Frankfurt is the closest; N. Virginia and Oregon are cost effective); 4 Click Launch Instance (server); 5 Choose Ubuntu 14.04 (HVM); 6 Choose t2.micro (it’s free); 7 Next; 8 Choose the size of the root drive; 9 Name your instance; 10 Click Review and Launch; 11 Now review and click Launch. Alexander Novikov AWS for scientific computing June 18, 2015 7 / 21
  • 8. SSH keys AWS use ssh keys to protect your connection to the server. Name your key, click download, and save it in a safe location. On Linux, you will need to restrict the access to the file: $ cd Downloads/ $ chmod 400 key_name.pem Alexander Novikov AWS for scientific computing June 18, 2015 8 / 21
  • 9. Connect & update On Linux and Max, connect with ssh tool $ ssh -i tutorial.pem ubuntu@52.28.135.168 On Windows, convert your key to ppk and connect with PuTTY (user name is ubuntu, ssh key file is key_name.ppk). Update the server $ sudo apt-get update $ sudo apt-get upgrade $ sudo reboot Alexander Novikov AWS for scientific computing June 18, 2015 9 / 21
  • 10. Install miniconda Download the installer $ wget https://repo.continuum.io/miniconda/... Make it runnable and install (use tab for autocompletion) $ chmod +x ./Miniconda-latest-Linux-x86_64.sh $ ./Miniconda-latest-Linux-x86_64.sh Now reconnect to the server (ctr + d to disconnect) and install conda packages $ conda install ipython ipython-notebook Alexander Novikov AWS for scientific computing June 18, 2015 10 / 21
  • 11. Networking Generate an HTTPS certificate (you can leave the defaults for all the questions) $ ipython profile create nbserver $ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem Hash your password $ ipython from IPython.lib import passwd passwd() Alexander Novikov AWS for scientific computing June 18, 2015 11 / 21
  • 12. Configure Ipython Notebook Let’s find and edit the configuration file $ find ./ -name "*notebook_config*" $ nano .ipython/profile_nbserver/ipython_notebook_config.py Add the following lines after c = get_config() c.NotebookApp.certfile = u'/home/ubuntu/mycert.pem' c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.password = u'sha1:207eb1f4671f:92af6...' c.NotebookApp.port = 8888 Alexander Novikov AWS for scientific computing June 18, 2015 12 / 21
  • 13. Nano Nano is a command line editor. Essential commands (like ctr + o for saving and ctr + x to exit) are listed on the bottom of the interface. Alexander Novikov AWS for scientific computing June 18, 2015 13 / 21
  • 14. Almost there Run the notebook $ ipython notebook --profile=nbserver Find the public URL of your server in AWS console (e.g. https:// ec2-52-28-135-168.eu-central-1.compute.amazonaws.com:8888) and open it in a browser. Aaand it doesn’t work. Alexander Novikov AWS for scientific computing June 18, 2015 14 / 21
  • 15. Security groups Go to the Security Groups tab and open incoming traffic on the 8888 port. Alexander Novikov AWS for scientific computing June 18, 2015 15 / 21
  • 16. Tmux If you close the terminal now, the program will be killed. Use tmux to run it in the background and be able to see the output. $ tmux # Create new terminal. $ ctr + b d # Detach from the current terminal. $ tmux attach # Attach to an existing terminal. Alexander Novikov AWS for scientific computing June 18, 2015 16 / 21
  • 17. Terminating a server When you terminate your server it’s hard drive is erased. 1 Next time you have to configure the server from scratch; 2 You cannot store any data (experiment results). Alexander Novikov AWS for scientific computing June 18, 2015 17 / 21
  • 18. Amazon Machine Image – AMI Template from AWS instances are launched; OS + software; Launch different instance types from the same AMI; You customize (install custom software, services, config, etc) and make your own AMI; AWS Marketplace makes it easy to launch a number of popular applications (e.g, MongoDB, Cafee, OpenCV, etc.). Alexander Novikov AWS for scientific computing June 18, 2015 18 / 21
  • 19. Elastic Block Storage – EBS Create a permanent magnetic or SSD volume of any size; Connect (disconnect) the volume to any server in its data center (availability group). Alexander Novikov AWS for scientific computing June 18, 2015 19 / 21
  • 20. Spot instances Bid $X per hour; If current price > bid, instance terminates; You pay the market price, not the bids. Alexander Novikov AWS for scientific computing June 18, 2015 20 / 21
  • 21. Workflow Create a small instance, set up all the software, download all the data; Make an AMI; Start a powerful spot instance (or a dozen) from your AMI; Create a permanent volume and connect it to the instance; Process the data (in tmux!) and write the results into the volume; Terminate the instance. Alexander Novikov AWS for scientific computing June 18, 2015 21 / 21
  • 22. Other stuff Run a program on a server and see its GUI on your laptop (ssh -X); Use scp to download data to and from your server; Use df -h to see all the disk mounted to the server; Use htop to see running processes; Set up a monitoring so when your server stops working you get an email; Explore AWS bill https://console.aws.amazon.com/billing; Apply for an AWS academic grant. Alexander Novikov AWS for scientific computing June 18, 2015 22 / 21
  • 23. Cleaning up Got to the console and terminate your server; Go to the volume tab and remove all your volumes; Alexander Novikov AWS for scientific computing June 18, 2015 23 / 21
  • 24. Unprotected private key If you see this message when trying to connect @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0660 for ’tutorial.pem’ are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: tutorial.pem Permission denied (publickey). Just set more restrictive permissions for your key file $ chmod 400 key_name.pem Alexander Novikov AWS for scientific computing June 18, 2015 22 / 21
  • 25. Full volume Your program says «Cannot write a file»? Check your volumes, they are probably full. To list all mounted volumes and their sizes use $ df -h Alexander Novikov AWS for scientific computing June 18, 2015 21 / 21
  • 26. Slow down Everything start beeing slow? You probably burnt all your volumes I/O capacity. Wait so it can restore or order a bigger volume (see https://docs.aws.amazon.com/AWSEC2/ latest/UserGuide/EBSVolumeTypes.html for details). Alexander Novikov AWS for scientific computing June 18, 2015 21 / 21