• No results found

FREE computing using Amazon EC2

N/A
N/A
Protected

Academic year: 2021

Share "FREE computing using Amazon EC2"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

FREE computing using Amazon EC2

Seong-Hwan Jun1 1Department of Statistics

Univ of British Columbia

(2)

Outline

Basics of servers

Amazon EC2

Setup R on an EC2 instance

(3)

What is “server”?

I Basically computers just like the one you have but no monitor I A lot of computers

I Stacked on a rack

I Connected in a network – fast transfer of data between the computers

I Shares hard drive storage and in many cases memory (RAM) as well

I Its only purpose is to process something like crunch numbers that’s why there is no need for monitors

I Usually a variant of Unix installed because they are much more stable than Windows

(4)
(5)

When should you run jobs on the servers?

I Jobs that take long time to finish

I When you have multiple jobs that can run in parallel

I Pretty much all the time because you need your computer to do other things like. . . facebook

I Why not? These machines do nothing except to crunch numbers and process jobs

(6)

When NOT to run jobs on the servers

I During the development stage of your code, you should run small jobs on your computer to get quick results to verify correctness of your code as you develop

(7)

Outline

Basics of servers

Amazon EC2

Setup R on an EC2 instance

(8)

Cloud computing

I Cloud computing is the concept of not having to know where your servers are located

I These computers are there somewhere in the clouds of servers. . .

I When you launch a job into the cloud, one of the available computers will get the job and run it – you won’t know exactly which computer is running your job

(9)

Amazon Elastic Cloud Computing

I EC2 for short

I An individual computer on the Amazon’s cloud of computers is referred to as aninstance

I There are many types of instances –

micro,

small, medium, large, extra large, and so on and so on.

I Only the

micro

instances are free. . . But the other instances are quite cheap if you ever need fast computers

(10)

How to use EC2 instances

1. Sign up for an account

2. You need to provide your credit card information – make sure you read the rules carefully so that you don’t get charged

3. Once you sign up, you get 750 free hours of computing per month!

4. You can use these hours anyway you want – for example, you can get 10 EC2 instances at once, run 10 jobs (1 job per instance) simultaneously for 75 hours or get one instance and run a job on it for 750 hours

(11)
(12)

Other Amazon services

Amazon offers wide variety of services under the brand name of “Amazon Web Services” (Details:

http://aws.amazon.com/

) The most useful service for us is EBS and S3,

I Storage for very large and frequently used data (GB’s or even more)

I These data are easily accessible from the EC2 instances I EBS is free up to 30GB – S3 is not free but quite cheap

(13)

Here are some of the things you can do with AWS:

I MapReduce for natural language processing (e.g., counting n-grams)

I Any machine learning problem where datasize does not fit in your personal computer

I Scientific computing – R, MATLAB, python, Java, C++, and etc I Storing genome sequences (human and other species) on EBS

or S3 – process it using EC2 instances

I Amazon has many large datasets publicly available –

http://aws.amazon.com/datasets?_encoding=

UTF8&jiveRedirect=1

(14)

Outline

Basics of servers

Amazon EC2

Setup R on an EC2 instance

(15)

Creating a free instance

The instructions are well described here:

http://www.r-bloggers.com/

automating-r-scripts-on-amazon-ec2/

You can also Google the following keywords: “Amazon EC2 R” or other combination of relevant keywords for a step-by-step instructions.

(16)

Key-pair

Logging in to our department server requires username and password.

I To log in to an EC2 instance, you use something called key pair. I These are files that you download once when you create them

and keep in your computer

(17)

Logging in

Public DNS

(18)

Logging in

Commands

Now you can login using the key-pair file and the public DNS,

1. chmod 400 key.pem

2. ssh -i key.pem ubuntu@public-dns Example:

(19)

Installing R

Type the following commands,

1. sudo apt-get update

2. sudo apt-get -y install r-base

3. type “R” on the command prompt to ensure that the installation was successful

The second command is the command for installing R. It may take up to few minutes.

(20)

Running R jobs

Refer to Song Cai’s slides or search the Google by yourself (most of you know how to do it already).

(21)

Things that you can do on an EC2 instance

I Run Java, C, C++, Fortran, and other jobs

I Host a web server – you can get your results via your personal private website

I One example usage:

1. Use C++, Java, or R to connect to your stock broker’s trading platform (API)

2. Run your trading algorithm on multiple instances of EC2

3. Process the results at night using R on EC2

4. View the results through your web on your phone on the bus to school or during a boring morning class

I or you can just run your R code with multiple different inputs over different instances of EC2

(22)

Outline

Basics of servers

Amazon EC2

Setup R on an EC2 instance

(23)

How to use stat department servers

. . . PhD student Song Cai gave a talk on it last year and he asked me to give one on it this year. His slides are very good (concise) so we will just go over it together.

References

Related documents

Start assigning numbers for each carbon in the parent chain beginning at the terminal carbon nearest the principal functional group or the first branch point (in alkanes and

The elastic body of the sensor mechanical structure comprises of central support beam, cross elastic beams, compliant beams and base of the body.. Here the

Such a collegiate cul- ture, like honors cultures everywhere, is best achieved by open and trusting relationships of the students with each other and the instructor, discussions

The aim of this paper is twofold: 1) to present the findings of COSI Round 2 and investigate whether differ- ences exist in mean values of anthropometric measure- ments

Single scale model-based obstacle detection framework presents a viable basis for im- plementing complete embedded obstacle detection systems, depending on the environment

In contrast, test materials are defined by the Ethics Code in Standard 9.11, Maintaining Test Security: “The term test materials refers to manuals, instruments, protocols, and test

Whatever form the system’s real input meters take, it’s paramount that you fi nd out where they are, because they allow you to speedily eliminate a whole section of the stu- dio

SCR01010 and FM00204 specifically inhibited Plk1 function in cells by affecting the conformation and mechanism of regulation of Plk1, enhancing or inhibiting the