Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

From Dev to DevOps - FOSDEM 2012


Published on

More info at

The DevOps movement aims to improve communication between developers and operations teams to solve critical issues such as fear of change and risky deployments. But the same way that Agile development would likely fail without continuous integration tools, the DevOps principles need tools to make them real, and provide the automation required to actually be implemented. Most of the so called DevOps tools focus on the operations side, and there should be more than that, the automation must cover the full process, Dev to QA to Ops and be as automated and agile as possible. Tools in each part of the workflow have evolved in their own silos, and with the support of their own target teams. But a true DevOps mentality requires a seamless process from the start of development to the end in production deployments and maintenance, and for a process to be successful there must be tools that take the burden out of humans.
Apache Maven has arguably been the most successful tool for development, project standardization and automation introduced in the last years. On the operations side we have open source tools like Puppet or Chef that are becoming increasingly popular to automate infrastructure maintenance and server provisioning.
In this presentation we will introduce an end-to-end development-to-production process that will take advantage of Maven and Puppet, each of them at their strong points, and open source tools to automate the handover between them, automating continuous build and deployment, continuous delivery, from source code to any number of application servers managed with Puppet, running either in physical hardware or the cloud, handling new continuous integration builds and releases automatically through several stages and environments such as development, QA, and production.

Published in: Technology
  • Be the first to comment

From Dev to DevOps - FOSDEM 2012

  1. From Dev to DevOpsCarlos Sanchez@csanchezhttp://carlossanchez.eu
  2. Apache @csanchez Maven Apache ASF Archiva Member ApacheEclipse IAM Continuum
  3. Dev... What?
  4. Agile planning iterative development continuous integrationrelease soon, release often
  5. DevQaOps ?
  6. DevOps addresses Fear of change Risky deployments It works on my machine! SiloisationDev Change vs. Ops stability
  7. Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan
  8. Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. Welcome changing requirements, even late in development. Agile processes harness change for the customers competitive advantage. Deliver working software frequently, from a couple of weeksto a couple of months, with a preference to the shorter timescale. Business people and developers must work together daily throughout the project. The most efficient and effective method of conveying information to and within a development team is face-to-face conversation. Agile processes promote sustainable development. Thesponsors, developers, and users should be able to maintain a constant pace indefinitely.
  9. Dev
  10. What developers do today tospecify target environments is NOT enough
  11. Ops
  12. requirementsOperating Systemconfig filespackages installedmulti stage configurationsdevQApre-productionproduction
  13. DeploymentHow do I deploy this?documentationmanual stepsprone to errors
  14. CloudHow do I deploy this?to hundreds of servers
  15. Infrastructure as CodeNew solutions bring new challengesFollow development best practices tagging branching releasing dev, QA, production
  16. DevOps
  17. Should I worry about my OPS job?
  18. yes
  19. yes my job is to make otherpeople’s jobs unnecessary
  20. yes
  21. yes
  22. yes no
  23. yes noyou should see the NOOPS guys
  24. DevOps is NOT about the tools
  25. Nice, BUThow can I implement IT
  26. Nice, BUThow can I implement IT
  27. Tools can enablechange in behavior and eventually change culture Patrick Debois
  28. DevOps toolseveryone is intelligentenoughevery tool is cloudenabledevery tool is DevOps(tm)
  29. DevOps toolseveryone is intelligentenoughevery tool is cloudenabledevery tool is DevOps(tm)
  30. DevOps tools: infrastructure automation infrastructure as code it’s all invented, now it’s standardized
  31. New solutions bring new problems DEVOPS “MY MACHINES ARE BEING PROVISIONED”
  32. Puppet exec { "maven-untar":manifests command => "tar xf /tmp/x.tgz", cwd => "/opt", creates => "/opt/apache-maven-${version}",ruby-like path => ["/bin"], } -> ERB templates file { "/usr/bin/mvn": ensure => link, target => "/opt/apache-maven-${version}/bin/mvn", } file { "/usr/local/bin/mvn": ensure => absent, require => Exec["maven-untar"], } file { "$home/.mavenrc": mode => "0600", owner => $user, content => template("maven/mavenrc.erb"), require => User[$user], }
  33. Puppetinfrastructure IS code package { openssh-server: ensure => present, }
  34. Puppetdeclarative modelstate vs process no scripting service { ntp: name => ntpd, ensure => running, }
  35. Puppetmaster - agentarchitecture
  36. Puppet file structure /etc/puppet manifests/site.pp manifests/nodes.pp
  37. Puppet exampleuser { dave: ensure => present, uid => 507, gid => admin, shell => /bin/zsh, home => /home/dave, managehome => true,}file {/tmp/test1: ensure => present, content => "Hi.",}
  38. Vagrant
  39. Vagrant Oracle VirtualBox cmdline automation Easy Puppet and Chef provisioning Keep VM configuration for different projectsShare boxes and configuration files across teams base box + configuration files
  40. Vagrant base boxes www.vagrantbox.esanywhere! just (big) files
  41. using Vagrant$ gem install vagrant$ vagrant box add centos-6.0-x86_64$ vagrant init myproject$ vagrant up$ vagrant ssh$ vagrant suspend$ vagrant resume$ vagrant destroy
  42. do |config| # Every Vagrant virtual environment requires a box to build off of. = "centos-6.0-x86_64" # The url from where the box will be fetched config.vm.box_url = "" # Boot with a GUI so you can see the screen. (Default is headless) #config.vm.boot_mode = :gui # Assign this VM to a host only network IP, allowing you to access it via the IP. # "" # Forward a port from the guest to the host, which allows for outside # computers to access the VM, whereas host only networking does not. config.vm.forward_port "sonar", 9000, 19000 # Enable provisioning with Puppet stand alone. config.vm.share_folder("templates", "/tmp/vagrant-puppet/templates", "templates") config.vm.provision :puppet do |puppet| puppet.manifest_file = "base.pp" puppet.module_path = "mymodules" puppet.options = ["--templatedir","/tmp/vagrant-puppet/templates"] puppet.options = "-v -d" endend
  43. manifests/base.pppackage { jdk: ensure => installed, name => $operatingsystem ? { centOS => "java-1.6.0-openjdk-devel", Ubuntu => "openjdk-6-jdk", default => "jdk", },}
  44. VeeWee
  45. VeeWee easily build Vagrant base boxes
  46. using VeeWee$ gem install veewee$ vagrant basebox templates$ vagrant basebox define my-ubuntu-server ubuntu-11.04-server-amd64# customize definitions/my-ubuntu-server$ vagrant basebox build my-ubuntu-server$ vagrant basebox validate my-ubuntu-server$ vagrant basebox export my-ubuntu-server$ vagrant box add my-ubuntu-server$ vagrant init my-ubuntu-server
  47. Geppetto
  49. Maven and Puppet
  50. What am I doing to automate deployment Ant tasks plugin ssh commands Assembly plugin Cargo Capistrano
  51. What can I do to automate deployment Handle full deployment including infrastructure not just webapp deployment Help Ops with clear, automated manifests Ability to reproduce production environments in local box using Vagrant / VirtualBox / VMWare Use the right tool for the right job
  52. Maven-Puppet module A Maven Puppet module fetches Maven artifacts from the repo manages them with Puppet no more extra packaging
  53. Installing Maven$repo1 = { id => "myrepo", username => "myuser", password => "mypassword", url => "",}# Install Mavenclass { "maven::maven": version => "2.2.1",} -># Create a settings.xml with the repo credentialsclass { "maven::settings" : servers => [$repo1],}
  54. New Maven typemaven { "/tmp/maven-core-2.2.1.jar": id => "org.apache.maven:maven-core:jar:2.2.1", repos => ["", ""],}
  55. New Maven typemaven { "/tmp/maven-core-2.2.1.jar": groupId => "org.apache.maven", artifactId => "maven-core", version => "2.2.1", packaging => "jar", repos => ["", ""],}
  56. Puppet DSL
  57. Puppet resourcesuser { dave: ensure => present, uid => 507, gid => admin, shell => /bin/zsh, home => /home/dave, managehome => true,}
  58. Puppet resources $ puppet resource user rootuser { root: home => /var/root, shell => /bin/sh, uid => 0, ensure => present, password => *, gid => 0, comment => System Administrator}
  59. Puppet resourcesfile {testfile: path => /tmp/testfile, ensure => present, mode => 0640, content => "Im a test file.",}notify {"Im notifying you.":}
  60. Puppet standalone$ puppet apply my_test_manifest.pp
  61. orderingfile {/tmp/test1: ensure => present, content => "Hi.",}notify {/tmp/test1 has alreadybeen synced.: require => File[/tmp/test1],}
  62. orderingfile {/tmp/test1: ensure => present, content => "Hi.",} ->notify {/tmp/test1 has alreadybeen synced.:}
  63. package / file /service / subscribepackage { openssh-server: ensure => present, before => File[/etc/ssh/sshd_config],}file { /etc/ssh/sshd_config: ensure => file, mode => 600, source => /root/learning-manifests/sshd_config,}service { sshd: ensure => running, enable => true, hasrestart => true, hasstatus => true, subscribe => File[/etc/ssh/sshd_config],}
  64. variables$longthing = "Imagine I have something reallylong in here. Like an SSH key, lets say."file {authorized_keys: path => /root/.ssh/authorized_keys, content => $longthing,}
  65. factshost {self: ensure => present, name => $::fqdn, host_aliases => [puppet, $::hostname], ip => $::ipaddress,}file {motd: ensure => file, path => /etc/motd, mode => 0644, content => "Welcome to ${::hostname},na ${::operatingsystem} island in the sea of ${::domain}.n",}
  66. conditionalsif $is_virtual { service {ntpd: ensure => stopped, enable => false, }}else { service { ntpd: name => ntpd, ensure => running, enable => true, hasrestart => true, require => Package[ntp], }}
  67. conditionalscase $operatingsystem { centos, redhat: { $apache = "httpd" } debian, ubuntu: { $apache = "apache2" } default: { fail("Unrecognized operating system forwebserver") }}$apache = $operatingsystem ? { centos => httpd, redhat => httpd, /(?i)(ubuntu|debian)/ => "apache2-$1", # (Dont actually use that package name.) default => undef, }
  68. class definitionclass ntp { package { ntp: ensure => installed, } service { ntp: name => ntpd, ensure => running, enable => true, subscribe => File[ntp.conf], }}
  69. class declaration (1)class {ntp: }
  70. class declaration (2)include ntp
  71. parameterized classesclass paramclassexample ($value1, $value2 = "Defaultvalue") { notify {"Value 1 is ${value1}.":} notify {"Value 2 is ${value2}.":}}class {paramclassexample: value1 => Something, value2 => Something else,}class {paramclassexample: value1 => Something,}
  72. modules{module}/ files/ lib/ manifests/ init.pp {class}.pp {defined type}.pp {namespace}/ {class}.pp {class}.pp templates/ tests/
  73. templatingfile {/etc/foo.conf: ensure => file, require => Package[foo], content => template(foo/foo.conf.erb),}
  74. templates/foo.conf.erbOS is <%= $::operatingsystem %>
  75. node configuration# nodes.ppnode inherits basenode { $web_fqdn = include genericwebserver include some_other_service}node inherits basenode { include s_ldap::master}node inherits basenode { include c_humanresources}
  76. Example code and slides Available at http://blog.carlossanchez.eu
  77. Thanks!http://maestrodev.com
  78. Photo Credits Son of Man Lego - Alex Eylar Brick wall - Luis Argerich Agile vs. Iterative flow - Christopher Little DevOps - Rajiv.Pant Pimientos de Padron - Howard Walfish Compiling - XKCD Printer in 1568 - Meggs, Philip B Relativity - M. C. Escher Teacher and class - Herald Post