oscon 2011
DESCRIPTION
Cloud Foundry - The building of the OpenPaaSTRANSCRIPT
![Page 1: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/1.jpg)
Cloud FoundryThe Building of the Open PaaS
Derek CollisonJuly 27, 2011
![Page 2: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/2.jpg)
What isCloud Foundry?
![Page 3: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/3.jpg)
The OpenPlatform as a Service
![Page 4: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/4.jpg)
What isPaaS?
![Page 5: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/5.jpg)
Or more specifically, an
aPaaS?
![Page 6: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/6.jpg)
aPaaS
• Application Platform as a Service
• Applications and Services
• Not VMs, Memory, Storage, CPU
![Page 7: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/7.jpg)
What isOpenPaaS?
![Page 8: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/8.jpg)
OpenPaaS
• Multi-Language
• Multi-Framework
• Multi-Services
• Multi-Cloud, Multi-IaaS
• Hybrid - Public or Private or Both
• OpenSource
![Page 9: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/9.jpg)
OpenPaaS• Multi-Language
• Java, Scala, Ruby, Node, Erlang, PHP..
• Multi-Framework
• Spring, Grails, Express, Rails, Lift, MochiWeb
• Multi-Services
• MySQL, Postgres, MongoDB, Redis, RabbitMQ
• Multi-Cloud, Multi-IaaS
• vSphere, OpenStack, AWS, Eucalyptus
![Page 10: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/10.jpg)
The Open PaaS
…Cl
oud
Prov
ider
Inte
rface
Application Service Interface
Private Clouds
PublicClouds
MicroClouds
.js
Data Services
Other Services
Msg Services
.COM
![Page 11: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/11.jpg)
What was our Goal?
• Raise the unit of currency to the be the application and its associated services, not the infrastructure
• Best of breed delivery platform for all modern applications and frameworks
• Favor Choice and Openness
• Simplicity and Speed
![Page 12: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/12.jpg)
How was it Built?
• Kernel and Orchestrator Shells
• Layered on top of IaaS
• Kernel
• Core PaaS System
• Orchestrator
• Creation, management and orchestration of the infrastructure
![Page 13: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/13.jpg)
High Level
IaaS
Orchestrator
CF Kernel
Hardware - CPU/Memory/Disk/Network
Clients (VMC, STS, Browser)
![Page 14: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/14.jpg)
Basic Premises• Assume failure
• Optimize for MTTR, not MTBF
• MTTR = Mean Time To Recovery
• MTBF = Mean Time Between Failures
• Fail Fast
• Self Healing
• Horizontally Scalable Components
• Distributed state, No single POF
• Should be as simple as possible
![Page 15: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/15.jpg)
Basic Patterns
• Event-Driven
• Asynchronous
• Non-blocking
• Independent, Idempotent
• Message passing
• Eventually consistent
![Page 16: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/16.jpg)
Basic Design
• All components loosely coupled
• Few “Classes”, many “Instances”
• Messaging as foundation
• Addressing and Component Discovery
• Command and Control
• JSON payloads
• HTTP or File/Blob for data transport
![Page 17: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/17.jpg)
Kernel Components
• All dynamically discoverable
• Launch and scale in any order
• Can come and go as needed
• Monitor via HTTP and JSON
• Location independent
![Page 18: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/18.jpg)
Kernel Components
• Router
• CloudController
• DEA
• HealthManager
• Messaging System
![Page 19: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/19.jpg)
Logical ViewVMC client STS plugin
Browser(user app access)
Routers
CloudControllers App
Services DEA Pool
App
HealthManager
Messaging
![Page 20: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/20.jpg)
Messaging• Addressing and Discovery
• No static IPs or DNS lookups req’d
• Just Layer 4
• Command and Control
• Central communication system
• Dial tone, fire and forget
• Protects *itself* at all costs
• Idempotent semantics
![Page 21: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/21.jpg)
Router
• Handles all HTTP traffic
• Maintains distributed routing state
• Routes URLs to applications
• Distributes load among instances
• Realtime distributed updates to routing tables from DEAs
![Page 22: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/22.jpg)
CloudController
• Handles all state transitions
• Deals with users, apps, and services
• Packages and Stages applications
• Binds Services to Applications
• Presents external REST API
![Page 23: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/23.jpg)
HealthManager
• Monitors the state
• Initial value with realtime delta updates to intended vs real
• Determines drift
• Complains to the CloudControllers when something is not correct
• No power to change state itself
![Page 24: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/24.jpg)
DEA (Droplet Execution Agent)
• Responsible for running all applications
• Monitors all applications
• CPU, Mem, IO, Threads, Disk, FDs, etc
• All apps look same to DEA, start and stop
• “concept” of ability and desire to run an application
• runtimes, options, cluster avoidance, memory/cpu
• Alerts on any change in state of applications
• Provides secure/constrained OS runtime
• Hypervisor, Unix File and User, Linux Containers
• Single or Multi-Tenant
![Page 25: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/25.jpg)
Services• One of the extensibility planes
• First class citizen
• Bound to applications
• Can be shared
• Services API to discover, list, and provision
• Direct access to service after provisioned
• Easy way to bind any service to an app
![Page 26: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/26.jpg)
Arc
hit
ec
ture
![Page 27: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/27.jpg)
How does it all work?
![Page 28: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/28.jpg)
Pushing an App• Client (VMC/STS) pushes meta-data to CC
• Client optionally pushes resource signatures (diff analysis, sys wide)
• Client pushes app resources to CC
• CC puts app together
• CC stages app asynchronously
• CC binds and stages services
• Droplet ready
![Page 29: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/29.jpg)
Arc
hit
ec
ture
![Page 30: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/30.jpg)
Running an App• CC asks DEAs for “help”
• First DEA back wins! Simple
• CC sends start request to selected DEA
• DEA pushes the “green” button
• DEA waits and monitors pid and ephemeral port for app to bind
• When app is healthy, sends “register” message
• Register message is seen by HM and Routers
• Routers bind URL to host:port
![Page 31: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/31.jpg)
Arc
hit
ec
ture
![Page 32: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/32.jpg)
DEAs answer?• DEAs first determine YES or NO
• correct runtime, options, memory, etc
• Then calculate a Delay Taint
• SHA hash of app instance
• memory
• cpu
• This taint allows balancing and selection
![Page 33: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/33.jpg)
Scale up & down?
• Exact steps as running the app the first time
• SHA1 taint helps avoid clustering
• memory/cpu taint helps distribute as evenly as possible
• Nothing pre-computed or strict
![Page 34: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/34.jpg)
Crashes?• If your app stops and we did not tell it
to, that is a crash
• Crashed apps are immediately detected by DEA and message sent
• Routers disconnect route
• HM will signal a CC that something is wrong
• CC will issue run sequence again
![Page 35: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/35.jpg)
Arc
hit
ec
ture
![Page 36: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/36.jpg)
Access to my App?• All routers understand where all
instances of your application are running
• Will randomly pick backend, not semantically aware.
• Will remove routes that are stale or unhealthy
• Session stickiness and replication available, but best to avoid if possible
![Page 37: OSCON 2011](https://reader034.vdocuments.net/reader034/viewer/2022052208/554a0e58b4c9058c5d8b482e/html5/thumbnails/37.jpg)
Thank You