the road to the cloud

41
The road to the cloud

Upload: walter-dal-mut

Post on 09-Jan-2017

37 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: The Road to the Cloud

The road to the cloud

Page 2: The Road to the Cloud

Walter Dal Mut@CorleyCloud Co-Founder@Upcloo Co-Founder

[email protected]

Page 3: The Road to the Cloud

We started our journey to thecloud at the end of 2009

Page 4: The Road to the Cloud

At the end of 2010 we took a book:

Cloud Computing for webapplications

Page 5: The Road to the Cloud

The book covers technical aspects and di�erent reasons about whycloud computing is so interesting

and in my opinion:

Pay only for what you use (with scaling)

Everthing is addressable with an API (and pay only for what you use)

Page 6: The Road to the Cloud

What we know from our history is this:

We consume resources differently during the day

Page 7: The Road to the Cloud

To sustain that spike we have to spend afixed amount of money

and more to predict a business grow

as a startup with few customer covering such expenditure is noteasy

Page 8: The Road to the Cloud

I want to underline PREDICT a businessgrow because in early 2010, "thanks" to anhosting provider we "scale" a VPS via FAX (i

swear) it took 4 days...they just scale up the instance and mount a 40GB disk as additional space

Page 9: The Road to the Cloud

Thanks to cloud computing

Page 10: The Road to the Cloud

Thanks to "serverless"

Page 11: The Road to the Cloud

So we deploy our �rst cloud infrastructure at the end of 2011

Page 12: The Road to the Cloud

Not so simple to use and configure the autoscaling group at thattime...

every service use a di�erent SDK, etc etc...

Page 13: The Road to the Cloud

What we have now?

Page 14: The Road to the Cloud

An autoscaling group...

a white box is an instance during the day

Page 15: The Road to the Cloud

We have a new problem now

How to manage/deploy the application?

Page 16: The Road to the Cloud

that was 2012sadly the end of the world

Page 17: The Road to the Cloud

Before continue our journey we should talkabout why continuous delivery is so

important?

Page 18: The Road to the Cloud

Mainly for get an immediate feedback

in order to speed-up the cycle

Page 19: The Road to the Cloud

we know already a continuous delivery system

We call it FileZilla

Page 20: The Road to the Cloud

 

Page 21: The Road to the Cloud

just kidding...and it can't works in a dynamic environment (for who is wondering)

Page 22: The Road to the Cloud

We select Fabric to deploy our applicationartifact

Thanks to AWS API we can compute the current number of activeinstances and connect via SSH to them in order to execute the

deploy cycle

Page 23: The Road to the Cloud

What we have nowWe can deploy one instance at a timeWe can deploy concurrently to all of them

Page 24: The Road to the Cloud

ProblemHow to deploy the current running version to new intances?

we spin new intances dynamically to handle di�erent situations

Page 25: The Road to the Cloud

At that time, before deploy the application with Fabric, we publishthe artifact also on AWS S3 and during the bootstrap a new instance

create a deploy cycle downloading that artifact from s3 using theEC2-user-data method (a shell script that runs during the bootstrap)

Page 26: The Road to the Cloud

A deploy cycle is not simpleprepare a zip artifactupload it to AWS S3connect to all instancesdownload the artifactunpack it to a new foldermove a symbolic link to this new version...

Page 27: The Road to the Cloud

Who is responsible to create that artifactand engage the application deployment?

Page 28: The Road to the Cloud

 

Page 29: The Road to the Cloud

we create di�erent task for every environment

Page 30: The Road to the Cloud

Delivery flowThe Jenkins build is triggered on a git pushJenkins is responsible to run the test suiteJenkins is responsible to create the artifact during this deploy cycleJenkins publish the artifact and release the product on the correctenvironment

Page 31: The Road to the Cloud

Today we can use so many di�erent platforms for continuousdelivery

JenkinsCircleCICodeShip...

Page 32: The Road to the Cloud

Jenkins continue to be interesting imhowith Dockerwith AWS ElasticBeanstalkwith AWS CodeDeploywith whatever you want...

Page 33: The Road to the Cloud

so give the code!

Page 34: The Road to the Cloud

AWS CodeDeploy for example is truly interesting

It using an agent to orchestrate the deploy

Deployments are restricted to a speci�c deployment group

Deployments group: autoscaling groups, ec2 instances, on-premises

Page 35: The Road to the Cloud

install the agent on your instance(works also with on-premises instances)

curl ­sS https://aws­codedeploy­eu­west­1.s3.amazonaws.com/latest/install > install chmod a+x install sudo ./install auto                         

Page 36: The Road to the Cloud

include appspec.yml in your artifact

version: 0.0 os: linux files:     ­ source: /    destination: /opt/myapp hooks:    ...    ApplicationStart:     ­ location: Scripts/RestartServices.sh        timeout: 180 

                        

ApplicationStop, BeforeInstall, AfterInstall, ApplicationStart, ValidateService

Page 37: The Road to the Cloud

CodeDeploy hooks

Page 38: The Road to the Cloud

You can deploy directly from your console

zip ­r myapp­version­1.0.0.zip .                         

aws s3 cp \   myapp­version­1.0.0.zip \   s3://codedeploy­eg/myapp­version­1.0.0.zip                         

aws deploy register­application­revision \   ­­application­name myapp \   ­­description myapp­v1.0.0  \   ­­s3­location bundleType=zip,bucket=codedeploy­eg,key=myapp­version­1.0.0.zip                         

aws deploy create­deployment \   ­­application­name myapp   ­­deployment­group­name prod   ­­deployment­config­name CodeDeployDefault.OneAtATime   ­­s3­location bundleType=zip,bucket=codedeploy­eg,key=myapp­version­1.0.0.zip 

                        

Page 39: The Road to the Cloud

This is a very simple scenario

Page 40: The Road to the Cloud

You can extend it and scale to otherenvironments

For example you can integrate your Jenkins with AWSCodePipeline

Page 41: The Road to the Cloud

Thanks for listening!