22. Browser
Hip
Apache with PHP MySQL NoSQL
Server
Memcache, oops,
Gearman
Redis now
23. Browser
Hip
Apache with PHP MySQL NoSQL
Server
Memcache, oops, Gearman, ahum,
eJabberD
Redis now ActiveMQ
24. Browser
Hip
Apache with Apache with
MySQL NoSQL
PHP PHP
Server
Memcache, Memcache, Gearman,
oops, oops, ahum, eJabberD
Redis now Redis now ActiveMQ
25. Browser
Hip
Apache with Apache with
MySQL NoSQL
PHP PHP
Server
Memcache, Memcache, Gearman,
oops, oops, ahum, eJabberD
Redis now Redis now ActiveMQ
26. Apa Apa MyS Hip Apa Apa MyS Hip
Me Me Gea eJa
Me Me Gea eJa
Development Continuous Integration
Apa Apa Apa Apa MyS MyS Hip Hip
Me Me Me Me Gea Gea eJa eJa
Production
27. Version X+2 Version X+1
Development Continuous Integration
Version X
Production
28. New! With Redis! Not so new with Memcached
Version X+2 Version X+1
Development Continuous Integration
Still without proper Caching :-(
Version X
Production
29.
30. 10th Floor
Test
http://www.flickr.com/photos/75905404@N00/
31. Collection of Fails
Failsafety
Simplicity
Fast Setup Time
Repeatability Self-Service
Consistency
Version Management
http://www.flickr.com/photos/turtlemom_nancy/
40. ~# vagrant
Tasks:
vagrant basebox # Commands to manage baseboxes
vagrant box # Commands to manage system boxes
vagrant destroy # Destroy the environment, deleting the created virtual
machines
vagrant halt # Halt the running VMs in the environment
vagrant help [TASK] # Describe available tasks or one specific task
vagrant init [box_name] [box_url] # Initializes the current folder for
Vagrant usage
vagrant package # Package a Vagrant environment for distribution
vagrant provision # Rerun the provisioning scripts on a running VM
vagrant reload # Reload the environment, halting it then restarting
it.
vagrant resume # Resume a suspended Vagrant environment.
vagrant ssh # SSH into the currently running Vagrant environment.
vagrant ssh_config # outputs .ssh/config valid syntax for connecting to
this environment via ssh
vagrant status # Shows the status of the current Vagrant environment.
vagrant suspend # Suspend a running Vagrant environment.
vagrant up # Creates the Vagrant environment
vagrant version # Prints the Vagrant version information
44. • Configuration as (Ruby-)Code
• Client-only or Client-server Setup
• there is a series-b funded company in the background
• both are officially supported by amazon
• there are a lot of BIG customers using the tool
• good documentation
• good, vibrant communities
45. • both know the current configuration (ohai and facter)
• You define your nodes (Servers)
• using a lot of pre-existing resources
• and a lot of default community-built cookbooks / modules
• it‘s easy to extend using ruby
• use configuration file templates
• use providers as platform abstractions (for packaging, ...)
46. • Chef is actually Ruby, Puppet provides a DSL
• puppet has the bigger community
• puppet has more documentation
• but chef is growing fast in both regards
• puppet = europe, chef = usa
• chef is more flexible because of native ruby
• chef is more flexible because of clever data structures
57. 3. Make the configuration
part of your sourcecode
58. • application
• data
• docs
• library
• public
• scripts
• jobs
• build
• configuration
• VagrantFile
• manifests
• modules
• temp
59. Ok, that was a lot of work.
Why did i do that again?
60. Collection of Wins
Failsafety
Simplicity
Fast Setup Time
Repeatability Self-Service
Consistency
Version Management
http://www.flickr.com/photos/turtlemom_nancy/
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
71. The Foreman - Machine Life Cycle
Management
Acts as a web front end for Puppet
Shows You the system inventory
Creates new machines and takes care
of provisioning
89. actually a behavior driven design tool
used for test driven infrastructure
cucumber-puppet
chef-cucumber
90. Feature: Manualsearch
In order to find an article
As an developer
I want to use the search function
Scenario: Search for bdd and check resulting page
Given I go to "http://it-republik.de/php/"
When I fill in "search_itr" with "bdd"
And I click "search2"
Then I should see "Suche"
91. Given /^I go to "([^"]*)"$/ do |url|
visit url
end
When /^I fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
fill_in field, :with => value
end
When /^I click "([^"]*)"$/ do |button|
click_button(button)
end
Then /^I should see "([^"]*)"$/ do |text|
response_body.should include(text)
end
92. johann$ cucumber
Feature: Manualsearch
In order to find an article
As an developer
I want to use the search function
Scenario: Search for bdd and check resulting page # features/
search.feature:5
Given I go to "http://it-republik.de/php/" # features/
step_definitions/search_steps.rb:1
When I fill in "search_itr" with "bdd" # features/
step_definitions/search_steps.rb:5
And I click "search2" # features/
step_definitions/search_steps.rb:9
Then I should see "Suche" # features/
step_definitions/search_steps.rb:13
1 scenario (1 passed)
4 steps (4 passed)
0m1.615s
93. Feature: Install inetd
In order to serve the web
the httpd service
must be installed
Scenario: Setup httpd
Given a node of class “web“
When I compile the catalog
Then package “httpd“ should be “installed“
Then there should be a resource “Service[httpd]“
And the service should have “enable“ set to “true“
And State should be “running“
And the service should require “Package[httpd]“
Kontinuierliche Entiwcklung - und dann? I Mayflower GmbH I 28. Oktober 2010 I 92
106. Wetware - Mayflower
1-2 Ops per team
• Admin & Development tasks
• full time working within the
team
107. Wetware - Mayflower
Close cooperation with central operations
Full root access for any development-infrastructre
108. Wetware - Mayflower
1+n Puppet-Master
• central company master
• Team puppet master per team / project
• company master is starting point for the project
puppet configuration
109. Wetware - Mayflower
Example Setup:
• local Developer VM
• CI-Deployment-Server in the DMZ
• Staging in the private Cloud
• Beta happens in the Amazon-Cloud
• Production in AWS, too
I am johann. a few people already know me. a warm welcome to you, too! \nI am founder and CTO of mayflower, sorry for not having a coffee lounge here this year. i am responsible for 65 php developers, so it‘s my job to improve the processes, and that‘s why i am talking about devops.\n\n
Because you are more interesting.\n
Who is a developer? \nWho is a administrator? Should you wear a beard?\nWho is neither a developer nor a system administrator? \nHey, nice, what are you? And why are you here? \n\n
Let‘s see what the development background is. How many of you are php developers? You can tell the truth, i am a PHP developer, too. sounds a bit like the alcoholics anonymous - „Hi, i am johann, and i am a PHP developer“.\nA java developer? Are there still jobs around for java developers? \n
\n
\n
Obviously You should do it because it‘s cool. DevOps is much of a hype right now, and you can be part of it! It‘s like the Google Wave developer hype without the disappointment later\n
The truth is a lot more boring - it‘s because we need it. Let me tell you a story about the dark age.\n
Do You remember the dark ages of development? How did development happen that days? \n(by the way: he does look a bit like benjamin eberlei, doesn‘t he?)\n
We used an basic vmware image. it was downloadable at some local fileserver, several gigabytes big and everything you needed for development was already installed. \n
This golden image always looked good in the beginning, but your application started to change. stuff was added, some kind of improvements were made. a default database was supplied, too. there was a default user used by everybody. \n
- but changes were needed - bash scripts to change the configuration\n- database update scripts - versioned database update scripts\n- a lot of bugs were solved by „you need to run the update script“\n- and the same amount of bugs were created by running the update script. \n- from time to time a new golden image was needed and some of the devs used it.\n
- after a while every developer had his own improved version of the image\n- incompatible, different versions, only the local version management sandbox was up to date\n\n
\n
\n
And in the good old days our application infrastructure was simple 3-tier\nweb server and database server were happening on one host.\n
Suddenly we had to add stuff. Like a hip NoSQL Server\n
And a memcache server, for Caching.\n
memcache became unhip, so it was replaced by redis\nan asynchronous messagequeue like gearman was introduced\n
Gearman wasn‘t so enterprisey in the end, so it was replaced by ActiveMQ. \nAn eJabberD was introduced for browser-side pubsub.\n
And actually it was 4 Servers now. \n
Ending up in 4 different bash scripted setup routines based on a set of 3 golden images.\n
On the other hand side, there wasn‘t just development, there was continious integration and production as well. sometimes with a different deployment mechanism.\n
And there were different Versions deployed, anyway. \n
With different tools, and software versions to work with different tools. Your application version happens in your version management system, your configuration in some adminstrators bash script. both are not in sync. \n
This wasn‘t any fun anymore. the number of wtf/minute was constantly increasing. We did not like it a lot.\n
10th floor test: throw a random computer out of the windows and wait how long it takes everything is up & running again. We did not actually do it, since we are in a 5 store building. If your building is higher, try it out, it‘s a good benchmark.\n
That‘s our collection of fails. No simplicity, no failsafety - if a configuration is screwed it‘s screwed. \n
But how do we get there?\n
DevOps for the win!\n
(Danger: Code ahead)\n
(Danger: Code ahead). It works good on any linux, bsd etc. including Mac. Windows, especially with 64 bits is a bit hard to do, you have to use jruby. \n
With a cool logo!\n
First install vagrant and veewee. this is done using the default ruby gem install. \nlist baseboxes, choose yours and use it as your default box.\n\n
\n
\n
\n
First thing to know: configuration is code. it‘s not a setup anymore. \n
That are the two main players. like linux and freebsd, like gnome and kde everything opensource gets better when there are two of a kind. Does anyone still know cfengine?\n
On first sight chef and puppet look like twins. (Those are my sons, btw, sorry to show you, you know how proud parents are :-) )\n\n
\n
\n
\n
There are several tests and comparisons available online. half of the time puppet wins, half of the time chef does. there is no winner. have a look at it and take the tool you like. if you are an experenced ruby developer, chef is the better choice, if not, puppet can be. \n
That‘s how the puppet DSL looks like. You‘ll see some more examples later.\n
And that‘s how chef syntax looks like. The difference is:\nThis is ruby code. You have the full flexibility of the language available.\n
\n
That is the first Vagrantfile generated by vagrant init\n
Here we are talking vagrant. \n- puppet as a machine provisioner, with a link to the puppet directory and the default manifest for this machine - and more machines are possible\n- name of the server, network configuration, port forwarding and mount points.\n\n
This is the puppet configuration file for my nodes ( servers). i can include directores, and i can include other classes in my classes. \n
That‘s the included definition of the web class. see, there is inheritance.\nThe apache-include is a puppet module and provides for example the vhost configuration\nThe package is a resource wrapper for apt here, since this is an ubuntu natty setup.\n
This is an example for a custom package provider for pear packages.\n
\n
This is an example based on the zend framework default directory layout. Two parts are going to change - the configs will contain the server setup as well, and there is a new vms folder within the scripts directory, containing a Vagrantfile. let‘s cd into scripts/configuration and start to work\n
\n
That‘s our collection of fails. No simplicity, no failsafety - if a configuration is screwed it‘s screwed. \n
\n
\n
And all the developer has to do is a vagrant up to get his vms from the source\nif there have been configuration changes just do a vagrant provision\nno more. \nNO NEED TO SAVE YOUR VM ANYMORE!\n
\n
this is an additional module for vagrant to give you a chance to screw your vms.\n
\n
\n
\n
\n
\n
Right now libvirt-based, in future ec2-support is going to happen\n
\n
That‘s how you create a new machine. Or your developers do in self service. \nDo you remember how long this took before? \n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Danke an Jimdo für das Beispiel.. \n
\n
Wer setzt Jenkins ein? (sonst erklären)\n
\n
Sebastian wird hierüber noch mehr erzählen. \n
\n
\n
- gemeinsame Standups\n- gegenseitige Teilnahme an den Sprint Plannings & Retros\n- gleiche Räume, wenn möglich\n
Der Code gehört auch den Admins, die Konfiguration und die Verlässlichkeit auch den Developern.\n
Wie bekommt man Respekt hin?\n- Soziale Interaktion, Feiern, Teambuilding\nWenn ich jemand persönliche kenne nehme ich auf seine Interessen Rücksicht\n
Die langfristige Planung wird gemeinsam gemacht. Es werden gemeinsame Ziele definiert, und die Lösungsstrategien gemeinsam erstellt.\n