Continuous Deployment with Amazon Web Services by Carlos Conde

Post on 08-May-2015

4,032 views 1 download

transcript

CONTINOUS DEPLOYMENTWITH AMAZON WEB SERVICES

Carlos Conde | Solutions Architecture

CONTINUOUS INTEGRATION

DEVELOPER

SOURCE CODEREPOSITORY

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

PICK TASKS

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

SUBMITCODE

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

SCHEDULE BUILD

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

RECURENTBUILDS

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

CODEFETCH

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

CODE QUALITY TESTS

TEST RESULTS

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

BUILD OUTPUT

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

DOCS

BINARIES / PACKAGES

SOURCE CODE REPOSITORY

DNS

CONTINUOUS INTEGRATION SERVER

PROJECT MANAGEMENT SERVER

BUILDS

PAIN POINTS:• UNIT TESTS INCOMPLETE• MOCKS MAINTENANCE• TEST ENV EXPENSIVE• TEST ENV ≠ PROD

KEY = ITERATION

ITERATION

=MODIFY THE SYSTEM TO BETTER

MEET THE EXPECTATIONS OF YOUR USERS

ON-DEMAND

PAY AS YOU GO

ELASTIC

=PROGRAMMABLE

PLATFORM

AWS CLOUDFORMATION

STACK-BASED DEPLOYMENT SERVICE

CLOUDFORMATIONTEMPLATE

{ "Description" : "Create RDS with username and password", "Resources" : {

"MyDB" : { "Type" : "AWS::RDS::DBInstance", "Properties" : { "AllocatedStorage" : "500", "DBInstanceClass" : "db.m1.small", "Engine" : "MySQL", "EngineVersion" : "5.5", "MasterUsername" : "MyName", "MasterUserPassword" : "MyPassword" } } }}

"AWS::CloudFormation::Init" : { "config" : {

"packages" : { "yum" : { "mysql" : [], "mysql-server" : [], "httpd" : [], "php" : [], "php-mysql" : [] } },

"sources" : { "/var/www/html" : "https://s3.amazonaws.com/my-builds/build-v4.zip" } }}

{ "Parameters" : { "KeyName" : { "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", "Type" : "String" } },}

CLOUDFORMATIONTEMPLATE

PROCEDURALDEFINITION

Create it programmatically

KNOWN CONFIGURATIONStore stack configuration in source control

PARAMETER DRIVEN

Dynamic and user-driven templates

COLLABORATIONShare templates with ease as just files

Template ELBs to front secondary cache

~100 Nginx secondary cache servers

2-3 Nginx mid-tier cache servers

Stack

CLOUDFORMATION TEMPLATEVIDEO CACHING

INFRASTRUCTURECASE S

TUDY

APPLICATIONVERSIONS

&INFRASTRUCTURE

VERSIONS

CLOUDFORMATION TEMPLATE

TEST ENVIRONMENTS

30,000 REQUESTS / SECOND

1 TB TRAFFIC / DAY

CASE STUDY

“…AWS seemed to be the best solution available to allow a small, independent company to rapidly develop and test a completely new infrastructure,

and host it.

We also loved the flexibility that AWS allowed us, when spinning up smaller test environments, for

beta trials, QA, localization, and during development. The low initial cost was also

crucial.”

Alex Evans, CTO

CONTINUOUS DEPLOYMENT

SMALL, FREQUENT CHANGES CONSTANTLY INTEGRATING INTO

PRODUCTION.

11.6sMean time between

deployments (weekday)

1,079Max number of

deployments in a single hour

10,000Mean number of

hosts simultaneously

receiving a deployment

30,000Max number of

hosts simultaneously

receiving a deployment

DEPLOYMENTS AT AMAZON.COM

SOFTWARE DEPLOY

≠PRODUCT LAUNCH

1.5 BILLION PAGE VIEWS

OCTOBER 2012

$83 MILLION IN TRANSACTIONS

4.2 MILLION ITEMS SOLD

CASE STUDY

30 DEPLOYS PER DAY1 DEPLOY EVERY 20 MINUTES

"Production is truly the only place you

can validate your code."

HTTPS://GITHUB.COM/ETSY/DEPLOYINATOR

HTTP://CODEASCRAFT.ETSY.COM/

CASE STUDY

HTTP://SORCERY.SMUGMUG.COM/

AWS OPSWORKSINTEGRATED APPLICATION

MANAGEMENT

MODEL, CONTROL AND AUTOMATEAT ANY SCALE AND COMPLEXITY

A stack represents your application. One stack might be used for staging and another for production.

A layer defines how to setup and configure a set of instances and related resources such as volumes and software.

Tell OpsWorks where it can find your code and define any additional deployment tasks. OpsWorks will take care of deploying your app.

Scale your stack based on time or load. Clone your production stack to a different region. Automate workflows for common tasks.

A stack represents your application. One stack might be used for staging and another for production.

A layer defines how to setup and configure a set of instances and related resources such as volumes and software.

Tell OpsWorks where it can find your code and define any additional deployment tasks. OpsWorks will take care of deploying your app.

Scale your stack based on time or load. Clone your production stack to a different region. Automate workflows for common tasks.

A stack represents your application. One stack might be used for staging and another for production.

A layer defines how to setup and configure a set of instances and related resources such as volumes and software.

Tell OpsWorks where it can find your code and define any additional deployment tasks. OpsWorks will take care of deploying your app.

Scale your stack based on time or load. Clone your production stack to a different region. Automate workflows for common tasks.

A stack represents your application. One stack might be used for staging and another for production.

A layer defines how to setup and configure a set of instances and related resources such as volumes and software.

Tell OpsWorks where it can find your code and define any additional deployment tasks. OpsWorks will take care of deploying your app.

Scale your stack based on time or load. Clone your production stack to a different region. Automate workflows for common tasks.

AWS ElasticBeanstalk

AWSOpsWorks

AWSCloudFormation

Amazon EC2

AWS ElasticBeanstalk

AWSOpsWorks

AWSCloudFormation

Amazon EC2

CONVENIENCE CONTROL

AWS ElasticBeanstalk

AWSOpsWorks

AWSCloudFormation

Amazon EC2

CONVENIENCE CONTROL

HIGH-LEVEL DO IT YOURSELF

FREE OF CHARGE

14 BILLION REQUESTS/MONTH

50 000 DATABASE UPDATES / SEC

NO CACHE

CASE STUDY

“AWS OpsWorks gives us the tools we need to automate operations.

We can scale Monster World, one of the largest Facebook games, to millions of users without ever needing more than two backend developers”

Jesper Richter-ReichhelmHead of engineering – Wooga

A / B TESTING

LOAD TESTING

USING AMAZON EC2 TO SIMULATE

2.4 MILLION PLAYERS

DATA-DRIVENARCHITECTURES

METRICS @ETSY

COST-ORIENTED ARCHITECTURES

PHP+APACHE+VARNISH

NGINX+NODEJS

CONTINUOUS INTEGRATION

CONTINUOUS DEPLOYMENT

CONTINUOUS DEPLOYMENT

=

CONTINUOUS EXPERIMENTATION

CONTINUOUS DEPLOYMENT

=

CONTINUOUS IMPROVEMENT

INNOVATE

« Want to increase innovation? Lower the cost of failure »

Joi Ito

SPEED AND AGILITY

Experiment Often

Fail quickly at a low cost

More Innovation

Experiment Infrequently

Failure is expensive

Less Innovation

“ON-PREMISE”

ARCHITECTURE CENTERhttp://aws.amazon.com/architecture

TECHNICAL ARTICLEShttp://aws.amazon.com/articles

PODCASThttp://aws.amazon.com/podcast

BLOGhttp://aws.typepad.com

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY