11-1
GigaSpaces 2012 © All Rights Reserved
How Cloudify uses Chef as a
foundation for PaaS
@natishalom
natishalom.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 server
invoke chef-server cleanupCookbooks
• listCookbooks: list all cookbooks
invoke 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
Mode
Run list
Mode
Run 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

How Cloudify uses Chef as a Foundation for PaaS

  • 1.
    11-1 GigaSpaces 2012 ©All Rights Reserved How Cloudify uses Chef as a foundation for PaaS @natishalom natishalom.typepad.com
  • 2.
    11-2 GigaSpaces 2012 ©All Rights Reserved PaaS IaaS PaaS IaaS The Blurring line between IaaS & PaaS
  • 3.
    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 ..
  • 4.
    11-4 GigaSpaces 2012 ©All Rights Reserved IaaS delivers software services • IaaS Services – RDS, – SimpleDB – LoadBalancer – Memcache
  • 5.
    11-5 GigaSpaces 2012 ©All Rights Reserved PaaS delivers Software Services
  • 6.
    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
  • 7.
    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
  • 8.
    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
  • 9.
    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
  • 10.
    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-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
  • 12.
    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
  • 13.
    11-13 GigaSpaces 2012 ©All Rights Reserved INTEGRATION ANATOMY Cloudify creates the virtual machines and installs Cloudify agents on them How It Works
  • 14.
    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
  • 15.
    11-15 GigaSpaces 2012 ©All Rights Reserved INTEGRATION ANATOMY Chef clients install the required application services How It Works
  • 16.
    11-16 GigaSpaces 2012 ©All Rights Reserved INTEGRATION ANATOMY Cloudify monitors and scales the application as needed How It Works
  • 17.
    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
  • 18.
    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)
  • 19.
    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
  • 20.
    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 server invoke chef-server cleanupCookbooks • listCookbooks: list all cookbooks invoke chef-server listCookbooks • knife: Run knife invoke chef-server knife cookbook list
  • 21.
    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 Mode Run list Mode Run list Cookbooks URL
  • 22.
    11-22 GigaSpaces 2012 ©All Rights Reserved Demo Time..
  • 23.
    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