the road to the cloud
TRANSCRIPT
![Page 1: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/1.jpg)
The road to the cloud
![Page 3: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/3.jpg)
We started our journey to thecloud at the end of 2009
![Page 4: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/4.jpg)
At the end of 2010 we took a book:
Cloud Computing for webapplications
![Page 5: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/5.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/6.jpg)
What we know from our history is this:
We consume resources differently during the day
![Page 7: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/7.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/8.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/9.jpg)
Thanks to cloud computing
![Page 10: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/10.jpg)
Thanks to "serverless"
![Page 11: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/11.jpg)
So we deploy our �rst cloud infrastructure at the end of 2011
![Page 12: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/12.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/13.jpg)
What we have now?
![Page 14: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/14.jpg)
An autoscaling group...
a white box is an instance during the day
![Page 15: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/15.jpg)
We have a new problem now
How to manage/deploy the application?
![Page 16: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/16.jpg)
that was 2012sadly the end of the world
![Page 17: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/17.jpg)
Before continue our journey we should talkabout why continuous delivery is so
important?
![Page 18: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/18.jpg)
Mainly for get an immediate feedback
in order to speed-up the cycle
![Page 19: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/19.jpg)
we know already a continuous delivery system
We call it FileZilla
![Page 20: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/20.jpg)
![Page 21: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/21.jpg)
just kidding...and it can't works in a dynamic environment (for who is wondering)
![Page 22: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/22.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/23.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/24.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/25.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/26.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/27.jpg)
Who is responsible to create that artifactand engage the application deployment?
![Page 28: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/28.jpg)
![Page 29: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/29.jpg)
we create di�erent task for every environment
![Page 30: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/30.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/31.jpg)
Today we can use so many di�erent platforms for continuousdelivery
JenkinsCircleCICodeShip...
![Page 32: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/32.jpg)
Jenkins continue to be interesting imhowith Dockerwith AWS ElasticBeanstalkwith AWS CodeDeploywith whatever you want...
![Page 33: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/33.jpg)
so give the code!
![Page 34: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/34.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/35.jpg)
install the agent on your instance(works also with on-premises instances)
curl sS https://awscodedeployeuwest1.s3.amazonaws.com/latest/install > install chmod a+x install sudo ./install auto
![Page 36: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/36.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/37.jpg)
CodeDeploy hooks
![Page 38: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/38.jpg)
You can deploy directly from your console
zip r myappversion1.0.0.zip .
aws s3 cp \ myappversion1.0.0.zip \ s3://codedeployeg/myappversion1.0.0.zip
aws deploy registerapplicationrevision \ applicationname myapp \ description myappv1.0.0 \ s3location bundleType=zip,bucket=codedeployeg,key=myappversion1.0.0.zip
aws deploy createdeployment \ applicationname myapp deploymentgroupname prod deploymentconfigname CodeDeployDefault.OneAtATime s3location bundleType=zip,bucket=codedeployeg,key=myappversion1.0.0.zip
![Page 39: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/39.jpg)
This is a very simple scenario
![Page 40: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/40.jpg)
You can extend it and scale to otherenvironments
For example you can integrate your Jenkins with AWSCodePipeline
![Page 41: The Road to the Cloud](https://reader031.vdocuments.mx/reader031/viewer/2022020301/58729d7b1a28ab07208b5039/html5/thumbnails/41.jpg)
Thanks for listening!