http://shipitsquirrel.github.com/
Monday, 30 April 12
DevOps &
InfrastructureAs Code
Gavin Heavyside - ACCU 2012 - 27 April [email protected] @gavinheavyside
Monday, 30 April 12
Getting SoftwareInto Production
• Deliver value to customers
• New features
• Bug fixes
Monday, 30 April 12
Software Releases
• QA cycle
• Downtime during deploy
• Out-of-hours
• Stress
• Risk
Monday, 30 April 12
“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
Agile Infrastructure
• New technologies iterate fast
• Changing platform requirements
• Cutting-edge vs tried-and-tested
Monday, 30 April 12
Monday, 30 April 12
Monday, 30 April 12
Monday, 30 April 12
• www.mydrivesolutions.com
• Insurance telematics
• Linux, chef, GIS, Ruby, Rails, SQL, NoSQL, AWS, C++
Monday, 30 April 12
Monday, 30 April 12
DevOps
• Name invented around 2009
• DevOps Days around the world
• Making releases easier through collaboration and automation
Monday, 30 April 12
Development
• Driven by functional requirements
• Business needs
• Features
• Working on desktop OS
• Local configuration & settings
Monday, 30 April 12
Operations
• Driven by non-functional requirements
• Stability
• Performance
• Monitoring & Alerting
• Minimising operational risk
Monday, 30 April 12
Monday, 30 April 12
Monday, 30 April 12
Infrastructure As Code
• Repeatability
• Automation
• Agility
• Scalability
• Reassurance
• Disaster Recovery
Monday, 30 April 12
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
Key Principles
• Modularity
• Cooperation
• Composability
• Extensibility
• Flexibility
Monday, 30 April 12
Key Principles
• Repeatability
• Declaration
• Abstraction
• Idempotence
• Convergence
Monday, 30 April 12
Chef vs PuppetA Battle To The Death?
Monday, 30 April 12
Chef
• Open-Source Configuration Management
• Developed by Opscode
• Solo, Server, Hosted
Monday, 30 April 12
Chef
• Scriptable, repeatable systems
• Write cookbooks containing recipes
• resources, attributes, data bags
Monday, 30 April 12
Cookbooks & Recipes
• Cookbooks are the canonical unit of distribution & sharing in Chef
• Cookbooks contain
• Recipes
• Attributes
• Templates & Files
Monday, 30 April 12
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
Roles
• Roles contain other roles and recipes
• Define what you want your node to be
Monday, 30 April 12
Monday, 30 April 12
Data Bags
Monday, 30 April 12
Using a Data Bag
Monday, 30 April 12
Chef Server
Monday, 30 April 12
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
Keeping nodesup to date
• Run chef-client as a service
• Updated a cookbook?
• Applied to all nodes automatically
Monday, 30 April 12
Test-Driving Infrastructure
• http://www.cucumber-chef.org/
• https://github.com/Atalanta/cucumber-chef
Monday, 30 April 12
Monday, 30 April 12
Monday, 30 April 12
Monday, 30 April 12
Vagrant
• http://vagrantup.com
• Lightweight, reproducible, portable VMs
• Configure with Puppet, Chef & others
• Package boxes for others to use
Monday, 30 April 12
Live Demo
Monday, 30 April 12
Monday, 30 April 12
NoOps
• PaaS
• Heroku, Elastic Beanstalk, etc
Monday, 30 April 12
Monitoring & Alerting
• Nagios, greylog2 etc
• Hosted options
• #monitoringsucks
Monday, 30 April 12
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
Metrics
• Statsd, Graphite
Monday, 30 April 12
Monday, 30 April 12
Communicate
Monday, 30 April 12
Communicate
Monday, 30 April 12
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
Configuration
• The configuration of an environment is as important as the code
• Settings, values, ordering
Monday, 30 April 12
Database Schemas
• Make your db migrations non-destructive
• Update the schema before deploying code
Monday, 30 April 12
• https://github.com/mydrive/capistrano-deploytags
• https://github.com/mydrive/capistrano-detect-migrations
Monday, 30 April 12
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
Top Related