$30 off During Our Annual Pro Sale. View Details »

Devops for PHP Developers

Jeremy Quinton
September 29, 2017

Devops for PHP Developers

To paraphrase a quote from http://devopsdays.org/ “Back then we didn't know we were going to change the IT industry. Devops has gone from an underground, to a wide mainstream industry adopted idea.” Devops is a term many PHP Developers will have heard but its not always clearly understood and often misinterpreted. In an industry that changes so rapidly it's important for developers to grasp and understand the core concepts of what Devops is about so that you can take your organisation or development team forward. My talk will dispel some myths, cover fundamental ideas,concepts and tools you can embrace mainly from a developers perspective. The main goal is to educate PHP Developers around exactly what Devops is and what benefits it brings to Development teams. I will break down the four main pillars of Devops and explain the core concepts within each of these over arching pillars.

Jeremy Quinton

September 29, 2017
Tweet

More Decks by Jeremy Quinton

Other Decks in Technology

Transcript

  1. DEVOPS FOR PHP DEVELOPERS
    PHP Conference Cape Town September 2017

    Jeremy Quinton
    twitter - @jeremyquinton

    View Slide

  2. • Software Developer
    • Devops Evangelist
    • Co-organiser of Cape Town PHP Meetup
    • Sometimes Conference speaker
    About - Jeremy Quinton
    Startup

    View Slide

  3. View Slide

  4. Moving fast at Scale

    View Slide

  5. View Slide

  6. The DEVOPS Reports from 2011 - 2017
    Large and comprehensive DEVOPS surveys and studies
    https://www.flickr.com/photos/80497449@N04/10012162166

    View Slide

  7. Key Findings
    - http://puppetlabs.com/sites/default/files/2014-state-of-devops-report.pdf
    • Strong IT performance is a competitive advantage.
    • Strong correlation between DEVOPS practices and IT performance.

    View Slide

  8. http://en.wikipedia.org/wiki/Gene_Kim
    http://en.wikipedia.org/wiki/Gene_Kim#mediaviewer/File:Gene_Kim.jpg
    Gene Kim
    “The best just keep getting
    better and accelerating
    away from the herd.”
    Co-Author of the Phoenix project
    A Novel About IT, DevOps, and Helping Your Business Win

    View Slide

  9. DEVOPS Confusion

    View Slide

  10. DEVOPS Confusion

    View Slide

  11. Devops is not
    • A specific tool chain.
    • The job of one person.
    • Miracle solution for all your organisations problems.

    View Slide

  12. CAMS Definition
    • Culture
    • Automation
    • Measurement
    • Sharing

    View Slide

  13. Ideology
    The set of ideas and beliefs of a group…
    http://www.merriam-webster.com/dictionary/ideology

    View Slide

  14. Ideas or set of Ideals
    (New and Old)
    Which has lead to a
    common set of practices
    and patterns
    DEVOPS (at a high level)

    View Slide

  15. Edgar Shein - Company Culture
    • Group of people working
    in a company will form a
    different culture from
    societal culture.

    View Slide

  16. View Slide

  17. Devops is as much about culture as it is about
    tools and culture is all about people.

    View Slide

  18. Devops: Breaking down the silos
    https://www.flickr.com/photos/docsearls/5500714140

    View Slide

  19. Development
    Developers
    QA
    Testers
    Operations
    Sys Admins
    Network
    Engineers
    DBA
    Development teams strive for change Operations teams strive for stability
    misalignment leads to
    The core, chronic conflict
    Measured on things like features Measured on things like uptime
    Silo 1 Silo 2

    View Slide

  20. Culture - Pathological - Power-oriented

    View Slide

  21. Pathological - Power-oriented culture
    • Them vs us culture
    • Finger pointing
    • Code often does meet customer requirements
    • Constant firefighting
    The Westrum organizational typology model: how organizations process information (Source: Ron Westrum, “A typology of organisation culture,” BMJ Quality & Safety
    13, no. 2 (2004), d

    View Slide

  22. Devops tries to address pathological culture
    • DEVOPS movement addresses the dysfunction that
    results from organisations composed of functional silos.
    • DEVOPS proposes shared responsibilities and incentives
    across teams.
    • Ideally no isolated silos exist in the software delivery process.

    View Slide

  23. Bureaucratic Rule-oriented

    View Slide

  24. Bureaucratic Rule-oriented
    • Reliance on process
    • Centralised decision-making
    • Relatively predictable results
    • Employees don’t feel empowered and become frustrated

    View Slide

  25. Culture - Generative - Performance-oriented
    https://www.flickr.com/photos/gfreeman23/8732672635

    View Slide

  26. Generative culture - performance orientated
    • High Co-operation between dev and operations.
    • Failure leads to enquiry.
    • The flow of information and feedback is fast because 

    its built into the system.
    • Improvements and experiments are encouraged.
    • Open communication, Trust and Respect.

    View Slide

  27. DEVOPS identifies that organisational culture is important
    and that this culture is crucial to whether or not DEVOPS will
    succeed within any given organisation.
    Culture - Takeaway

    View Slide

  28. Automation
    • Automating the process of software delivery and infrastructure changes.

    View Slide

  29. Cycle Time
    • How long does it take you to go from code committed to
    getting that code running in production?
    • Asked in another way if you had a critical bug fix and it was
    one line of code how long does it take you to get that to
    production.

    View Slide

  30. Some problems dev and ops teams face
    • Cycle time is measured in weeks or months.
    release
    • Problems with deployment.
    • Various bottle necks.
    Key goals of DEVOPS is to increase flow, reduce cycle time,

    shorten the feedback loop.

    View Slide

  31. Continuous Delivery
    Read this Book

    View Slide

  32. Continuous Delivery
    http://en.wikipedia.org/wiki/Continuous_delivery

    View Slide

  33. Key Goals of Continuous Delivery
    • Software is always in a releasable state throughout its lifecycle.
    • The only way to categorically prove software is production ready is to
    deploy it production.

    View Slide

  34. Continuous Integration
    • Create quality at the source - helps build trust
    • Fix broken builds immediately - don’t block other developers
    • Keep your builds fast - get feedback sooner

    View Slide

  35. Deployment pipeline
    Delivery Team Version Control
    Check in
    Feedback
    Build & unit tests
    Trigger
    Automated
    Acceptance Tests
    Trigger
    Feedback
    Release
    Approval

    View Slide

  36. Tools to build deployment pipelines
    Travis CI
    Jenkins
    Testing tools
    PHPunit
    phpspec
    Behat BAMBOO
    Code Standard Quality Tools
    Continous Integration Servers
    Phing
    Build Tools
    PHP CodeSniffer - https://github.com/squizlabs/PHP_CodeSniffer
    PHP Mess detector http://phpmd.org/
    PHPLoc - https://github.com/sebastianbergmann/phploc
    PHPCI
    Codeception
    PHP Documentor -http://www.phpdoc.org/

    View Slide

  37. • Collaboration
    • Feedback
    • Teams can deploy and release any version of their software to
    any environment at will through a fully automated process.
    Key benefits of Deployment pipeline
    - Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation by Jez Humble and David Farley
    • Quality

    View Slide

  38. Deploying more frequently reduces risk
    Continuous Delivery

    View Slide

  39. DEVOPS Report
    https://www.ciosummits.com/Online_Assets_Puppet_2016_State_of_DevOps_Report.pdf
    2016 -
    “High performers deploy 200 times more frequently than
    low performers, with 2,555 times faster lead times.”

    View Slide

  40. Devops for developers - Michael Heuttermann
    Available functionality
    Time
    Big releases
    Small releases
    20 features in one

    View Slide

  41. Deploying more frequently
    • Smaller changes make it easier to identify problems
    • Risk of deployment is reduced
    • The process of fixing problems becomes optimised
    Devops for developers - Michael Heuttermann

    View Slide

  42. Automated Deployments
    Think of deployment as a two step process
    • Select environment where we want our software to go.
    • Push a button to release the software to that environment.
    Tools
    Capistrano
    Rocketeer
    Deployer
    - Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation by Jez Humble and David Farley
    Containers


    kubernetes

    View Slide

  43. Deployment becomes a non event

    View Slide

  44. Automated Acceptance Testing
    https://www.flickr.com/photos/wynandvanpoortvliet/3562677155

    View Slide

  45. Automated acceptance testing
    “Automated testing turns fear into boredom” - Eran messeri google.
    • Automated acceptance testing of functional and non functional
    requirements.
    • RSpec tests for your servers configured by Puppet, Chef or
    anything else.
    https://github.com/serverspec/serverspec

    View Slide

  46. Automation summary
    • Reduce cycle time
    • Reducing cycle time is done with Continuous Delivery
    • With a deployment pipeline we are using CI, automated testing 

    and deployments
    • To practice continuous delivery need Deployment pipeline

    View Slide

  47. Increasing collaboration between dev and ops
    “What is remarkable is that even though agile actively seeks
    collaboration from all its stakeholders, most agile projects did
    not extend themselves toward the operations people.”
    - Patrick Debois.

    View Slide

  48. Agile Development Team Waterfall Operations Team
    Increasing collaboration between dev and ops
    Scrumfall

    View Slide

  49. Change your definition of done
    “At the end of each sprint, we must have working and shippable code…”
    “demonstrated in an environment that resembles production”

    View Slide

  50. Developer Mindset
    • How are we going to deploy our code?
    • How are we going to monitor the application in a production environment?
    • Is this code going to work in a multi node environment? 

    e.g. sessions, caching etc
    • Software is a thing that exists after it has been written

    View Slide

  51. Chef
    Puppet
    Ansible
    Salt
    Configuration management tools (Infrastructure as code)
    Amazon
    Rackspace
    Digital Ocean
    Azure
    Cloud providers
    Practices - configuration management tools

    View Slide

  52. Packer is a tool for creating identical machine images for multiple platforms from a
    single source configuration.
    Packer https://www.packer.io
    • Create a common dev, qa, production environment creation process.
    Practices
    • Make environments (dev, staging, production) available early in the 

    development process.

    View Slide

  53. Practices
    Development environments made easy. An open platform for distributed applications
    for developers and sysadmins.
    OR
    • Keep dev environments as similar to our productions environments as possible

    View Slide

  54. Practices - configuration management tools
    Traceability
    https://continuousdelivery.com/foundations/configuration-management
    Disaster recovery
    Benefits
    Capacity management
    Response to defectives
    Goals
    Reproducibility

    View Slide

  55. Measurement

    View Slide

  56. Monitoring
    • If you are releasing often you want fast feedback.
    • Adding monitoring to the definition of done for new software features.

    View Slide

  57. Measurement
    • You can’t improve what you can’t measure.
    • Measurements are shared not only between developers and ops people 

    but with the entire organisation.

    View Slide

  58. Tools
    Statsd
    ElasticSearch + Logstash + Kibana
    Log files from production
    - Measurement and monitoring
    Collectd
    Graphite
    Grafana
    Cacti
    Monitoring and Altering
    Nagios Sensu
    Ganglia
    Sentry
    Graylog
    Application Metrics
    Splunk

    View Slide

  59. Sharing with operations
    https://www.flickr.com/photos/clappstar/2773208127
    Sharing

    View Slide

  60. Sharing - Pain
    • Developers take more ownership and responsibility for their code.
    • Developers on call for production issues.

    View Slide

  61. Blameless post mortems
    Blameless Post Mortems

    View Slide

  62. Everything is in source control
    https://twitter.com/jclermont/status/557202948703666177

    View Slide

  63. • Code and scripts for building the application.
    Things that should be in version control for your application
    • Code and scripts for testing the application.
    • Code and scripts for deploying the application.
    • Code and scripts for building environments for the application.

    View Slide

  64. Summary
    • Why we need DEVOPS
    • Breaking down Silos
    • Organisational culture
    • Increasing Collaboration between Developers and Operations
    • Cycle Time and Continuous Delivery
    • Measurement and monitoring
    • Sharing

    View Slide

  65. Patrick Debois
    https://twitter.com/patrickdebois/status/539073067738468352

    View Slide

  66. Good DEVOPS Resources
    https://leanpub.com/buildqualityin
    Attend a DEVOPS day conference http://www.devopsdays.org/
    http://foodfightshow.org/
    Podcasts
    http://devopscafe.org/
    http://amzn.to/1vD8gUi http://amzn.to/1zMaAc7 http://amzn.to/1AiZMpy
    http://amzn.to/1brnEZI
    https://continuousdelivery.com/

    View Slide

  67. Questions?
    https://joind.in/talk/85c8e

    View Slide