SlideShare a Scribd company logo
1 of 51
Download to read offline
Application Deployment is System State


                               Joshua Timberman
                                  @jtimberman
                             joshua@opscode.com



Wednesday, February 22, 12
% whoami


Wednesday, February 22, 12
Wednesday, February 22, 12
Wednesday, February 22, 12
Who are you?




                 • Developers?
                 • System administrators?
                 • DevOps?

Wednesday, February 22, 12
System State


Wednesday, February 22, 12
Configuration Management


Wednesday, February 22, 12
System Integration


                                   http://www.flickr.com/photos/opalsson/3773629074/

Wednesday, February 22, 12
WAT?


Wednesday, February 22, 12
n-Tier Infrastructure


                                           Load Balancer




                             App Server   { {               App Server
                                                                                •
                                                                                •
                                                                                •
                                                                                    Provision
                                                                                    Configure
                                                                                    Integrate


                                          Database Master




Wednesday, February 22, 12
Wednesday, February 22, 12
We're hiring!
                             opscode.com/careers/


Wednesday, February 22, 12
Resources


Wednesday, February 22, 12
Declarative interface to
                               system resources


Wednesday, February 22, 12
user "django_app" do
                               shell "/bin/false
                               comment "Django App User"
                               system true
                               action :create
                             end

                             package "python" do
                               action :install
                             end

                             python_pip "gunicorn" do
                               action :install
                             end
Wednesday, February 22, 12
Describe *what*.

                                 Not how.

Wednesday, February 22, 12
def install_package(name, version)
         package_name = "#{name}=#{version}"
         package_name = name if @is_virtual_package
         run_command_with_systems_locale(
           :command => "apt-get -q -y
             #{expand_options(@new_resource.options)}
             install #{package_name}",
           :environment => {
             "DEBIAN_FRONTEND" => "noninteractive"
           }
         )
       end


Wednesday, February 22, 12
package “python”
                                            {   yum install python
                                                apt-get install python
                                                pacman sync python
                                                pkg_add -r python




Wednesday, February 22, 12
Recipes


Wednesday, February 22, 12
Ruby Internal Ruby DSL Ruby


Wednesday, February 22, 12
def method_missing(method_symbol, *args, &block)
                    return "lol method_missing"
                  end




Wednesday, February 22, 12
user "django_app" do
                               shell "/bin/false
                               comment "Django App"
                               system true
                             end

                             package "python"

                             python_pip "gunicorn" do
                               action :install
                             end
Wednesday, February 22, 12
Cookbooks


Wednesday, February 22, 12
opscode/cookbooks/python
                             ├── README.md
                             ├── attributes
                             │   └── default.rb
                             ├── metadata.rb
                             ├── providers
                             │   ├── pip.rb
                             │   └── virtualenv.rb
                             ├── recipes
                             │   ├── default.rb
                             │   ├── package.rb
                             │   ├── pip.rb
                             │   ├── source.rb
                             │   └── virtualenv.rb
                             └── resources
                                 ├── pip.rb
                                 └── virtualenv.rb
Wednesday, February 22, 12
Roles


Wednesday, February 22, 12
Roles describe nodes.


Wednesday, February 22, 12
name "django_cms"
         description "django app app server"
         run_list(
           "recipe[mysql::client]",
           "recipe[application]"
         )




Wednesday, February 22, 12
Roles contain recipes


Wednesday, February 22, 12
name "base"
                        description "All nodes have the base role"
                        run_list(
                          "recipe[zsh]",
                          "recipe[sudo]",
                          "recipe[apt]",
                          "recipe[git]",
                          "recipe[build-essential]"
                        )
                        override_attributes(
                          :authorization => {
                            :sudo => {
                              :users => ["ubuntu"],
                              :passwordless => true
                            }
                          }
                        )
Wednesday, February 22, 12
Application Deployment


Wednesday, February 22, 12
Wednesday, February 22, 12
Wednesday, February 22, 12
Wednesday, February 22, 12
Wednesday, February 22, 12
Wednesday, February 22, 12
Build your own




                 • Let's be realistic.
                 • You own your availability.

Wednesday, February 22, 12
Application Deployment vs...




                 • Configuration management
                 • Ad-hoc system administration
                 • Going against policy

Wednesday, February 22, 12
Wednesday, February 22, 12
Wednesday, February 22, 12
Package management



                 • Rpm
                 • Deb
                 • Pkgsrc
                 • Gems
                 • Eggs
                 • Not a solved problem.
Wednesday, February 22, 12
git "/srv/django_app" do
                 repository "git://github.com/me/django_app.git"
                 reference "master"
                 action :sync
               end




Wednesday, February 22, 12
Fabric


Wednesday, February 22, 12
Capistrano


Wednesday, February 22, 12
chef-deploy


Wednesday, February 22, 12
deploy_revision[/srv/django_app]


Wednesday, February 22, 12
deploy_revision "/srv/django_app" do
  revision "2.0.17"
  repository "git://github.com/me/django_app.git"
  user "django_app"
  group "www-data"
  before_migrate do
    requirements_file = "#{release_path}/requirements.txt"
    execute "pip install -r #{requirements_file}" do
      cwd release_path
    end
  end
  action :deploy
end


Wednesday, February 22, 12
Ad-Hoc Deployment




                 • knife ssh
                 • capistrano
                 • fabric (use pychef!)

Wednesday, February 22, 12
require 'chef/knife'
   require 'chef/search/query'

   Capistrano::Configuration.instance.load do
     Chef::Knife.new.configure_chef

     def chef_role(name, query = "*:*", options = {})
       attr = options.delete(:attribute) || :ipaddress
       nodes = Chef::Search::Query.new.search(:node, query)
   [0].map {|n| n[attr] }
       role name, *nodes, options
       nodes
     end
   end

                         https://github.com/cramerdev/capistrano-chef
Wednesday, February 22, 12
from fabric.api import env, run, roles
                             from chef.fabric import chef_roledefs

                             env.roledefs = chef_roledefs()

                             @roles('web_app')
                             def mytask():
                                 run('uptime')




             http://pychef.readthedocs.org/en/latest/fabric.html
Wednesday, February 22, 12
Further Resources



                 •      https://us.pycon.org/2012/schedule/
                        presentation/286/ (Noah Kantrowitz)
                 •      http://wiki.opscode.com/display/chef/
                        Build+a+Django+Stack
                 •      http://community.opscode.com/
                        cookbooks/application
                 •      http://pychef.readthedocs.org/en/latest/
                        index.html


Wednesday, February 22, 12
Questions?

                                Joshua Timberman
                             joshua@opscode.com
                         @jtimberman (twitter, github)
                                lists.opscode.com
                              irc.freenode.net/chef

                                                 http://www.flickr.com/photos/oberazzi/318947873/
Wednesday, February 22, 12

More Related Content

Similar to Socal piggies-app-deploy

Jopr Plugin Development
Jopr Plugin DevelopmentJopr Plugin Development
Jopr Plugin Development
SEA Tecnologia
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
LeanDog
 
Lunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and CapybaraLunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and Capybara
Marc Seeger
 

Similar to Socal piggies-app-deploy (20)

Chef in the cloud and on the ground code freeze 2012
Chef in the cloud and on the ground   code freeze 2012Chef in the cloud and on the ground   code freeze 2012
Chef in the cloud and on the ground code freeze 2012
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Grails 2.0 Update
Grails 2.0 UpdateGrails 2.0 Update
Grails 2.0 Update
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013
 
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?
 
Jopr Plugin Development
Jopr Plugin DevelopmentJopr Plugin Development
Jopr Plugin Development
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
State of Puppet - Puppet Camp Barcelona 2013
State of Puppet - Puppet Camp Barcelona 2013State of Puppet - Puppet Camp Barcelona 2013
State of Puppet - Puppet Camp Barcelona 2013
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
Intro django
Intro djangoIntro django
Intro django
 
Doctrine Php Object Relational Mapper
Doctrine Php Object Relational MapperDoctrine Php Object Relational Mapper
Doctrine Php Object Relational Mapper
 
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetImproving Operations Efficiency with Puppet
Improving Operations Efficiency with Puppet
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Take care of hundred containers and not go crazy
Take care of hundred containers and not go crazyTake care of hundred containers and not go crazy
Take care of hundred containers and not go crazy
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Maven2交流
Maven2交流Maven2交流
Maven2交流
 
Lunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and CapybaraLunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and Capybara
 
PaaSTA: Running applications at Yelp
PaaSTA: Running applications at YelpPaaSTA: Running applications at Yelp
PaaSTA: Running applications at Yelp
 

More from jtimberman (11)

Oscon2011 tutorial
Oscon2011 tutorialOscon2011 tutorial
Oscon2011 tutorial
 
Agile services-dev opsdays
Agile services-dev opsdaysAgile services-dev opsdays
Agile services-dev opsdays
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 
Cooking security sans@night
Cooking security sans@nightCooking security sans@night
Cooking security sans@night
 
Mwrc2011 cookbook design patterns
Mwrc2011 cookbook design patternsMwrc2011 cookbook design patterns
Mwrc2011 cookbook design patterns
 
Fosdem chef-101-app-deploy
Fosdem chef-101-app-deployFosdem chef-101-app-deploy
Fosdem chef-101-app-deploy
 
Data driven app deploys with chef frontdev
Data driven app deploys with chef frontdevData driven app deploys with chef frontdev
Data driven app deploys with chef frontdev
 
Understanding lwrp development
Understanding lwrp developmentUnderstanding lwrp development
Understanding lwrp development
 
Derailed chef update-oct2010
Derailed chef update-oct2010Derailed chef update-oct2010
Derailed chef update-oct2010
 
Chef in the cloud [dbccg]
Chef in the cloud [dbccg]Chef in the cloud [dbccg]
Chef in the cloud [dbccg]
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menu
 

Recently uploaded

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
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
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
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
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 

Socal piggies-app-deploy