DevOps at ACCU 2012

52
http://shipitsquirrel.github.com/ Monday, 30 April 12

description

Slides from "DevOps and Infrastructure-As-Code" at ACCU 2012 (25-28 April 2012, Oxford).

Transcript of DevOps at ACCU 2012

Page 1: DevOps at ACCU 2012

http://shipitsquirrel.github.com/

Monday, 30 April 12

Page 2: DevOps at ACCU 2012

DevOps &

InfrastructureAs Code

Gavin Heavyside - ACCU 2012 - 27 April [email protected] @gavinheavyside

Monday, 30 April 12

Page 3: DevOps at ACCU 2012

Getting SoftwareInto Production

• Deliver value to customers

• New features

• Bug fixes

Monday, 30 April 12

Page 4: DevOps at ACCU 2012

Software Releases

• QA cycle

• Downtime during deploy

• Out-of-hours

• Stress

• Risk

Monday, 30 April 12

Page 5: DevOps at ACCU 2012

“The Cloud”

• Virtualisation & Cloud IaaS lowered cost of entry for businesses

• No hardware, but still sysadmin tasks

• Small companies get big company issues

Monday, 30 April 12

Page 6: DevOps at ACCU 2012

Agile Infrastructure

• New technologies iterate fast

• Changing platform requirements

• Cutting-edge vs tried-and-tested

Monday, 30 April 12

Page 7: DevOps at ACCU 2012

Monday, 30 April 12

Page 8: DevOps at ACCU 2012

Monday, 30 April 12

Page 9: DevOps at ACCU 2012

Monday, 30 April 12

Page 10: DevOps at ACCU 2012

• www.mydrivesolutions.com

• Insurance telematics

• Linux, chef, GIS, Ruby, Rails, SQL, NoSQL, AWS, C++

Monday, 30 April 12

Page 11: DevOps at ACCU 2012

Monday, 30 April 12

Page 12: DevOps at ACCU 2012

DevOps

• Name invented around 2009

• DevOps Days around the world

• Making releases easier through collaboration and automation

Monday, 30 April 12

Page 13: DevOps at ACCU 2012

Development

• Driven by functional requirements

• Business needs

• Features

• Working on desktop OS

• Local configuration & settings

Monday, 30 April 12

Page 14: DevOps at ACCU 2012

Operations

• Driven by non-functional requirements

• Stability

• Performance

• Monitoring & Alerting

• Minimising operational risk

Monday, 30 April 12

Page 15: DevOps at ACCU 2012

Monday, 30 April 12

Page 16: DevOps at ACCU 2012

Monday, 30 April 12

Page 17: DevOps at ACCU 2012

Infrastructure As Code

• Repeatability

• Automation

• Agility

• Scalability

• Reassurance

• Disaster Recovery

Monday, 30 April 12

Page 18: DevOps at ACCU 2012

Infrastructure As Code

• “Break the infrastructure down into independent, reusable, network-accessible services.

Integrate these services in such a way as to produce the functionality your infrastructure requires” - Adam Jacob

Monday, 30 April 12

Page 19: DevOps at ACCU 2012

Key Principles

• Modularity

• Cooperation

• Composability

• Extensibility

• Flexibility

Monday, 30 April 12

Page 20: DevOps at ACCU 2012

Key Principles

• Repeatability

• Declaration

• Abstraction

• Idempotence

• Convergence

Monday, 30 April 12

Page 21: DevOps at ACCU 2012

Chef vs PuppetA Battle To The Death?

Monday, 30 April 12

Page 22: DevOps at ACCU 2012

Chef

• Open-Source Configuration Management

• Developed by Opscode

• Solo, Server, Hosted

Monday, 30 April 12

Page 23: DevOps at ACCU 2012

Chef

• Scriptable, repeatable systems

• Write cookbooks containing recipes

• resources, attributes, data bags

Monday, 30 April 12

Page 24: DevOps at ACCU 2012

Cookbooks & Recipes

• Cookbooks are the canonical unit of distribution & sharing in Chef

• Cookbooks contain

• Recipes

• Attributes

• Templates & Files

Monday, 30 April 12

Page 25: DevOps at ACCU 2012

Attributes

• Every node has attributes

• Saved on Chef server

• Updated each chef-client run

• Cookbooks specify default attributes

• Override per-role and/or per-node

Monday, 30 April 12

Page 26: DevOps at ACCU 2012

Roles

• Roles contain other roles and recipes

• Define what you want your node to be

Monday, 30 April 12

Page 27: DevOps at ACCU 2012

Monday, 30 April 12

Page 28: DevOps at ACCU 2012

Data Bags

Monday, 30 April 12

Page 29: DevOps at ACCU 2012

Using a Data Bag

Monday, 30 April 12

Page 30: DevOps at ACCU 2012

Chef Server

Monday, 30 April 12

Page 31: DevOps at ACCU 2012

Knife

• command line tool to interact with Chef

• manage cookbooks, roles, data bags

• Search nodes

• Bootstrap nodes

• Plugins to manage cloud servers

Monday, 30 April 12

Page 32: DevOps at ACCU 2012

Keeping nodesup to date

• Run chef-client as a service

• Updated a cookbook?

• Applied to all nodes automatically

Monday, 30 April 12

Page 33: DevOps at ACCU 2012

Test-Driving Infrastructure

• http://www.cucumber-chef.org/

• https://github.com/Atalanta/cucumber-chef

Monday, 30 April 12

Page 34: DevOps at ACCU 2012

Monday, 30 April 12

Page 35: DevOps at ACCU 2012

Monday, 30 April 12

Page 36: DevOps at ACCU 2012

Monday, 30 April 12

Page 37: DevOps at ACCU 2012

Vagrant

• http://vagrantup.com

• Lightweight, reproducible, portable VMs

• Configure with Puppet, Chef & others

• Package boxes for others to use

Monday, 30 April 12

Page 38: DevOps at ACCU 2012

Live Demo

Monday, 30 April 12

Page 39: DevOps at ACCU 2012

Monday, 30 April 12

Page 40: DevOps at ACCU 2012

NoOps

• PaaS

• Heroku, Elastic Beanstalk, etc

Monday, 30 April 12

Page 41: DevOps at ACCU 2012

Monitoring & Alerting

• Nagios, greylog2 etc

• Hosted options

• #monitoringsucks

Monday, 30 April 12

Page 42: DevOps at ACCU 2012

Metrics

• “If you can’t measure it, it doesn’t exist”

• Track performance

• Critical counters

• Report against SLAs

• Identify problems & bottlenecks

Monday, 30 April 12

Page 43: DevOps at ACCU 2012

Metrics

• Statsd, Graphite

Monday, 30 April 12

Page 44: DevOps at ACCU 2012

Monday, 30 April 12

Page 45: DevOps at ACCU 2012

Communicate

Monday, 30 April 12

Page 46: DevOps at ACCU 2012

Communicate

Monday, 30 April 12

Page 47: DevOps at ACCU 2012

Zero-Downtime Deploys

• Deploy updated code

• Graceful restarts

• Allow existing processes/requests to complete

• New requests get processed by updated code

Monday, 30 April 12

Page 48: DevOps at ACCU 2012

Configuration

• The configuration of an environment is as important as the code

• Settings, values, ordering

Monday, 30 April 12

Page 49: DevOps at ACCU 2012

Database Schemas

• Make your db migrations non-destructive

• Update the schema before deploying code

Monday, 30 April 12

Page 51: DevOps at ACCU 2012

Recap

• Bridge the gap between dev & ops

• Put your infrastructure in source control

• De-risk deploys by doing lots of them

• Automate everything

Monday, 30 April 12