DevOps for PHP
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

DevOps for PHP

on

  • 4,704 views

PHP

PHP

Statistics

Views

Total Views
4,704
Views on SlideShare
4,609
Embed Views
95

Actions

Likes
14
Downloads
62
Comments
0

3 Embeds 95

http://www.scoop.it 92
http://a0.twimg.com 2
http://paper.li 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

DevOps for PHP Presentation Transcript

  • 1. DevOps for PHPFlorian Anderiasch I October 28, 2011 © Mayflower GmbH 2010
  • 2. Developer Ex-Admin DevOp?„I rant a lot“@anderiaschstay in touch! Mayflower GmbH I 2
  • 3. Do you know DevOps? Mayflower GmbH I 3
  • 4. „These are cool tools!“ =>„Im doing DevOps now!“ Mayflower GmbH I 4
  • 5. Its not about the tools! Mayflower GmbH I 5
  • 6. Its aboutthe culture! Mayflower GmbH I 6
  • 7. Mayflower GmbH I 7
  • 8. Coming from WebOpsWe often dont 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: repeatabilitychange 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 manyreleases per year? Mayflower GmbH I 13
  • 14. Some people do up to 60 per day Mayflower GmbH I 14
  • 15. Were strivingfor one per day. For now. Mayflower GmbH I 15
  • 16. Weve come a long way Mayflower GmbH I 16
  • 17. Development in the dark ages Mayflower GmbH I 17
  • 18. Golden ImageVMware/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
  • 21. Mayflower GmbH I 21
  • 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. Dont reinvent the wheel. Mayflower GmbH I 28
  • 29. puppet modulesapache, nginx, varnish php, ruby, tomcatmysql, pgsql, memcache Mayflower GmbH I 29
  • 30. Monitoring Mayflower GmbH I 30
  • 31. http://www.puppetlabs.com/puppet/related-projects/dashboard/ Mayflower GmbH I 31
  • 32. Mayflower GmbH I 32
  • 33. Vagrant I know how I want my servers to look like Lets 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 startedin 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 sshvagrant@maverick64:~$ Mayflower GmbH I 40
  • 41. Manage yourconfiguration Mayflower GmbH I 41
  • 42. Mayflower GmbH I 42
  • 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 dont 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. Theres 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 => trueend 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 VagrantfileVagrant::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“ endend Mayflower GmbH I 52
  • 53. $ cat manifests/development.ppimport „classes/*“node „webserver01“ { include web}node „dbserver01“ { include db}node „ciserver01“ { include ci} Mayflower GmbH I 53
  • 54. $ cat manifests/classes/web.ppclass 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.ppclass 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 configurationpart 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 SetupRepeatable ConsistentSelf-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 puppetShows the system inventory Create new machines Provisioning Mayflower GmbH I 64
  • 65. Mayflower GmbH I 65
  • 66. Mayflower GmbH I 66
  • 67. I want more! Like 20+ Mayflower GmbH I 67
  • 68. McCloudwrapper 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 serversuses puppet/facter, MQ-based Mayflower GmbH I 70
  • 71. $ mc-package -W "architecture=x86" status apache *[ ==================================> ] 10 / 10host01.example.com version = apache-2.2.9-7host02.example.com version = apache-2.2.9-7host03.example.com version = apache-2.2.9-7host04.example.com version = apache-2.2.9-7host05.example.com version = apache-2.2.9-7host06.example.com version = apache-2.2.9-7host07.example.com version = apache-2.2.9-7host08.example.com version = apache-2.2.9-7host09.example.com version = apache-2.2.9-7host10.example.com version = apache-2.2.9-7---- package agent summary ----Nodes: 10 / 10Versions: 10 * 0.25.5-1.el5Elapsed 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 andDevelopment Mayflower GmbH I 74
  • 75. Working hand in handwith 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 Jenkins4x Staging (eucalyptus) 4x Live (Amazon) Mayflower GmbH I 78
  • 79. More tools: gitoriouseucalyptus cloud proxmox Mayflower GmbH I 79
  • 80. In the works: VagrantScrum => KanbanPuppet + 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 629.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