SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
Adopt Devops philosophy on your
              Symfony projects
                An introduction to Devops
                         by Fabrice Bernhard
Me
Fabrice Bernhard
@theodo
fabriceb@theodo.fr
Co-founder / CTO of Theodo and Allomatch.com
Theodo creates web-based applications

with open-source web technologies, agile methodologies and the highest
standards of quality

to guarantee rapid application development, risk-free deployment and easy
maintenance for every client.
@skoop: Now, let's look for a bar in Paris where I could watch the FC Utrecht match
:)
Allomatch.com is the website for watching sports in bars in France and Spain
(sportandbar.es)

Allomatch is used by 500 barmen (clients) and visited by more than 200,000
unique visitors per month

Peaks on the biggest days can go up to 20,000 people in the 2 hours preceding
the game

Allomatch.com is hosted on a cluster of 6 servers
What is DevOps?
        Introduction
How many here consider themselves SysAdmins?
How many here have never deployed an application on a
                     server?
Wikipedia
Definition of DevOps


DevOps is a set of processes, methods and systems for communication,
collaboration and integration between departments for Development
(Applications/Software Engineering), Technology Operations and Quality Assurance
(QA).
It relates to the emerging understanding of the interdependence of development
and operations in meeting a business' goal to producing timely software products
and services
The fundamental DevOps contradiction
Devs VS Ops

  Developers are asked to deliver new value, often and fast

  Operations people are asked to protect the current value

  Pro-Change VS Pro-Stability
Silos
Break the silos
DevOps do RADD
DevOps create the infrastructure that empower devs from
    the first line of code to the delivery
How to be DevOps?

  Configuration management for rapid, repeatable server setup

  Deployment scripts to abstract sysadmin tasks and empower developers

  Development VMs with prod configuration to ensure consistency and avoid
  unexpected system-related bugs

  Continuous deployment to make it fast!
DevOps is spreading agility to the whole IT project lifecycle
Rapid and repeatable server setup
          Configuration management with Puppet
What is configuration management?

Writing the system configuration of your servers in files

Applying these files automatically

That's it!
Why do configuration management?

To do fast cluster deployment: who wants to manually setup 50 EC2 servers???

To do fast crash-recovery: configuration management is the best documentation
for a server's setup

To have consistent environments for development and production
Puppet or Chef
Configuration management tools

  Two popular recent tools for configuration management: Puppet and Chef

  A master server contains different "recipes" describing system configurations

  Client servers connect to the master server, read their recipe, and apply the
  configuration
Puppet
Puppet references
Let us create a Symfony-ready server with Puppet
          Introduction to Puppet manifests
class lighttpd
{
    package { "apache2.2-bin":
      ensure => absent,
    }
    package { "lighttpd":
      ensure => present,
    }
    service { "lighttpd":
      ensure => running,
      require => Package["lighttpd", "apache2.2-bin"],
    }

}
class lighttpd-phpmysql-fastcgi inherits lighttpd
{

    package { "php5-cgi":
      ensure => present,
    }

    package { "mysql-server":
      ensure => present,
    }

    exec { "lighttpd-enable-mod fastcgi":
      path    => "/usr/bin:/usr/sbin:/bin",
      creates => "/etc/lighttpd/conf-enabled/10-fastcgi.conf",
      require => Package["php5-cgi", "lighttpd"],
    }

}
class symfony-server inherits lighttpd-phpmysql-fastcgi
{

    package { ["php5-cli", "php5-sqlite"]:
      ensure => present,
      notify => Service["lighttpd"],
    }
    package { "git-core":
      ensure => present,
    }

    exec { "git clone git://github.com/symfony/symfony1.git":
      path    => "/usr/bin:/usr/sbin:/bin",
      cwd => "/var/www",
      creates => "/var/www/symfony1",
      require => Package["lighttpd", "git-core"],
    }

}
class symfony-live-server inherits symfony-server
{
    file { "/etc/lighttpd/conf-available/99-hosts.conf":
      source => "/vagrant/files/conf/hosts.conf",
      notify => Service["lighttpd"],
    }
    exec { "lighttpd-enable-mod hosts":
      path => "/usr/bin:/usr/sbin:/bin",
      creates => "/etc/lighttpd/conf-enabled/99-hosts.conf",
      require => File["/etc/lighttpd/conf-available/99-hosts.conf"],
      notify => Service["lighttpd"],
    }

}

include symfony-live-server
notice("Symfony server is going live!")
Why not use shell scripts?


Shell scripts are for administrators. Is all your team composed of admin experts?

Even for admin experts, Puppet and Chef recipes are more readable

Puppet and Chef make inheritance and modules easy

Puppet and Chef are idempotent: running them twice in a row will not break
your system
Develop and test on the same
environment as in production!
            VM provisioning with Vagrant
Develop on local Virtual Machines
Vagrant

  Vagrant is a tool to create local VirtualBox VMs, configured automatically by your
  Chef recipe or Puppet manifest

  It ensures you test on the same environment as your production server

  It is VERY easy
All you need is:
Vagrant



  A Puppet manifest

  A few system config files

  A Vagrant conf file
Demonstration
Vagrant


  $ git clone git://github.com/fabriceb/sflive2011vm.git .
  $ git clone git://github.com/fabriceb/sflive2011.git
  $ vagrant up


  http://127.0.0.1:2011/
Give developers the power to deploy
                       themselves
                       Scripted deployment
Deployment

Deployment is a very critical task usually done by admins

Remember Murphy's law: "If anything can go wrong, it will"

W hen things go wrong, most of the time developers have the solution

So give the developers the responsibility to deploy, rollback, correct and deploy
again!
Scripting deployment can be VERY easy
Simple Fabric script example
  # fabfile.py
  from fabric.api import *
  env.hosts = ['theodo@myserver.com']

  def deploy():
    with cd('/theodo/sflive2011'):
      run('git pull')
      run('./symfony doc:build --all --no-confirmation')
      run('./symfony cc')


  $ fab deploy
A good practise: scripting a rollback
Another Fabric example
  # fabfile.py
  def deploy():
    tag = "prod/%s" % strftime("%Y/%m-%d-%H-%M-%S")
    local('git tag -a %s -m "Prod"' % tag)
    local('git push --tags')
    with cd(path):
      run('git fetch')
      tag = run('git tag -l prod/* | sort | tail -n1')
      run('git checkout ' + tag)

  def rollback(num_revs=1):
    with cd(path):
      run('git fetch')
      tag = run('git tag -l prod/* | sort | tail -n' + 
            str(1 + int(num_revs)) + ' | head -n1')
      run('git checkout ' + tag)
And why not let Jenkins deploy
                      himself?
                Continuous deployment
The Holy Grail of Rapid App Development & Deployment:
           Automate everything low value-added




                        and relax
Isn't it dangerous to trust a machine?
Errare humanum est

  Of course you need continuous integration with MANY tests

  Of course you need some serious monitoring on the production server

  Of course you need some good rollback scripts

  But aren't that good things to do anyway ?

  Good continuous integration is more reliable than a human!
You need to separate dev, pre-prod and prod...
Continuous deployment howto
For example with git:

   features/* branches for small projects

   dev branch for merging team development

   master branch for production-ready code

   prod/* tags for production
And you need a deployment script + Jenkins
Continuous deployment howto

  Deployment script using Fabric (for example)

  Jenkins (formerly known as Hudson) to test and deploy
Create a new Jenkins project testing only branch master
Specify "Build other projects" in the post-build actions
Don't forget to activate Chuck Norris
Create a second Jenkins project to execute the deploy script
That's it!
Next step
Links

docs.puppetlabs.com

fabfile.org

vagrantup.com

github.com/fabriceb/sflive2011vm
DevOps meetups

groups.google.com/group/paris-devops

and many more devops meetups around the world
Many thanks to Samuel @smaftoul Maftoul, organiser of the
 Paris DevOps meetup, who bootstrapped me on DevOps!
Questions?



   @theodo
fabriceb@theodo.fr

Weitere ähnliche Inhalte

Was ist angesagt?

Writing Fast Code - PyCon HK 2015
Writing Fast Code - PyCon HK 2015Writing Fast Code - PyCon HK 2015
Writing Fast Code - PyCon HK 2015Younggun Kim
 
Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...Samuel Lampa
 
Webinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabWebinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabOlinData
 
SciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSamuel Lampa
 
[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...
[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...
[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...Naoki (Neo) SATO
 
Les nouveautés de C# 7
Les nouveautés de C# 7Les nouveautés de C# 7
Les nouveautés de C# 7Microsoft
 
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)Steven Smith
 
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Pôle Systematic Paris-Region
 
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetFrom Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetPôle Systematic Paris-Region
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Gruntbenko
 
20151117 IoT를 위한 서비스 구성과 개발
20151117 IoT를 위한 서비스 구성과 개발20151117 IoT를 위한 서비스 구성과 개발
20151117 IoT를 위한 서비스 구성과 개발영욱 김
 
Ondřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.czOndřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.czDevelcz
 
How to rewrite the OS using C by strong type
How to rewrite the OS using C by strong typeHow to rewrite the OS using C by strong type
How to rewrite the OS using C by strong typeKiwamu Okabe
 
Wonders of Golang
Wonders of GolangWonders of Golang
Wonders of GolangKartik Sura
 
Beachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JITBeachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JITKouji Matsui
 

Was ist angesagt? (20)

Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
Writing Fast Code - PyCon HK 2015
Writing Fast Code - PyCon HK 2015Writing Fast Code - PyCon HK 2015
Writing Fast Code - PyCon HK 2015
 
Azure Functions
Azure FunctionsAzure Functions
Azure Functions
 
Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
 
Webinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabWebinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLab
 
SciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programming
 
[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...
[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...
[Container X mas Party with flexy] Machine Learning Lifecycle with Kubeflow o...
 
Les nouveautés de C# 7
Les nouveautés de C# 7Les nouveautés de C# 7
Les nouveautés de C# 7
 
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
 
GitLab - Java User Group
GitLab - Java User GroupGitLab - Java User Group
GitLab - Java User Group
 
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
 
Is Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic GascIs Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic Gasc
 
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetFrom Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Grunt
 
20151117 IoT를 위한 서비스 구성과 개발
20151117 IoT를 위한 서비스 구성과 개발20151117 IoT를 위한 서비스 구성과 개발
20151117 IoT를 위한 서비스 구성과 개발
 
Ondřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.czOndřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.cz
 
How to rewrite the OS using C by strong type
How to rewrite the OS using C by strong typeHow to rewrite the OS using C by strong type
How to rewrite the OS using C by strong type
 
Wonders of Golang
Wonders of GolangWonders of Golang
Wonders of Golang
 
Beachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JITBeachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JIT
 

Ähnlich wie Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)

A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftEric D. Schabell
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with DockerPatrick Mizer
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Bastian Feder
 
Continuous Integration & Development with Gitlab
Continuous Integration & Development with GitlabContinuous Integration & Development with Gitlab
Continuous Integration & Development with GitlabAyush Sharma
 
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 $$Joe Ferguson
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidenceJohn Congdon
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudSalesforce Developers
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepThe Incredible Automation Day
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshopAssaf Gannon
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
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 profitAndreas Heim
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with DockerHanoiJUG
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 

Ähnlich wie Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011) (20)

A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShift
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
Continuous Integration & Development with Gitlab
Continuous Integration & Development with GitlabContinuous Integration & Development with Gitlab
Continuous Integration & Development with Gitlab
 
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 $$
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by step
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
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
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 

Mehr von Fabrice Bernhard

Scale quality with kaizen - Tech.Rocks conference
Scale quality with kaizen - Tech.Rocks conferenceScale quality with kaizen - Tech.Rocks conference
Scale quality with kaizen - Tech.Rocks conferenceFabrice Bernhard
 
With Great Power comes Great Responsibilities
With Great Power comes Great ResponsibilitiesWith Great Power comes Great Responsibilities
With Great Power comes Great ResponsibilitiesFabrice Bernhard
 
Integrating Drupal 8 into Symfony 2
Integrating Drupal 8 into Symfony 2Integrating Drupal 8 into Symfony 2
Integrating Drupal 8 into Symfony 2Fabrice Bernhard
 
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Fabrice Bernhard
 
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012Fabrice Bernhard
 
Modernisation of legacy php to Symfony 2
Modernisation of legacy php to Symfony 2Modernisation of legacy php to Symfony 2
Modernisation of legacy php to Symfony 2Fabrice Bernhard
 

Mehr von Fabrice Bernhard (6)

Scale quality with kaizen - Tech.Rocks conference
Scale quality with kaizen - Tech.Rocks conferenceScale quality with kaizen - Tech.Rocks conference
Scale quality with kaizen - Tech.Rocks conference
 
With Great Power comes Great Responsibilities
With Great Power comes Great ResponsibilitiesWith Great Power comes Great Responsibilities
With Great Power comes Great Responsibilities
 
Integrating Drupal 8 into Symfony 2
Integrating Drupal 8 into Symfony 2Integrating Drupal 8 into Symfony 2
Integrating Drupal 8 into Symfony 2
 
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
 
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
 
Modernisation of legacy php to Symfony 2
Modernisation of legacy php to Symfony 2Modernisation of legacy php to Symfony 2
Modernisation of legacy php to Symfony 2
 

Kürzlich hochgeladen

A Costly Interruption: The Sermon On the Mount, pt. 2 - Blessed
A Costly Interruption: The Sermon On the Mount, pt. 2 - BlessedA Costly Interruption: The Sermon On the Mount, pt. 2 - Blessed
A Costly Interruption: The Sermon On the Mount, pt. 2 - BlessedVintage Church
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiAmil Baba Naveed Bangali
 
Study of the Psalms Chapter 1 verse 1 by wanderean
Study of the Psalms Chapter 1 verse 1 by wandereanStudy of the Psalms Chapter 1 verse 1 by wanderean
Study of the Psalms Chapter 1 verse 1 by wandereanmaricelcanoynuay
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiAmil Baba Naveed Bangali
 
Unity is Strength 2024 Peace Haggadah + Song List.pdf
Unity is Strength 2024 Peace Haggadah + Song List.pdfUnity is Strength 2024 Peace Haggadah + Song List.pdf
Unity is Strength 2024 Peace Haggadah + Song List.pdfRebeccaSealfon
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiAmil Baba Naveed Bangali
 
Asli amil baba in Karachi Pakistan and best astrologer Black magic specialist
Asli amil baba in Karachi Pakistan and best astrologer Black magic specialistAsli amil baba in Karachi Pakistan and best astrologer Black magic specialist
Asli amil baba in Karachi Pakistan and best astrologer Black magic specialistAmil Baba Mangal Maseeh
 
Do You Think it is a Small Matter- David’s Men.pptx
Do You Think it is a Small Matter- David’s Men.pptxDo You Think it is a Small Matter- David’s Men.pptx
Do You Think it is a Small Matter- David’s Men.pptxRick Peterson
 
The Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptx
The Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptxThe Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptx
The Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptxNetwork Bible Fellowship
 
Culture Clash_Bioethical Concerns_Slideshare Version.pptx
Culture Clash_Bioethical Concerns_Slideshare Version.pptxCulture Clash_Bioethical Concerns_Slideshare Version.pptx
Culture Clash_Bioethical Concerns_Slideshare Version.pptxStephen Palm
 
Unity is Strength 2024 Peace Haggadah_For Digital Viewing.pdf
Unity is Strength 2024 Peace Haggadah_For Digital Viewing.pdfUnity is Strength 2024 Peace Haggadah_For Digital Viewing.pdf
Unity is Strength 2024 Peace Haggadah_For Digital Viewing.pdfRebeccaSealfon
 
Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)
Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)
Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)Darul Amal Chishtia
 
Seerah un nabi Muhammad Quiz Part-1.pdf
Seerah un nabi  Muhammad Quiz Part-1.pdfSeerah un nabi  Muhammad Quiz Part-1.pdf
Seerah un nabi Muhammad Quiz Part-1.pdfAnsariB1
 
Understanding Jainism Beliefs and Information.pptx
Understanding Jainism Beliefs and Information.pptxUnderstanding Jainism Beliefs and Information.pptx
Understanding Jainism Beliefs and Information.pptxjainismworldseo
 
Dubai Call Girls Skinny Mandy O525547819 Call Girls Dubai
Dubai Call Girls Skinny Mandy O525547819 Call Girls DubaiDubai Call Girls Skinny Mandy O525547819 Call Girls Dubai
Dubai Call Girls Skinny Mandy O525547819 Call Girls Dubaikojalkojal131
 
black magic specialist amil baba pakistan no 1 Black magic contact number rea...
black magic specialist amil baba pakistan no 1 Black magic contact number rea...black magic specialist amil baba pakistan no 1 Black magic contact number rea...
black magic specialist amil baba pakistan no 1 Black magic contact number rea...Amil Baba Mangal Maseeh
 
Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...
Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...
Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...baharayali
 

Kürzlich hochgeladen (20)

young Call girls in Dwarka sector 3🔝 9953056974 🔝 Delhi escort Service
young Call girls in Dwarka sector 3🔝 9953056974 🔝 Delhi escort Serviceyoung Call girls in Dwarka sector 3🔝 9953056974 🔝 Delhi escort Service
young Call girls in Dwarka sector 3🔝 9953056974 🔝 Delhi escort Service
 
A Costly Interruption: The Sermon On the Mount, pt. 2 - Blessed
A Costly Interruption: The Sermon On the Mount, pt. 2 - BlessedA Costly Interruption: The Sermon On the Mount, pt. 2 - Blessed
A Costly Interruption: The Sermon On the Mount, pt. 2 - Blessed
 
young Whatsapp Call Girls in Adarsh Nagar🔝 9953056974 🔝 escort service
young Whatsapp Call Girls in Adarsh Nagar🔝 9953056974 🔝 escort serviceyoung Whatsapp Call Girls in Adarsh Nagar🔝 9953056974 🔝 escort service
young Whatsapp Call Girls in Adarsh Nagar🔝 9953056974 🔝 escort service
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
 
Study of the Psalms Chapter 1 verse 1 by wanderean
Study of the Psalms Chapter 1 verse 1 by wandereanStudy of the Psalms Chapter 1 verse 1 by wanderean
Study of the Psalms Chapter 1 verse 1 by wanderean
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
 
Unity is Strength 2024 Peace Haggadah + Song List.pdf
Unity is Strength 2024 Peace Haggadah + Song List.pdfUnity is Strength 2024 Peace Haggadah + Song List.pdf
Unity is Strength 2024 Peace Haggadah + Song List.pdf
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
 
Asli amil baba in Karachi Pakistan and best astrologer Black magic specialist
Asli amil baba in Karachi Pakistan and best astrologer Black magic specialistAsli amil baba in Karachi Pakistan and best astrologer Black magic specialist
Asli amil baba in Karachi Pakistan and best astrologer Black magic specialist
 
Do You Think it is a Small Matter- David’s Men.pptx
Do You Think it is a Small Matter- David’s Men.pptxDo You Think it is a Small Matter- David’s Men.pptx
Do You Think it is a Small Matter- David’s Men.pptx
 
The Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptx
The Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptxThe Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptx
The Chronological Life of Christ part 097 (Reality Check Luke 13 1-9).pptx
 
Culture Clash_Bioethical Concerns_Slideshare Version.pptx
Culture Clash_Bioethical Concerns_Slideshare Version.pptxCulture Clash_Bioethical Concerns_Slideshare Version.pptx
Culture Clash_Bioethical Concerns_Slideshare Version.pptx
 
Unity is Strength 2024 Peace Haggadah_For Digital Viewing.pdf
Unity is Strength 2024 Peace Haggadah_For Digital Viewing.pdfUnity is Strength 2024 Peace Haggadah_For Digital Viewing.pdf
Unity is Strength 2024 Peace Haggadah_For Digital Viewing.pdf
 
Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)
Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)
Monthly Khazina-e-Ruhaniyaat April’2024 (Vol.14, Issue 12)
 
Seerah un nabi Muhammad Quiz Part-1.pdf
Seerah un nabi  Muhammad Quiz Part-1.pdfSeerah un nabi  Muhammad Quiz Part-1.pdf
Seerah un nabi Muhammad Quiz Part-1.pdf
 
Top 8 Krishna Bhajan Lyrics in English.pdf
Top 8 Krishna Bhajan Lyrics in English.pdfTop 8 Krishna Bhajan Lyrics in English.pdf
Top 8 Krishna Bhajan Lyrics in English.pdf
 
Understanding Jainism Beliefs and Information.pptx
Understanding Jainism Beliefs and Information.pptxUnderstanding Jainism Beliefs and Information.pptx
Understanding Jainism Beliefs and Information.pptx
 
Dubai Call Girls Skinny Mandy O525547819 Call Girls Dubai
Dubai Call Girls Skinny Mandy O525547819 Call Girls DubaiDubai Call Girls Skinny Mandy O525547819 Call Girls Dubai
Dubai Call Girls Skinny Mandy O525547819 Call Girls Dubai
 
black magic specialist amil baba pakistan no 1 Black magic contact number rea...
black magic specialist amil baba pakistan no 1 Black magic contact number rea...black magic specialist amil baba pakistan no 1 Black magic contact number rea...
black magic specialist amil baba pakistan no 1 Black magic contact number rea...
 
Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...
Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...
Topmost Kala ilam expert in UK Or Black magic specialist in UK Or Black magic...
 

Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)

  • 1. Adopt Devops philosophy on your Symfony projects An introduction to Devops by Fabrice Bernhard
  • 4. Co-founder / CTO of Theodo and Allomatch.com
  • 5. Theodo creates web-based applications with open-source web technologies, agile methodologies and the highest standards of quality to guarantee rapid application development, risk-free deployment and easy maintenance for every client.
  • 6. @skoop: Now, let's look for a bar in Paris where I could watch the FC Utrecht match :)
  • 7. Allomatch.com is the website for watching sports in bars in France and Spain (sportandbar.es) Allomatch is used by 500 barmen (clients) and visited by more than 200,000 unique visitors per month Peaks on the biggest days can go up to 20,000 people in the 2 hours preceding the game Allomatch.com is hosted on a cluster of 6 servers
  • 8. What is DevOps? Introduction
  • 9. How many here consider themselves SysAdmins?
  • 10. How many here have never deployed an application on a server?
  • 11. Wikipedia Definition of DevOps DevOps is a set of processes, methods and systems for communication, collaboration and integration between departments for Development (Applications/Software Engineering), Technology Operations and Quality Assurance (QA). It relates to the emerging understanding of the interdependence of development and operations in meeting a business' goal to producing timely software products and services
  • 12. The fundamental DevOps contradiction Devs VS Ops Developers are asked to deliver new value, often and fast Operations people are asked to protect the current value Pro-Change VS Pro-Stability
  • 13. Silos
  • 16. DevOps create the infrastructure that empower devs from the first line of code to the delivery How to be DevOps? Configuration management for rapid, repeatable server setup Deployment scripts to abstract sysadmin tasks and empower developers Development VMs with prod configuration to ensure consistency and avoid unexpected system-related bugs Continuous deployment to make it fast!
  • 17. DevOps is spreading agility to the whole IT project lifecycle
  • 18. Rapid and repeatable server setup Configuration management with Puppet
  • 19. What is configuration management? Writing the system configuration of your servers in files Applying these files automatically That's it!
  • 20. Why do configuration management? To do fast cluster deployment: who wants to manually setup 50 EC2 servers??? To do fast crash-recovery: configuration management is the best documentation for a server's setup To have consistent environments for development and production
  • 21. Puppet or Chef Configuration management tools Two popular recent tools for configuration management: Puppet and Chef A master server contains different "recipes" describing system configurations Client servers connect to the master server, read their recipe, and apply the configuration
  • 24. Let us create a Symfony-ready server with Puppet Introduction to Puppet manifests
  • 25. class lighttpd { package { "apache2.2-bin": ensure => absent, } package { "lighttpd": ensure => present, } service { "lighttpd": ensure => running, require => Package["lighttpd", "apache2.2-bin"], } }
  • 26. class lighttpd-phpmysql-fastcgi inherits lighttpd { package { "php5-cgi": ensure => present, } package { "mysql-server": ensure => present, } exec { "lighttpd-enable-mod fastcgi": path => "/usr/bin:/usr/sbin:/bin", creates => "/etc/lighttpd/conf-enabled/10-fastcgi.conf", require => Package["php5-cgi", "lighttpd"], } }
  • 27. class symfony-server inherits lighttpd-phpmysql-fastcgi { package { ["php5-cli", "php5-sqlite"]: ensure => present, notify => Service["lighttpd"], } package { "git-core": ensure => present, } exec { "git clone git://github.com/symfony/symfony1.git": path => "/usr/bin:/usr/sbin:/bin", cwd => "/var/www", creates => "/var/www/symfony1", require => Package["lighttpd", "git-core"], } }
  • 28. class symfony-live-server inherits symfony-server { file { "/etc/lighttpd/conf-available/99-hosts.conf": source => "/vagrant/files/conf/hosts.conf", notify => Service["lighttpd"], } exec { "lighttpd-enable-mod hosts": path => "/usr/bin:/usr/sbin:/bin", creates => "/etc/lighttpd/conf-enabled/99-hosts.conf", require => File["/etc/lighttpd/conf-available/99-hosts.conf"], notify => Service["lighttpd"], } } include symfony-live-server notice("Symfony server is going live!")
  • 29. Why not use shell scripts? Shell scripts are for administrators. Is all your team composed of admin experts? Even for admin experts, Puppet and Chef recipes are more readable Puppet and Chef make inheritance and modules easy Puppet and Chef are idempotent: running them twice in a row will not break your system
  • 30. Develop and test on the same environment as in production! VM provisioning with Vagrant
  • 31. Develop on local Virtual Machines Vagrant Vagrant is a tool to create local VirtualBox VMs, configured automatically by your Chef recipe or Puppet manifest It ensures you test on the same environment as your production server It is VERY easy
  • 32. All you need is: Vagrant A Puppet manifest A few system config files A Vagrant conf file
  • 33. Demonstration Vagrant $ git clone git://github.com/fabriceb/sflive2011vm.git . $ git clone git://github.com/fabriceb/sflive2011.git $ vagrant up http://127.0.0.1:2011/
  • 34. Give developers the power to deploy themselves Scripted deployment
  • 35. Deployment Deployment is a very critical task usually done by admins Remember Murphy's law: "If anything can go wrong, it will" W hen things go wrong, most of the time developers have the solution So give the developers the responsibility to deploy, rollback, correct and deploy again!
  • 36. Scripting deployment can be VERY easy Simple Fabric script example # fabfile.py from fabric.api import * env.hosts = ['theodo@myserver.com'] def deploy(): with cd('/theodo/sflive2011'): run('git pull') run('./symfony doc:build --all --no-confirmation') run('./symfony cc') $ fab deploy
  • 37. A good practise: scripting a rollback Another Fabric example # fabfile.py def deploy(): tag = "prod/%s" % strftime("%Y/%m-%d-%H-%M-%S") local('git tag -a %s -m "Prod"' % tag) local('git push --tags') with cd(path): run('git fetch') tag = run('git tag -l prod/* | sort | tail -n1') run('git checkout ' + tag) def rollback(num_revs=1): with cd(path): run('git fetch') tag = run('git tag -l prod/* | sort | tail -n' + str(1 + int(num_revs)) + ' | head -n1') run('git checkout ' + tag)
  • 38. And why not let Jenkins deploy himself? Continuous deployment
  • 39. The Holy Grail of Rapid App Development & Deployment: Automate everything low value-added and relax
  • 40. Isn't it dangerous to trust a machine? Errare humanum est Of course you need continuous integration with MANY tests Of course you need some serious monitoring on the production server Of course you need some good rollback scripts But aren't that good things to do anyway ? Good continuous integration is more reliable than a human!
  • 41. You need to separate dev, pre-prod and prod... Continuous deployment howto For example with git: features/* branches for small projects dev branch for merging team development master branch for production-ready code prod/* tags for production
  • 42. And you need a deployment script + Jenkins Continuous deployment howto Deployment script using Fabric (for example) Jenkins (formerly known as Hudson) to test and deploy
  • 43. Create a new Jenkins project testing only branch master
  • 44. Specify "Build other projects" in the post-build actions
  • 45. Don't forget to activate Chuck Norris
  • 46. Create a second Jenkins project to execute the deploy script
  • 50. DevOps meetups groups.google.com/group/paris-devops and many more devops meetups around the world
  • 51. Many thanks to Samuel @smaftoul Maftoul, organiser of the Paris DevOps meetup, who bootstrapped me on DevOps!
  • 52. Questions? @theodo fabriceb@theodo.fr