Devops for PHP Developers

A1de24f8a9fe6742162f298032b56922?s=47 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.

A1de24f8a9fe6742162f298032b56922?s=128

Jeremy Quinton

September 29, 2017
Tweet

Transcript

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


    Jeremy Quinton twitter - @jeremyquinton
  2. • Software Developer • Devops Evangelist • Co-organiser of Cape

    Town PHP Meetup • Sometimes Conference speaker About - Jeremy Quinton Startup
  3. None
  4. Moving fast at Scale

  5. None
  6. The DEVOPS Reports from 2011 - 2017 Large and comprehensive

    DEVOPS surveys and studies https://www.flickr.com/photos/80497449@N04/10012162166
  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.
  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
  9. DEVOPS Confusion

  10. DEVOPS Confusion

  11. Devops is not • A specific tool chain. • The

    job of one person. • Miracle solution for all your organisations problems.
  12. CAMS Definition • Culture • Automation • Measurement • Sharing

  13. Ideology The set of ideas and beliefs of a group…

    http://www.merriam-webster.com/dictionary/ideology
  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)
  15. Edgar Shein - Company Culture • Group of people working

    in a company will form a different culture from societal culture.
  16. None
  17. Devops is as much about culture as it is about

    tools and culture is all about people.
  18. Devops: Breaking down the silos https://www.flickr.com/photos/docsearls/5500714140

  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
  20. Culture - Pathological - Power-oriented

  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
  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.
  23. Bureaucratic Rule-oriented

  24. Bureaucratic Rule-oriented • Reliance on process • Centralised decision-making •

    Relatively predictable results • Employees don’t feel empowered and become frustrated
  25. Culture - Generative - Performance-oriented https://www.flickr.com/photos/gfreeman23/8732672635

  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.
  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
  28. Automation • Automating the process of software delivery and infrastructure

    changes.
  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.
  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.
  31. Continuous Delivery Read this Book

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

  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.
  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
  35. Deployment pipeline Delivery Team Version Control Check in Feedback Build

    & unit tests Trigger Automated Acceptance Tests Trigger Feedback Release Approval
  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/
  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
  38. Deploying more frequently reduces risk Continuous Delivery

  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.”
  40. Devops for developers - Michael Heuttermann Available functionality Time Big

    releases Small releases 20 features in one
  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
  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
  43. Deployment becomes a non event

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

  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
  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
  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.
  48. Agile Development Team Waterfall Operations Team Increasing collaboration between dev

    and ops Scrumfall
  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”
  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
  51. Chef Puppet Ansible Salt Configuration management tools (Infrastructure as code)

    Amazon Rackspace Digital Ocean Azure Cloud providers Practices - configuration management tools
  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.
  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
  54. Practices - configuration management tools Traceability https://continuousdelivery.com/foundations/configuration-management Disaster recovery Benefits

    Capacity management Response to defectives Goals Reproducibility
  55. Measurement

  56. Monitoring • If you are releasing often you want fast

    feedback. • Adding monitoring to the definition of done for new software features.
  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.
  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
  59. Sharing with operations https://www.flickr.com/photos/clappstar/2773208127 Sharing

  60. Sharing - Pain • Developers take more ownership and responsibility

    for their code. • Developers on call for production issues.
  61. Blameless post mortems Blameless Post Mortems

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

  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.
  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
  65. Patrick Debois https://twitter.com/patrickdebois/status/539073067738468352

  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/
  67. Questions? https://joind.in/talk/85c8e