SlideShare a Scribd company logo
1 of 83
Download to read offline
DevOps for PHP


Florian Anderiasch I October 28, 2011




                                        © Mayflower GmbH 2010
Developer
 Ex-Admin
  DevOp?

„I rant a lot“

@anderiasch
stay in touch!
                 Mayflower GmbH I 2
Do you know
 DevOps?

              Mayflower GmbH I 3
„These are cool tools!“
           =>
„I'm doing DevOps now!“

                    Mayflower GmbH I 4
It's not about
   the tools!




          Mayflower GmbH I 5
It's about
the culture!

        Mayflower GmbH I 6
Mayflower GmbH I 7
Coming from WebOps

We often don't have much
 operations personnel.

 LAMP stack is our home
                      Mayflower GmbH I 8
Learn from each other!

   Work together!


                     Mayflower GmbH I 9
From ops to dev:
    repeatability
change management
     monitoring
    provisioning
                     Mayflower GmbH I 10
From dev to ops:
    unit tests
 version control
 agile methods

                   Mayflower GmbH I 11
Why DevOps?



              Mayflower GmbH I 12
How many
releases per
    year?
               Mayflower GmbH I 13
Some people
  do up to
 60 per day
              Mayflower GmbH I 14
We're striving
for one per day.
    For now.
               Mayflower GmbH I 15
We've come a long way



                   Mayflower GmbH I 16
Development in the dark ages
                        Mayflower GmbH I 17
Golden Image
VMware/KVM


               Mayflower GmbH I 18
Copying files over FTP
  to a shared host


                     Mayflower GmbH I 19
rsync /vcs checkout



                      Mayflower GmbH I 20
Mayflower GmbH I 21
Hardware
= Software
= Configuration
                  Mayflower GmbH I 22
OK, tools are important.




                      Mayflower GmbH I 23
Bad news:
they love ruby

                 Mayflower GmbH I 24
Good news:
There are DSLs

                 Mayflower GmbH I 25
But in the end:
   It works

                  Mayflower GmbH I 26
Going from:
  do X or Y
   Towards:
I want state Z

                 Mayflower GmbH I 27
Don't reinvent
 the wheel.


                 Mayflower GmbH I 28
puppet modules
apache, nginx, varnish
  php, ruby, tomcat
mysql, pgsql, memcache


                         Mayflower GmbH I 29
Monitoring



             Mayflower GmbH I 30
http://www.puppetlabs.com/puppet/related-projects/dashboard/

                                        Mayflower GmbH I 31
Mayflower GmbH I 32
Vagrant
   I know how I want
  my servers to look like

    Let's replicate that
     for development
   as close as possible
                      Mayflower GmbH I 33
Vagrant
   Based on VirtualBox

 automatically create VMs
  puppet or chef included


                    Mayflower GmbH I 34
Vagrant
 Fully versioned configs

  On-Demand creation

 Developer Self Service

                     Mayflower GmbH I 35
Getting started
in 3 easy steps


                  Mayflower GmbH I 36
Manage your setup
 with Vagrant and
     VeeWee
(needs VirtualBox and Ruby)


                              Mayflower GmbH I 37
$ gem install vagrant
$ gem install veewee
$ vagrant basebox templates

$ vagrant basebox define 'natty' 
  'ubuntu-11.04-server-amd64'
$ vagrant basebox build 'natty'
$ vagrant basebox export natty
$ vagrant box add 'natty' 'natty.box'




                                        Mayflower GmbH I 38
http://vagrantbox.es




                       Mayflower GmbH I 39
$ gem install vagrant
 $ vagrant box add maverick64 http://mathie-
vagrant-boxes.s3.amazonaws.com/maverick64.box
 $ mkdir maverick_demo
 $ cd maverick_demo
 $ vagrant init maverick64
 $ vagrant up
 $ vagrant ssh
vagrant@maverick64:~$




                                           Mayflower GmbH I 40
Manage your
configuration


                Mayflower GmbH I 41
Mayflower GmbH I 42
Chef or Puppet



                 Mayflower GmbH I 43
- Configuration as Code
- Client-only or Client-Server setup
- backed by companies
- officially supported by Amazon
- tried and tested
- good documentation
- good, vibrant communities



                                       Mayflower GmbH I 44
- Chef is ruby code, puppet has a DSL
- puppet has the bigger community
- puppet has more documentation
- but chef is catching up
- puppet: europe, chef: USA
- chef is more flexible
- if you puppet, you don't know ruby
  and vice versa



                                        Mayflower GmbH I 45
- both know current configuration
- you define your nodes (servers)
- lots of community cookbooks/modules
- easy to extend
- templates
- providers as platform abstractions
  (e.g. apt-get/ports/yum)



                                    Mayflower GmbH I 46
There's no „better“ tool.

 But we prefer puppet.
      Less Ruby ;)

                         Mayflower GmbH I 47
user { 'florian':
  ensure     => present,
  uid        => '507',
  gid        => 'admin',
  shell      => '/bin/bash',
  home       => '/home/florian',
  managehome => true,
}




                                   Mayflower GmbH I 48
user „florian“ do
  username „florian“
  password „$1$P$WXmqrQEVj88fVTHevErxq.“
  shell „/bin/bash“
  system true
  supports :manage_home => true
end




                                           Mayflower GmbH I 49
Back to Vagrant



                  Mayflower GmbH I 50
Vagrant::Config.run do |config|
  config.vm.box = „natty“
end




                                  Mayflower GmbH I 51
$ cat Vagrantfile
Vagrant::Config.run do |config|
  config.vm.provision :puppet, :module_path =>
„modules“ do |puppet|
    puppet.manifests_path = „manifests“
    puppet.manifest_file = „development.pp“
  end

  config.vm.define :web do |web_config|
    web_config.vm.box = „natty“
    web_config.vm.host_name = „webserver01“
    web_config.vm.network „33.33.33.10“
    web_config.vm.forward_port „http“,80,8080
    web_config.vm.port „ssh“,22,2222
    web_config.vm.share_folder „v-
data“,“/srv/www“,“../silex-demo“
  end
end

                                           Mayflower GmbH I 52
$ cat manifests/development.pp
import „classes/*“

node „webserver01“ {
  include web
}

node „dbserver01“ {
  include db
}

node „ciserver01“ {
  include ci
}




                                 Mayflower GmbH I 53
$ cat manifests/classes/web.pp
class web inherits basenode {
  include apache
  include apache::php
  apache::vhost { 'silex-demo.local':
    port    => '80',
    docroot => '/srv/www/docroot',
  }

    package { ['mysql-client','php5-cli',...]:
      ensure => present,
    }
}




                                             Mayflower GmbH I 54
$ cat manifests/classes/ci.pp
class ci inherits basenode {
  include apache
  include apache::php
  exec { 'pear-autodiscover':
    command => '/usr/bin/pear config-set 
auto_discover 1',
  }

  package{ 
['pear.phpunit.de/PHP_CodeBrowser',...]:
    ensure   => latest,
    provider => 'pear',
    require => Exec['pear-autodiscover'],
  }
}



                                             Mayflower GmbH I 55
Make the configuration
part of your source code


                      Mayflower GmbH I 56
.
|--   application
|--   data
|--   docs
|--   library
|--   public
|--   scripts
|     |-- jobs
|     |-- build
|     -- configuration
|          |-- Vagrantfile
|          |-- manifests
|          -- modules
|--   temp
--   tests




                             Mayflower GmbH I 57
Why did I do that?



                     Mayflower GmbH I 58
Simple
  Failsafe
 Fast Setup
Repeatable
 Consistent
Self-Service
               Mayflower GmbH I 59
No more golden images!




                         Mayflower GmbH I 60
No more USB sticks!




                      Mayflower GmbH I 61
Just one directory
    in your vcs



                     Mayflower GmbH I 62
Machine Life Cycle
 Management:
   Foreman


                     Mayflower GmbH I 63
A frontend for puppet
Shows the system inventory
  Create new machines
       Provisioning


                         Mayflower GmbH I 64
Mayflower GmbH I 65
Mayflower GmbH I 66
I want more!
  Like 20+


               Mayflower GmbH I 67
McCloud
wrapper around Vagrant
       and Fog

   transparent local
     & cloud usage
                         Mayflower GmbH I 68
I want more!
 Like 500...


               Mayflower GmbH I 69
mCollective
   ssh-for-loop on steroids

 fast management for loads of
           servers

uses puppet/facter, MQ-based
                                Mayflower GmbH I 70
$ mc-package -W "architecture=x86" status apache *
[ ==================================> ] 10 / 10
host01.example.com            version = apache-2.2.9-7
host02.example.com            version = apache-2.2.9-7
host03.example.com            version = apache-2.2.9-7
host04.example.com            version = apache-2.2.9-7
host05.example.com            version = apache-2.2.9-7
host06.example.com            version = apache-2.2.9-7
host07.example.com            version = apache-2.2.9-7
host08.example.com            version = apache-2.2.9-7
host09.example.com            version = apache-2.2.9-7
host10.example.com            version = apache-2.2.9-7
---- package agent summary ----
Nodes: 10 / 10
Versions: 10 * 0.25.5-1.el5
Elapsed Time: 1.03 s




                                                  Mayflower GmbH I 71
DevOps
@Mayflower

             Mayflower GmbH I 72
1-2 „admins“
  per team

               Mayflower GmbH I 73
Operations
    and
Development
              Mayflower GmbH I 74
Working hand in hand
with company admins


                       Mayflower GmbH I 75
Got root?
  Yes.


            Mayflower GmbH I 76
1+n puppetmaster

    1 central
    n teams

                   Mayflower GmbH I 77
Example setup:
     puppetmaster
  10 developer VMs
        Jenkins
4x Staging (eucalyptus)
   4x Live (Amazon)
                      Mayflower GmbH I 78
More tools:
   gitorious
eucalyptus cloud
   proxmox

                   Mayflower GmbH I 79
In the works:
     Vagrant
Scrum => Kanban
Puppet + Nagios

                  Mayflower GmbH I 80
Questions?




             Mayflower GmbH I 81
Thanks for listening!




      Contact   Florian Anderiasch
                florian.anderiasch@mayflower.de
                +49 89 242054 1134
                @anderiasch


                Mayflower GmbH
                Mannhardtstrasse 6
29.10.11        80538 München          Mayflower GmbH   82
Images

                           Domo-Kun(5)
       http://www.hawaiikawaii.net/2011/domo-kun-wallpaper-on-my-desktop/

Domo-Kun(6), Nina Helmer, CC-BY-NC-ND
            http://www.flickr.com/photos/origami_potato/3242174542/

Clouds (21), John Mueller, CC-BY-NC-ND
               http://www.flickr.com/photos/johnmueller/52621490/

                         Domo-Kun (23)
  http://i572.photobucket.com/albums/ss163/xxLoveorDie54xx/OMG-Its-Domo-kun.jpg
                      puppet-dashboard (31)
             http://puppetlabs.com/puppet/related-projects/dashboard/




                                                                                  Mayflower GmbH I 83

More Related Content

Viewers also liked

Viewers also liked (9)

DevOps für PHP (und andere)
DevOps für PHP (und andere)DevOps für PHP (und andere)
DevOps für PHP (und andere)
 
Ao infinito e além com PHP memcached e Gearman
Ao infinito e além com PHP memcached e GearmanAo infinito e além com PHP memcached e Gearman
Ao infinito e além com PHP memcached e Gearman
 
DevOps e PHP
DevOps e PHPDevOps e PHP
DevOps e PHP
 
Devops is not about Tooling
Devops is not about ToolingDevops is not about Tooling
Devops is not about Tooling
 
Vagrant와 chef로 개발서버 구축 자동화하기
Vagrant와 chef로 개발서버 구축 자동화하기Vagrant와 chef로 개발서버 구축 자동화하기
Vagrant와 chef로 개발서버 구축 자동화하기
 
Docker로 서버 개발 편하게 하기
Docker로 서버 개발 편하게 하기Docker로 서버 개발 편하게 하기
Docker로 서버 개발 편하게 하기
 
Docker (Compose) 활용 - 개발 환경 구성하기
Docker (Compose) 활용 - 개발 환경 구성하기Docker (Compose) 활용 - 개발 환경 구성하기
Docker (Compose) 활용 - 개발 환경 구성하기
 
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
 

Similar to DevOps for PHP

Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
Andreas Heim
 

Similar to DevOps for PHP (20)

One-Click Deployment with Jenkins
One-Click Deployment with JenkinsOne-Click Deployment with Jenkins
One-Click Deployment with Jenkins
 
Improving your workflows and awareness in the team with tools
Improving your workflows and awareness in the team with toolsImproving your workflows and awareness in the team with tools
Improving your workflows and awareness in the team with tools
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with Vagrant
 
Ansible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps MatchAnsible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps Match
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Create Disposable Test Environments with Vagrant and Puppet
Create Disposable Test Environments with Vagrant and PuppetCreate Disposable Test Environments with Vagrant and Puppet
Create Disposable Test Environments with Vagrant and Puppet
 
Create Disposable Test Environments with Vagrant and Puppet
Create Disposable Test Environments with Vagrant and Puppet Create Disposable Test Environments with Vagrant and Puppet
Create Disposable Test Environments with Vagrant and Puppet
 
Mit nginx und FastCGI skalieren
Mit nginx und FastCGI skalierenMit nginx und FastCGI skalieren
Mit nginx und FastCGI skalieren
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7
 
Jenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesJenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-Pipelines
 
Vagrant and chef
Vagrant and chefVagrant and chef
Vagrant and chef
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
Velocity London - Chaos Engineering Bootcamp
Velocity London - Chaos Engineering Bootcamp Velocity London - Chaos Engineering Bootcamp
Velocity London - Chaos Engineering Bootcamp
 
Installing Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu InstanceInstalling Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu Instance
 

More from Mayflower GmbH

Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debugging
Mayflower GmbH
 

More from Mayflower GmbH (20)

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
 
Why and what is go
Why and what is goWhy and what is go
Why and what is go
 
Agile Anti-Patterns
Agile Anti-PatternsAgile Anti-Patterns
Agile Anti-Patterns
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: Security
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur Führungskraft
 
Produktive teams
Produktive teamsProduktive teams
Produktive teams
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native Client
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debugging
 
Usability im web
Usability im webUsability im web
Usability im web
 
Rewrites überleben
Rewrites überlebenRewrites überleben
Rewrites überleben
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming Mythbusters
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im Glück
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefern
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 Sprints
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalieren
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce Breakfast
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

DevOps for PHP

  • 1. DevOps for PHP Florian Anderiasch I October 28, 2011 © Mayflower GmbH 2010
  • 2. Developer Ex-Admin DevOp? „I rant a lot“ @anderiasch stay in touch! Mayflower GmbH I 2
  • 3. Do you know DevOps? Mayflower GmbH I 3
  • 4. „These are cool tools!“ => „I'm doing DevOps now!“ Mayflower GmbH I 4
  • 5. It's not about the tools! Mayflower GmbH I 5
  • 6. It's about the culture! Mayflower GmbH I 6
  • 8. Coming from WebOps We often don't have much operations personnel. LAMP stack is our home Mayflower GmbH I 8
  • 9. Learn from each other! Work together! Mayflower GmbH I 9
  • 10. From ops to dev: repeatability change management monitoring provisioning Mayflower GmbH I 10
  • 11. From dev to ops: unit tests version control agile methods Mayflower GmbH I 11
  • 12. Why DevOps? Mayflower GmbH I 12
  • 13. How many releases per year? Mayflower GmbH I 13
  • 14. Some people do up to 60 per day Mayflower GmbH I 14
  • 15. We're striving for one per day. For now. Mayflower GmbH I 15
  • 16. We've come a long way Mayflower GmbH I 16
  • 17. Development in the dark ages Mayflower GmbH I 17
  • 18. Golden Image VMware/KVM Mayflower GmbH I 18
  • 19. Copying files over FTP to a shared host Mayflower GmbH I 19
  • 20. rsync /vcs checkout Mayflower GmbH I 20
  • 22. Hardware = Software = Configuration Mayflower GmbH I 22
  • 23. OK, tools are important. Mayflower GmbH I 23
  • 24. Bad news: they love ruby Mayflower GmbH I 24
  • 25. Good news: There are DSLs Mayflower GmbH I 25
  • 26. But in the end: It works Mayflower GmbH I 26
  • 27. Going from: do X or Y Towards: I want state Z Mayflower GmbH I 27
  • 28. Don't reinvent the wheel. Mayflower GmbH I 28
  • 29. puppet modules apache, nginx, varnish php, ruby, tomcat mysql, pgsql, memcache Mayflower GmbH I 29
  • 30. Monitoring Mayflower GmbH I 30
  • 33. Vagrant I know how I want my servers to look like Let's replicate that for development as close as possible Mayflower GmbH I 33
  • 34. Vagrant Based on VirtualBox automatically create VMs puppet or chef included Mayflower GmbH I 34
  • 35. Vagrant Fully versioned configs On-Demand creation Developer Self Service Mayflower GmbH I 35
  • 36. Getting started in 3 easy steps Mayflower GmbH I 36
  • 37. Manage your setup with Vagrant and VeeWee (needs VirtualBox and Ruby) Mayflower GmbH I 37
  • 38. $ gem install vagrant $ gem install veewee $ vagrant basebox templates $ vagrant basebox define 'natty' 'ubuntu-11.04-server-amd64' $ vagrant basebox build 'natty' $ vagrant basebox export natty $ vagrant box add 'natty' 'natty.box' Mayflower GmbH I 38
  • 39. http://vagrantbox.es Mayflower GmbH I 39
  • 40. $ gem install vagrant $ vagrant box add maverick64 http://mathie- vagrant-boxes.s3.amazonaws.com/maverick64.box $ mkdir maverick_demo $ cd maverick_demo $ vagrant init maverick64 $ vagrant up $ vagrant ssh vagrant@maverick64:~$ Mayflower GmbH I 40
  • 41. Manage your configuration Mayflower GmbH I 41
  • 43. Chef or Puppet Mayflower GmbH I 43
  • 44. - Configuration as Code - Client-only or Client-Server setup - backed by companies - officially supported by Amazon - tried and tested - good documentation - good, vibrant communities Mayflower GmbH I 44
  • 45. - Chef is ruby code, puppet has a DSL - puppet has the bigger community - puppet has more documentation - but chef is catching up - puppet: europe, chef: USA - chef is more flexible - if you puppet, you don't know ruby and vice versa Mayflower GmbH I 45
  • 46. - both know current configuration - you define your nodes (servers) - lots of community cookbooks/modules - easy to extend - templates - providers as platform abstractions (e.g. apt-get/ports/yum) Mayflower GmbH I 46
  • 47. There's no „better“ tool. But we prefer puppet. Less Ruby ;) Mayflower GmbH I 47
  • 48. user { 'florian': ensure => present, uid => '507', gid => 'admin', shell => '/bin/bash', home => '/home/florian', managehome => true, } Mayflower GmbH I 48
  • 49. user „florian“ do username „florian“ password „$1$P$WXmqrQEVj88fVTHevErxq.“ shell „/bin/bash“ system true supports :manage_home => true end Mayflower GmbH I 49
  • 50. Back to Vagrant Mayflower GmbH I 50
  • 51. Vagrant::Config.run do |config| config.vm.box = „natty“ end Mayflower GmbH I 51
  • 52. $ cat Vagrantfile Vagrant::Config.run do |config| config.vm.provision :puppet, :module_path => „modules“ do |puppet| puppet.manifests_path = „manifests“ puppet.manifest_file = „development.pp“ end config.vm.define :web do |web_config| web_config.vm.box = „natty“ web_config.vm.host_name = „webserver01“ web_config.vm.network „33.33.33.10“ web_config.vm.forward_port „http“,80,8080 web_config.vm.port „ssh“,22,2222 web_config.vm.share_folder „v- data“,“/srv/www“,“../silex-demo“ end end Mayflower GmbH I 52
  • 53. $ cat manifests/development.pp import „classes/*“ node „webserver01“ { include web } node „dbserver01“ { include db } node „ciserver01“ { include ci } Mayflower GmbH I 53
  • 54. $ cat manifests/classes/web.pp class web inherits basenode { include apache include apache::php apache::vhost { 'silex-demo.local': port => '80', docroot => '/srv/www/docroot', } package { ['mysql-client','php5-cli',...]: ensure => present, } } Mayflower GmbH I 54
  • 55. $ cat manifests/classes/ci.pp class ci inherits basenode { include apache include apache::php exec { 'pear-autodiscover': command => '/usr/bin/pear config-set auto_discover 1', } package{ ['pear.phpunit.de/PHP_CodeBrowser',...]: ensure => latest, provider => 'pear', require => Exec['pear-autodiscover'], } } Mayflower GmbH I 55
  • 56. Make the configuration part of your source code Mayflower GmbH I 56
  • 57. . |-- application |-- data |-- docs |-- library |-- public |-- scripts | |-- jobs | |-- build | -- configuration | |-- Vagrantfile | |-- manifests | -- modules |-- temp -- tests Mayflower GmbH I 57
  • 58. Why did I do that? Mayflower GmbH I 58
  • 59. Simple Failsafe Fast Setup Repeatable Consistent Self-Service Mayflower GmbH I 59
  • 60. No more golden images! Mayflower GmbH I 60
  • 61. No more USB sticks! Mayflower GmbH I 61
  • 62. Just one directory in your vcs Mayflower GmbH I 62
  • 63. Machine Life Cycle Management: Foreman Mayflower GmbH I 63
  • 64. A frontend for puppet Shows the system inventory Create new machines Provisioning Mayflower GmbH I 64
  • 67. I want more! Like 20+ Mayflower GmbH I 67
  • 68. McCloud wrapper around Vagrant and Fog transparent local & cloud usage Mayflower GmbH I 68
  • 69. I want more! Like 500... Mayflower GmbH I 69
  • 70. mCollective ssh-for-loop on steroids fast management for loads of servers uses puppet/facter, MQ-based Mayflower GmbH I 70
  • 71. $ mc-package -W "architecture=x86" status apache * [ ==================================> ] 10 / 10 host01.example.com version = apache-2.2.9-7 host02.example.com version = apache-2.2.9-7 host03.example.com version = apache-2.2.9-7 host04.example.com version = apache-2.2.9-7 host05.example.com version = apache-2.2.9-7 host06.example.com version = apache-2.2.9-7 host07.example.com version = apache-2.2.9-7 host08.example.com version = apache-2.2.9-7 host09.example.com version = apache-2.2.9-7 host10.example.com version = apache-2.2.9-7 ---- package agent summary ---- Nodes: 10 / 10 Versions: 10 * 0.25.5-1.el5 Elapsed Time: 1.03 s Mayflower GmbH I 71
  • 72. DevOps @Mayflower Mayflower GmbH I 72
  • 73. 1-2 „admins“ per team Mayflower GmbH I 73
  • 74. Operations and Development Mayflower GmbH I 74
  • 75. Working hand in hand with company admins Mayflower GmbH I 75
  • 76. Got root? Yes. Mayflower GmbH I 76
  • 77. 1+n puppetmaster 1 central n teams Mayflower GmbH I 77
  • 78. Example setup: puppetmaster 10 developer VMs Jenkins 4x Staging (eucalyptus) 4x Live (Amazon) Mayflower GmbH I 78
  • 79. More tools: gitorious eucalyptus cloud proxmox Mayflower GmbH I 79
  • 80. In the works: Vagrant Scrum => Kanban Puppet + Nagios Mayflower GmbH I 80
  • 81. Questions? Mayflower GmbH I 81
  • 82. Thanks for listening! Contact Florian Anderiasch florian.anderiasch@mayflower.de +49 89 242054 1134 @anderiasch Mayflower GmbH Mannhardtstrasse 6 29.10.11 80538 München Mayflower GmbH 82
  • 83. Images Domo-Kun(5) http://www.hawaiikawaii.net/2011/domo-kun-wallpaper-on-my-desktop/ Domo-Kun(6), Nina Helmer, CC-BY-NC-ND http://www.flickr.com/photos/origami_potato/3242174542/ Clouds (21), John Mueller, CC-BY-NC-ND http://www.flickr.com/photos/johnmueller/52621490/ Domo-Kun (23) http://i572.photobucket.com/albums/ss163/xxLoveorDie54xx/OMG-Its-Domo-kun.jpg puppet-dashboard (31) http://puppetlabs.com/puppet/related-projects/dashboard/ Mayflower GmbH I 83