Transcript
Page 1: Intorduction to AWS and Boto

@chteijon@MindtheByte

Introduction to AMAZON WEB SERVICES and BOTO

Page 2: Intorduction to AWS and Boto

2

@chteijon@MindtheByte

EC2: Elastic Compute Cloud

Page 3: Intorduction to AWS and Boto

3

@chteijon@MindtheByte

EC2: Elastic Compute Cloud

KEY_ID='AGIAJPPYZBKTWGGX8AHS'KEY_SECRET='RwXTKmn7Ujfqmdsakcs/MRdf89sdSDffxU8sjRuD'REGION="us-west-1"

ec2 = boto.connect_ec2( KEY_ID, KEY_SECRET, region=REGION )

reservation = ec2.run_instances( image_id=AMI_ID, key_name=KEY_HANDLE, instance_type=INSTANCE_TYPE, security_groups = [ SGS ] )

Boto code:

Page 4: Intorduction to AWS and Boto

4

@chteijon@MindtheByte

EC2: AMI (Amazon Machine Image)

Page 5: Intorduction to AWS and Boto

5

@chteijon@MindtheByte

EC2: Spot instance

On demand price:

90%

discount!

Page 6: Intorduction to AWS and Boto

6

@chteijon@MindtheByte

EC2: Spot instance

On demand price:

90%

discount!

ec2 = boto.connect_ec2( KEY_ID, KEY_SECRET, region=REGION )

ec2_conn.request_spot_instances(price=0.1,image_id=AMI,count=1,key_name=KEY_HANDLE,security_group_ids=[ SGS ] ,instance_type= "m1.xlarge",user_data=userdata )

Boto code:

Page 7: Intorduction to AWS and Boto

7

@chteijon@MindtheByte

S3: Simple storage service

Page 8: Intorduction to AWS and Boto

8

@chteijon@MindtheByte

S3: Simple storage service

# Connect to a bucket s3conn = boto.s3.connection.S3Connection( KEY_ID, KEY_SECRET )s3bucket = s3conn.get_bucket(“meetup_python_cloud”)

# Set a keys3key = boto.s3.key.Key(bucketconn)s3key.key = “data/file.txt”s3key.set_contents_from_string(“Some info”,policy=policy)

# Get a keys3key.key = “data/anotherfile.txt”value=s3key.get_contents_as_string()

# Delete a keyS3bucket.delete_key(s3key)

Boto code:

Page 9: Intorduction to AWS and Boto

9

@chteijon@MindtheByte

Amazon S3

How does all this sum up?

Page 10: Intorduction to AWS and Boto

10

@chteijon@MindtheByte

How does all this sum up?

Amazon S3

AMI

Page 11: Intorduction to AWS and Boto

11

@chteijon@MindtheByte

Amazon S3

How does all this sum up?

Page 12: Intorduction to AWS and Boto

12

@chteijon@MindtheByte

Amazon S3

How does all this sum up?

Page 13: Intorduction to AWS and Boto

13

@chteijon@MindtheByte

Amazon S3

How does all this sum up?

Page 14: Intorduction to AWS and Boto

14

@chteijon@MindtheByte

Amazon SQS: Simple Queue Service

Common alternatives to distribute jobs

Amazon RDS : Relational Dabatase Service

Page 15: Intorduction to AWS and Boto

15

@chteijon@MindtheByte

Key advantatges of the cloud

●(almost) Infinite computational power available to speed up your computations

●Pay-as-you-go, no need of initial investment or hardware maintenance costs.