how cloudify uses chef as a foundation for paas
DESCRIPTION
As PaaS is becoming more prevalent than ever, most PaaS environments and frameworks are still strongly opinionated and allow for very limited control and extensibility. Extending a PaaS framework requires deep understating of its internals at best, and in many cases in not even possible. Cloudify, a new open source PaaS framework, has taken a different approach, by using recipes (As opposed to heavyweight coding and platform extension) as means to introduce new application stacks to the PaaS layer. You can think of it as extending the recipe model of Chef to support application level concerns, such as orchestration, dependency management, multi-tier and multi-host deployments, monitoring and autoscaling. This presentation covers the foundations of Cloudify, and how it leverages Chef as a key enabler for an open PaaS framework.TRANSCRIPT
11-1 GigaSpaces 2012 © All Rights Reserved
How Cloudify uses Chef as a foundation for PaaS
@natishalomnatishalom.typepad.com
11-2 GigaSpaces 2012 © All Rights Reserved
PaaS
IaaS
PaaS
IaaS
The Blurring line between IaaS & PaaS
11-3 GigaSpaces 2012 © All Rights Reserved
IaaS, PaaS & Apps
• IaaS & PaaS run on Software just like any App– Messaging: RabitMQ– DataBase: Postgress– Web Container
• Common needs– Automation– HA– Scaling ..
11-4 GigaSpaces 2012 © All Rights Reserved
IaaS delivers software services
• IaaS Services– RDS, – SimpleDB – LoadBalancer – Memcache
11-5 GigaSpaces 2012 © All Rights Reserved
PaaS delivers Software Services
11-6 GigaSpaces 2012 © All Rights Reserved
But..
• Services are delivered as a black-box• We have little control over the type, version or
the way those services are delivered• Inconsistent behavior & management
– IaaS & PaaS run on separate deployment, scaling, HA and Scaling models
11-7 GigaSpaces 2012 © All Rights Reserved
Apps are a composite of services
Apps is a living organism – Things can fail, move, be added over time
11-8 GigaSpaces 2012 © All Rights Reserved
Welcome to the Open Cloud
– New opportunities on how to deliver IaaS & PaaS:• Share infrastructure between the two layers• Gain better control on the way services and apps are
being delivered
11-9 GigaSpaces 2012 © All Rights Reserved
Enter Chef
• Why Chef? – Setup and Configure software services– As a foundation for IaaS – 100’s of cookbooks – Open Source
• It only makes sense to use Chef as a foundation for PaaS
11-10
GigaSpaces 2012 © All Rights Reserved
Enter Cloudify
• Cloudify is an Open PaaS Stack• Cloudify brings DevOps & PaaS together• Integrates tightly with Chef
11-11
GigaSpaces 2012 © All Rights Reserved
Chef & Cloudify
Cloudify• App life cycle &
orchestration (deployment dependencies, fail-over, auto-scaling)
• Application management & Monitoring
App-Centric
Chef• Infrastructure management
(OS setup, network, security configuration)
• Setup & installation (package, configure, install, start)
Infrastructure-Centric
11-12
GigaSpaces 2012 © All Rights Reserved
• Integration anatomy (how things happen) • Working With Chef Client
– Configuring the Chef Server information in Cloudify– Preparing a Recipe that wraps a cookbook– Running the recipe
• Working With Chef Solo– Preparing the recipe– Installing chef server using chef solo
• Updating the Chef Server• Interacting with Chef after deployment
Cloudify & Chef Deep Dive
11-13
GigaSpaces 2012 © All Rights Reserved
INTEGRATION ANATOMY
Cloudify creates the virtual machines and installs Cloudify agents on them
How It Works
11-14
GigaSpaces 2012 © All Rights Reserved
INTEGRATION ANATOMY
Cloudify agents install Chef clients and run them with the the proper recipes / roles
How It Works
11-15
GigaSpaces 2012 © All Rights Reserved
INTEGRATION ANATOMY
Chef clients install the required application services
How It Works
11-16
GigaSpaces 2012 © All Rights Reserved
INTEGRATION ANATOMY
Cloudify monitors and scales the application as needed
How It Works
11-17
GigaSpaces 2012 © All Rights Reserved
• Extend the base Chef Recipe to Install the run list you need
Create The Recipe
service { extend "../../../services/chef" name "your service name" type "DATABASE" numInstances 1
compute { template "SMALL_UBUNTU" } lifecycle { startDetectionTimeoutSecs 240 startDetection { ServiceUtils.isPortOccupied(System.getenv()["CLOUDIFY_AGENT_ENV_PRIVATE_IP"], 3306) } }
}
Custom Service Name
Add Custom Start Detector
Extending the Chef Recipe
11-18
GigaSpaces 2012 © All Rights Reserved
• Have the following in your recipe properties file:
18
Configure The Recipe
runParams = [“param1": “value1”,“param2": [“key1”:”subvalue1”,…]…"run_list": ["recipe[cookbook_name::recipe_name]"]]
Runtime parameters
Run list(Recipes or Roles)
11-19
GigaSpaces 2012 © All Rights Reserved
Chef Server Management • The Chef server recipe has a few custom commands for management
from the Cloudify CLI
11-20
GigaSpaces 2012 © All Rights Reserved
Chef Server Custom Commands
• updateCookbooks: load cookbooks to the Chef server (repo types: tar, git, svn)invoke chef-server updateCookbooks tar <url>
• cleanupCookbooks: remove all cookbooks from the Chef serverinvoke chef-server cleanupCookbooks
• listCookbooks: list all cookbooksinvoke chef-server listCookbooks
• knife: Run knife invoke chef-server knife cookbook list
11-21
GigaSpaces 2012 © All Rights Reserved
• Invoke a chef client with role “web”invoke <service-name> run_chef role[web] client
• Invoke Chef solo, speciying the recipe and cookbooks URL:invoke <service-name> run_chef recipe[mysql::server] solo http://somehost/cookbooks.tar.gz
Running Chef Iteratively - Examples
ModeRun list
ModeRun list
Cookbooks URL
11-22
GigaSpaces 2012 © All Rights Reserved
Demo Time..
11-23
GigaSpaces 2012 © All Rights Reserved
Thank You!
GET IT TODAY, IT’S OPEN SOURCE & FREE: WWW.CLOUDIFYSOURCE.ORG
GITHUB.COM/CLOUDIFY/CLOUDIFY-RECIPES