Slide 1

Slide 1 text

DEVOPS FOR PHP DEVELOPERS PHP Conference Cape Town September 2017
 Jeremy Quinton twitter - @jeremyquinton

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Moving fast at Scale

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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.

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

DEVOPS Confusion

Slide 10

Slide 10 text

DEVOPS Confusion

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

CAMS Definition • Culture • Automation • Measurement • Sharing

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

Culture - Pathological - Power-oriented

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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.

Slide 23

Slide 23 text

Bureaucratic Rule-oriented

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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.

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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.

Slide 30

Slide 30 text

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.

Slide 31

Slide 31 text

Continuous Delivery Read this Book

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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.

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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/

Slide 37

Slide 37 text

• 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

Slide 38

Slide 38 text

Deploying more frequently reduces risk Continuous Delivery

Slide 39

Slide 39 text

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.”

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

Deployment becomes a non event

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

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.

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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”

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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.

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

Measurement

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

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.

Slide 58

Slide 58 text

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

Slide 59

Slide 59 text

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

Slide 60

Slide 60 text

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

Slide 61

Slide 61 text

Blameless post mortems Blameless Post Mortems

Slide 62

Slide 62 text

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

Slide 63

Slide 63 text

• 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.

Slide 64

Slide 64 text

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

Slide 65

Slide 65 text

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

Slide 66

Slide 66 text

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/

Slide 67

Slide 67 text

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