20160714 containers and the evolution of …...2016/07/15 · amazon ecs: scheduling • each...
TRANSCRIPT
![Page 1: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/1.jpg)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Solutions Architect, Amazon Web Services Japan
Containers and the Evolution of ComputingRyosuke Iwanaga
July 2016, LinuxCon+ContainerCon Japan
![Page 2: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/2.jpg)
Scaling Applications
![Page 3: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/3.jpg)
![Page 4: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/4.jpg)
![Page 5: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/5.jpg)
Order UI User UI Shipping UI
Order Service
User Service
Shipping Service
![Page 6: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/6.jpg)
Order UI User UI UI
Order Service Service Shipping
Service
Order UIOrder UI
User UI UIShipping UI
Order ServiceOrder
ServiceService
ServiceService
ServiceUser
Service
Shipping Service
![Page 7: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/7.jpg)
What is DevOps?
DevOps = efficiencies that speed up this lifecycle
developers customers
releasetestbuild
plan monitor
delivery pipeline
feedback loop
Software development lifecycle
![Page 8: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/8.jpg)
Monolith development lifecycle
developers
releasetestbuild
delivery pipelineapp
![Page 9: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/9.jpg)
Microservice development lifecycle
developers delivery pipelinesservices
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
![Page 10: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/10.jpg)
Services
• Not only for "microservices"; • Division, New business, Internal/External, etc.
• There tends to be a lot of "services"• From startup to enterprise
• So many services, so many pipelines/devops
![Page 11: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/11.jpg)
DevOps reality
Build Test ProductionSource
Application Artifact
All my need is Code…?
![Page 12: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/12.jpg)
DevOps reality
Build Test ProductionSource
Application Artifact
Provision
Config
Maintain development environment…
Environment difference between dev, test, prod…
Demands for test workload is diverse…
Auto scaling…Node fail...
OK, all my need is everything…
![Page 13: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/13.jpg)
Multiple DevOps Reality
![Page 14: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/14.jpg)
DevOps difficulty
• Too many things to handle• "Unicorn" person / team
• Too many different pipelines• Services, Languages, Frameworks, Versions, etc.
![Page 15: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/15.jpg)
![Page 16: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/16.jpg)
What are Containers?
OS virtualization
Process isolation
Images
Automation Server
Guest OS
Bins/Libs Bins/Libs
App2App1
![Page 17: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/17.jpg)
Container Advantages
Portable
Flexible
Fast
EfficientServer
Guest OS
Bins/Libs Bins/Libs
App2App1
![Page 18: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/18.jpg)
Containers are Natural for Microservices
Simple to model
Any app, any language
Image is the version
Test & deploy same artifact
Stateless servers decrease change risk
![Page 19: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/19.jpg)
DevOps with Docker
Build Test ProductionSource
Application Image
Provision
Config
All my need is Code! Yah!
![Page 20: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/20.jpg)
Server
Guest OS
Bins/Libs Bins/Libs
App2App1
Managing One Host is Straightforward
![Page 21: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/21.jpg)
Managing a Fleet is Hard
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
AZ 1 AZ 2
AZ 3
![Page 22: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/22.jpg)
What is Amazon ECS?
Amazon EC2 Container Service (Amazon ECS) is a highly scalable, high performance container management service. You can use Amazon ECS to schedule the placement of containers across your cluster. You can also integrate your own scheduler or third-party scheduler to meet business or application specific requirements.
![Page 23: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/23.jpg)
Container Management at Any Scale
Nothing to run
Complete state
Control and monitoring
Scale
![Page 24: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/24.jpg)
Flexible Container Placement
Long running applications
Batch jobs
Multiple schedulers
![Page 25: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/25.jpg)
Integration with the AWS Platform
Elastic Load Balancing
Amazon Elastic Block Store
Amazon Virtual Private Cloud
Amazon CloudWatch
AWS Identity and Access Management
AWS CloudTrail
![Page 26: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/26.jpg)
Container Management
![Page 27: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/27.jpg)
What is a Container Manager?
• Maintains available resources
• Tracks resource changes
• Accepts resource requests
• Guarantees accuracy and consistency
![Page 28: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/28.jpg)
CPU
Memory
Ports
Disk space
Disk IOPS
Network bandwidth
Resources
![Page 29: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/29.jpg)
How do you model your applications?
![Page 30: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/30.jpg)
![Page 31: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/31.jpg)
{"environment": [],"name": "simple-demo","image": "my-demo","cpu": 10,"memory": 500,"portMappings": [
{"containerPort": 80,"hostPort": 80
}],"mountPoints": [
{"sourceVolume": "my-vol","containerPath": "/var/www/my-vol"
}],"entryPoint": [
"/usr/sbin/apache2","-D","FOREGROUND"
],"essential": true
},
![Page 32: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/32.jpg)
{"name": "simple-demo","image": "my-demo","cpu": 10,"memory": 500,"portMappings": [
{"containerPort": 80,"hostPort": 80
}],"entryPoint": [
"/usr/sbin/apache2","-D","FOREGROUND"
],"essential": true
},
“Task Definitions”
![Page 33: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/33.jpg)
Tasks
Shared Data Volume
Containers
launchContainer Instance
Volume Definitions
Container Definitions
![Page 34: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/34.jpg)
Schedulers
![Page 35: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/35.jpg)
What is a Scheduler?
• Determine desired state
• Check against current state
• Perform action
![Page 36: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/36.jpg)
Cluster, Scheduler, Task Scheduler
ManagerCluster
Task Definition
Task
Agent
![Page 37: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/37.jpg)
ECS Agent
Docker
Task
Container Instance
Container
ECS Agent
Task
Container
https://github.com/aws/amazon-ecs-agent
![Page 38: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/38.jpg)
Instance Registration
register-container-instance --total-resources
[{
“name” : “cpu”,“type” : “integerValue”,“integerValue” : 2048
},…
]
![Page 39: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/39.jpg)
Starting a Task
API
User / Scheduler
StartTask
![Page 40: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/40.jpg)
Starting a Task
API
User / Scheduler
StartTask
Cluster Management Engine
![Page 41: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/41.jpg)
Starting a Task
API
User / Scheduler
StartTask
Cluster Management Engine
Agent Communication
![Page 42: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/42.jpg)
Starting a Task
API
User / Scheduler
StartTask
Cluster Management Engine
Agent Communication
Docker
Container Instance
ECS Agent
TaskContainer
WebSocket
![Page 43: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/43.jpg)
Starting a Task
API
User / Scheduler
StartTask
Cluster Management Engine
Agent Communication
DockerTask
Container Instance
Container
ECS Agent
TaskContainer
SubmitStateChange
![Page 44: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/44.jpg)
Tracking Resource Changes
![Page 45: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/45.jpg)
Terminated Task
API
User / Scheduler
StartTask
Cluster Management Engine
Agent Communication
DockerTask
Container Instance
Container
ECS Agent
SubmitStateChange
![Page 46: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/46.jpg)
Missing Container Instance
API
User / Scheduler
StartTask
Cluster Management Engine
DockerTask
Container Instance
Container
ECS Agent
?
Agent Communication
![Page 47: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/47.jpg)
Terminated Container Instance
API
User / Scheduler
StartTask
Cluster Management Engine
Agent Communication
Termination Notifier
DockerTask
Container Instance
Container
ECS Agent
![Page 48: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/48.jpg)
Guaranteeing Accuracy and Consistency
![Page 49: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/49.jpg)
Amazon ECS Under the Hood
IDN-1 IDN IDN+1 IDN+2 IDN+3 IDN+4 IDN+5
IDN+6
IDN+5
WRITE
READ
![Page 50: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/50.jpg)
Amazon ECS Under the Hood
IDN-1 IDN IDN+1 IDN+2 IDN+3 IDN+4 IDN+5
IDN+6IDN+3
IDN+5IDN+2
WRITE WRITE
READREAD
![Page 51: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/51.jpg)
Scalable
![Page 52: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/52.jpg)
Multiple Schedulers
![Page 53: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/53.jpg)
Amazon ECS: Scheduling• Each scheduler periodically queries the current cluster state
Copy of cluster stateScheduler A Scheduler B
Cluster
![Page 54: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/54.jpg)
Amazon ECS: Scheduling• Each scheduler allocates tasks on the cluster• Each scheduler updates the current cluster state
Run a taskRun a task
![Page 55: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/55.jpg)
Amazon ECS: Scheduling• If the resource is already claimed, the request will be rejected
Run a task on the same resource=> Transactional
![Page 56: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/56.jpg)
Amazon ECS: Scheduling
• Shared state optimistic scheduling• All schedulers can see the current cluster state at all times
![Page 57: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/57.jpg)
Amazon ECS Service Scheduler
![Page 58: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/58.jpg)
What is a Service?
• Models a long-running application
• Maintains desired state
• Optionally runs behind an Elastic Load Balancing load
balancer
![Page 59: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/59.jpg)
Scheduling Containers: Long-running App
Deploy using the least space:minimumHealthyPercent = 50%, maximumPercent = 100%
Old version New version
![Page 60: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/60.jpg)
Scheduling Containers: Long-running AppDeploy quickly without reducing service capacity: minimumHealthyPercent = 100%, maximumPercent = 200%
Old version New version
![Page 61: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/61.jpg)
Task Auto Scaling
![Page 62: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/62.jpg)
Task Auto Scaling
• Service Scheduler is integrated with Auto Scaling• CloudWatch Alarm => Policy => Modify Desired count
• Useful CloudWatch metrics:• CPU/Memory Utilization per Service
• How much each task consumes reserved resources?• CPU/Memory Utilization per Cluster
• How much actual cluster-wide resources are consumed?• CPU/Memory Reservation per Cluster
• How much cluster-wide resources are reserved?
![Page 63: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/63.jpg)
Monitoring with Amazon CloudWatch Dashboards
![Page 64: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/64.jpg)
Case studies
![Page 65: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/65.jpg)
“Moving to Amazon ECS significantly improved our service performance. We reduced service response times in the 99th percentile by 50%”
Jason FischlVP of Engineering
![Page 66: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/66.jpg)
SegmentTo collect customer data in a single hub for later use in analytics, marketing, and for other purposes.
"Switching to Amazon ECS has greatly simplified running a service without needing to worry about provisioning or
availability."
Calvin French-OwenCofounder and Chief Technology Officer
Before• Instance based• Manual setup• Wrong config / Out of sync
After• Easy maintaining, stateless• CI/CD pipeline automated• Focus on developing
https://aws.amazon.com/solutions/case-studies/segment/
![Page 67: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/67.jpg)
To recap
![Page 68: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/68.jpg)
![Page 69: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/69.jpg)
{"environment": [],"name": "simple-demo","image": "my-demo","cpu": 10,"memory": 500,"portMappings": [
{"containerPort": 80,"hostPort": 80
}],"mountPoints": [
{"sourceVolume": "my-vol","containerPath": "/var/www/my-vol"
}],"entryPoint": [
"/usr/sbin/apache2","-D","FOREGROUND"
],"essential": true
},
“Task Definitions”
![Page 70: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/70.jpg)
Scheduler
ManagerCluster
Task Definition
Task
Agent
![Page 71: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/71.jpg)
![Page 72: 20160714 Containers and the Evolution of …...2016/07/15 · Amazon ECS: Scheduling • Each scheduler allocates tasks on the cluster • Each scheduler updates the current cluster](https://reader030.vdocuments.us/reader030/viewer/2022041014/5ec54c9add9a665a9a6cc88e/html5/thumbnails/72.jpg)
Thank you!