SlideShare una empresa de Scribd logo
1 de 43
Descargar para leer sin conexión
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Eric Holmes & Michael Barrett, Remind
October 2015
DVO308
Docker & ECS in Production
How We Migrated Our Infrastructure from Heroku to AWS
What to Expect from the Session
• A brief introduction about why we decided to build an
internal platform at Remind, and the lessons we learned
along the way
• An introduction to the open source PaaS we built called
Empire, and how we’re leveraging Amazon ECS
• Demo
• Q&A
About Us
• Eric Holmes & Michael Barrett
• Infrastructure engineers at Remind
• We build things for developers
• You can find our open source stuff at:
• https://github.com/ejholmes
• https://github.com/phobologic
Remind
• A messaging platform for teachers.
• Chat/announcements/files
• Over 30 million users
• Used actively in ~50% of U.S. public schools
• Over 2 billion messages delivered
• ~50 employees. ~30 engineers.
A Little History
A Little History
• Started as a “monorail”
• Scaling challenges during BTS
• Migrated to an SOA/micro-service architecture
Heroku was great, but…
• Every app on Heroku is publicly accessible
• Databases need to be exposed to Internet traffic
• Limited visibility and control
What we want from a PaaS
• AWS
• Flexibility
• Shared patterns for deployment
• Easy service operation
• Containers/Docker
Why Containers?
• Fast build + deploy iteration cycles
• Isolate dependencies
• Better dev/prod parity
• Immutable images
• Better resource utilization
Building an Empire
Design Goals
• Easy to operate
• Open source
• Support 12-factor stateless apps (12factor.net)
• Swappable scheduling back-ends
• Stability!
• Docker images as a unit of deployment
Components of a PaaS
Scheduler Router Control Plane
Scheduler :: Cluster Management
Join Leave
Scheduler :: Task Placement
Find Host Run Job
CPU/
Memory
Container
Cluster
Scheduler :: Task Placement
type App []Process
type Scheduler interface {
Run(App)
Remove(App)
Scale(Process)
Tasks(App) []Task
Stop(Task)
}
Empire :: V1
Scheduler Router Control Plane
+ Fleet
etcd + registrator + confd
Heroku Platform API
Spec + hk CLI
Amazon EC2 Container Service
• Managed cluster manager and scheduler
• Supports Docker
• Built-in service scheduler
• Integrates with Elastic Load Balancing
Amazon EC2 Container Service :: Resources
• Clusters
• Task definitions
• Tasks
• Services
Scheduler Interface
Run(App)
Remove(App)
Scale(Process)
Tasks(App) []Task
Stop(Task)
Amazon ECS Scheduler Implementation
Amazon ECS API
RegisterTaskDefinition ->
CreateService/UpdateService
DeleteService
UpdateService
ListTasks
StopTask
Empire :: V2
Scheduler Router Control Plane
ECS ELB
Heroku Platform API
Spec + emp CLI
Empire :: V2
An open-source, self-hosted PaaS for running
twelve-factor Docker apps backed by AWS
services
Twelve-Factor
Twelve-Factor Tenants
I. Codebase
II. Dependencies
III. Config
IV. Backing Services
V. Build, release, run
VI. Processes
VII. Port binding
VIII.Concurrency
IX. Disposability
X. Dev/prod parity
XI. Logs
XII. Admin processes
12factor :: Dependencies
“Explicitly declare and isolate dependencies”
FROM ruby
RUN apt-get install imagemagick
RUN bundle install
12factor :: Build, release, run
“Strictly separate build and run stages”
Empire
12factor :: Build
$ git push
12factor :: Release, Run
Config
{}
Release
Amazon ECS
12factor :: Release, Run
$ cat Procfile
web: ./bin/web
worker: ./bin/worker
$ aws ecs list-services
arn:aws:ecs:us-east-1:***:service/api--web
arn:aws:ecs:us-east-1:***:service/api--worker
$ emp deploy org/api:latest
Status: Created v1 release.
Service Discovery
$ aws ecs describe-services --service api--web
"loadBalancers": [{
"containerName": "web”,
"containerPort": 9001,
"loadBalancerName”: "2888...a31d4c”
}]
$ curl http://api
Ok
12factor :: Concurrency
“Scale out via the process model”
$ emp scale web=10
$ aws ecs describe-service --service api--web
“desired-count”: 10
12factor :: Dev/prod parity
“Keep development, staging, and production as similar as
possible”
$ docker run --env-file <(emp env -a api) org/api
12factor :: Logs
“Treat logs as event streams”
$ emp log
“GET / HTTP/1.1” 200
STDOUT Amazon Kinesis
12factor :: Admin processes
“Run admin/management tasks as one-off processes”
$ emp run rake db:migrate
Migrated
Demo
Pain Points & Lessons Learned
Container Instance Rollout
1. Update AMI in AWS CloudFormation stack.
2. Kill 1 host
3. Wait for new Amazon ECS services to start running on
new host
4. Rinse and repeat
Logging
Logspout
Logging
SOURCE=<app>.<process>.<version>
SYSLOG_STRUCTURED_DATA=app={{ .Container.Config.Env "SOURCE" }}
Docker Monolith
= Bad Times
Docker Performance
• Early versions of Docker had abysmal push/pull
performance
• Use Docker >= 1.8.1
• Make your Dockerfile’s use the layer cache efficiently
• https://github.com/remind101/conveyor
This space moves fast!
• Containers have been around, but Docker made them
accessible
• New tools coming out ever day
• AWS’s offerings have been incredibly stable and feature
rich
Remember to complete
your evaluations!
Thank you!

Más contenido relacionado

La actualidad más candente

AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
Amazon Web Services Korea
 

La actualidad más candente (20)

(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
Programming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKProgramming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDK
 
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
 
Getting Started on Amazon EKS
Getting Started on Amazon EKSGetting Started on Amazon EKS
Getting Started on Amazon EKS
 
Amazon ECS
Amazon ECSAmazon ECS
Amazon ECS
 
CodeBuild CodePipeline CodeDeploy CodeCommit in AWS | Edureka
CodeBuild CodePipeline CodeDeploy CodeCommit in AWS | EdurekaCodeBuild CodePipeline CodeDeploy CodeCommit in AWS | Edureka
CodeBuild CodePipeline CodeDeploy CodeCommit in AWS | Edureka
 
AWS Technical Essentials Day
AWS Technical Essentials DayAWS Technical Essentials Day
AWS Technical Essentials Day
 
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
 
(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS
 
KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019
KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019
KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
 
(ARC402) Double Redundancy With AWS Direct Connect
(ARC402) Double Redundancy With AWS Direct Connect(ARC402) Double Redundancy With AWS Direct Connect
(ARC402) Double Redundancy With AWS Direct Connect
 
Introduction to AWS IAM
Introduction to AWS IAMIntroduction to AWS IAM
Introduction to AWS IAM
 
Application Migrations
Application MigrationsApplication Migrations
Application Migrations
 
Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for Kubernetes
 
CI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelCI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day Israel
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
 
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
실전! AWS 하이브리드 네트워킹 (AWS Direct Connect 및 VPN 데모 세션) - 강동환, AWS 솔루션즈 아키텍트:: A...
실전! AWS 하이브리드 네트워킹 (AWS Direct Connect 및 VPN 데모 세션) - 강동환, AWS 솔루션즈 아키텍트::  A...실전! AWS 하이브리드 네트워킹 (AWS Direct Connect 및 VPN 데모 세션) - 강동환, AWS 솔루션즈 아키텍트::  A...
실전! AWS 하이브리드 네트워킹 (AWS Direct Connect 및 VPN 데모 세션) - 강동환, AWS 솔루션즈 아키텍트:: A...
 

Destacado

(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
Amazon Web Services
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
segv
 

Destacado (19)

Deep Dive into AWS ECS and Spot Instances at Scale
Deep Dive into AWS ECS and Spot Instances at ScaleDeep Dive into AWS ECS and Spot Instances at Scale
Deep Dive into AWS ECS and Spot Instances at Scale
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
12-Factor App
12-Factor App12-Factor App
12-Factor App
 
Heroku Javaで12-Factor App
Heroku Javaで12-Factor App Heroku Javaで12-Factor App
Heroku Javaで12-Factor App
 
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introduction
 
12-Factor
12-Factor12-Factor
12-Factor
 
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
 
(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk
(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk
(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk
 
AWS Webcast - Getting Started with Amazon Web Services
AWS Webcast - Getting Started with Amazon Web ServicesAWS Webcast - Getting Started with Amazon Web Services
AWS Webcast - Getting Started with Amazon Web Services
 
(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood
 
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
 
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
 
Continuous Innovation + Digital Platforms
Continuous Innovation + Digital PlatformsContinuous Innovation + Digital Platforms
Continuous Innovation + Digital Platforms
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
 

Similar a (DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from Heroku to AWS

Was liberty profile and docker
Was liberty profile and dockerWas liberty profile and docker
Was liberty profile and docker
sflynn073
 

Similar a (DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from Heroku to AWS (20)

Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
Tech connect aws
Tech connect  awsTech connect  aws
Tech connect aws
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
AWS April Webinar Series - Getting Started with Amazon EC2 Container Service
AWS April Webinar Series - Getting Started with Amazon EC2 Container ServiceAWS April Webinar Series - Getting Started with Amazon EC2 Container Service
AWS April Webinar Series - Getting Started with Amazon EC2 Container Service
 
Building a PaaS with Docker and AWS
Building a PaaS with Docker and AWSBuilding a PaaS with Docker and AWS
Building a PaaS with Docker and AWS
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
 
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
Introduction to Amazon EC2 Container Service and setting up build pipeline wi...
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
 
EC2 Container Service
EC2 Container ServiceEC2 Container Service
EC2 Container Service
 
Building a PaaS with Docker and AWS
Building a PaaS with Docker and AWSBuilding a PaaS with Docker and AWS
Building a PaaS with Docker and AWS
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
 
Amazon EC2 Container Service
Amazon EC2 Container ServiceAmazon EC2 Container Service
Amazon EC2 Container Service
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
 
WebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and DockerWebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and Docker
 
Introduction to Docker on AWS
Introduction to Docker on AWSIntroduction to Docker on AWS
Introduction to Docker on AWS
 
From Docker Straight to AWS
From Docker Straight to AWSFrom Docker Straight to AWS
From Docker Straight to AWS
 
Was liberty profile and docker
Was liberty profile and dockerWas liberty profile and docker
Was liberty profile and docker
 
Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016
 

Más de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from Heroku to AWS

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Eric Holmes & Michael Barrett, Remind October 2015 DVO308 Docker & ECS in Production How We Migrated Our Infrastructure from Heroku to AWS
  • 2. What to Expect from the Session • A brief introduction about why we decided to build an internal platform at Remind, and the lessons we learned along the way • An introduction to the open source PaaS we built called Empire, and how we’re leveraging Amazon ECS • Demo • Q&A
  • 3. About Us • Eric Holmes & Michael Barrett • Infrastructure engineers at Remind • We build things for developers • You can find our open source stuff at: • https://github.com/ejholmes • https://github.com/phobologic
  • 4. Remind • A messaging platform for teachers. • Chat/announcements/files • Over 30 million users • Used actively in ~50% of U.S. public schools • Over 2 billion messages delivered • ~50 employees. ~30 engineers.
  • 6. A Little History • Started as a “monorail” • Scaling challenges during BTS • Migrated to an SOA/micro-service architecture
  • 7. Heroku was great, but… • Every app on Heroku is publicly accessible • Databases need to be exposed to Internet traffic • Limited visibility and control
  • 8. What we want from a PaaS • AWS • Flexibility • Shared patterns for deployment • Easy service operation • Containers/Docker
  • 9. Why Containers? • Fast build + deploy iteration cycles • Isolate dependencies • Better dev/prod parity • Immutable images • Better resource utilization
  • 11. Design Goals • Easy to operate • Open source • Support 12-factor stateless apps (12factor.net) • Swappable scheduling back-ends • Stability! • Docker images as a unit of deployment
  • 12. Components of a PaaS Scheduler Router Control Plane
  • 13. Scheduler :: Cluster Management Join Leave
  • 14. Scheduler :: Task Placement Find Host Run Job CPU/ Memory Container Cluster
  • 15. Scheduler :: Task Placement type App []Process type Scheduler interface { Run(App) Remove(App) Scale(Process) Tasks(App) []Task Stop(Task) }
  • 16. Empire :: V1 Scheduler Router Control Plane + Fleet etcd + registrator + confd Heroku Platform API Spec + hk CLI
  • 17. Amazon EC2 Container Service • Managed cluster manager and scheduler • Supports Docker • Built-in service scheduler • Integrates with Elastic Load Balancing
  • 18. Amazon EC2 Container Service :: Resources • Clusters • Task definitions • Tasks • Services
  • 19. Scheduler Interface Run(App) Remove(App) Scale(Process) Tasks(App) []Task Stop(Task) Amazon ECS Scheduler Implementation Amazon ECS API RegisterTaskDefinition -> CreateService/UpdateService DeleteService UpdateService ListTasks StopTask
  • 20. Empire :: V2 Scheduler Router Control Plane ECS ELB Heroku Platform API Spec + emp CLI
  • 21. Empire :: V2 An open-source, self-hosted PaaS for running twelve-factor Docker apps backed by AWS services
  • 23. Twelve-Factor Tenants I. Codebase II. Dependencies III. Config IV. Backing Services V. Build, release, run VI. Processes VII. Port binding VIII.Concurrency IX. Disposability X. Dev/prod parity XI. Logs XII. Admin processes
  • 24. 12factor :: Dependencies “Explicitly declare and isolate dependencies” FROM ruby RUN apt-get install imagemagick RUN bundle install
  • 25. 12factor :: Build, release, run “Strictly separate build and run stages” Empire
  • 27. 12factor :: Release, Run Config {} Release Amazon ECS
  • 28. 12factor :: Release, Run $ cat Procfile web: ./bin/web worker: ./bin/worker $ aws ecs list-services arn:aws:ecs:us-east-1:***:service/api--web arn:aws:ecs:us-east-1:***:service/api--worker $ emp deploy org/api:latest Status: Created v1 release.
  • 29. Service Discovery $ aws ecs describe-services --service api--web "loadBalancers": [{ "containerName": "web”, "containerPort": 9001, "loadBalancerName”: "2888...a31d4c” }] $ curl http://api Ok
  • 30. 12factor :: Concurrency “Scale out via the process model” $ emp scale web=10 $ aws ecs describe-service --service api--web “desired-count”: 10
  • 31. 12factor :: Dev/prod parity “Keep development, staging, and production as similar as possible” $ docker run --env-file <(emp env -a api) org/api
  • 32. 12factor :: Logs “Treat logs as event streams” $ emp log “GET / HTTP/1.1” 200 STDOUT Amazon Kinesis
  • 33. 12factor :: Admin processes “Run admin/management tasks as one-off processes” $ emp run rake db:migrate Migrated
  • 34. Demo
  • 35. Pain Points & Lessons Learned
  • 36. Container Instance Rollout 1. Update AMI in AWS CloudFormation stack. 2. Kill 1 host 3. Wait for new Amazon ECS services to start running on new host 4. Rinse and repeat
  • 40. Docker Performance • Early versions of Docker had abysmal push/pull performance • Use Docker >= 1.8.1 • Make your Dockerfile’s use the layer cache efficiently • https://github.com/remind101/conveyor
  • 41. This space moves fast! • Containers have been around, but Docker made them accessible • New tools coming out ever day • AWS’s offerings have been incredibly stable and feature rich