vagrant for effective devops culture

36
Vagrant for Effective DevOps Culture Vaidik Kapoor @vaidikkapoor

Upload: vaidik-kapoor

Post on 06-Aug-2015

174 views

Category:

Engineering


5 download

TRANSCRIPT

Page 1: Vagrant for Effective DevOps Culture

Vagrant for Effective DevOps Culture

Vaidik Kapoor @vaidikkapoor

Page 2: Vagrant for Effective DevOps Culture

Me?

• I work at Wingify

• Software Engineer for first few months

• Infrastructure and Operations after that

• github.com/vaidik

• twitter.com/vaidikkapoor

Page 3: Vagrant for Effective DevOps Culture

Wingify EngineeringBack when I joined:

• ~12 people

• Two teams: backend and frontend

• Multiple services, but only a few with active development

• Random bash scripts everywhere to setup things

Page 4: Vagrant for Effective DevOps Culture

Wingify EngineeringToday:

• ~25 people

• Multiple teams: backend, frontend, JS library, mobile, operations

• Lots of overlap between teams

• Multiple services ~ very SOAish

Page 5: Vagrant for Effective DevOps Culture

Problems• Things work fine locally but not when deployed

• Things work fine in testing / staging environment but not in production

• All the services are not available locally while development is on going

• Too many services

• Too difficult to setup because everyone has a different dev environment

• Testing end-to-end was not possible for developers

• Releases take a lot of time

Page 6: Vagrant for Effective DevOps Culture

Similar Environments

Page 7: Vagrant for Effective DevOps Culture

Similar Environments

• Closer to production

• Staging should be as similar as possible

• Use similar procedures for setting up every environment

Page 8: Vagrant for Effective DevOps Culture

Configuration Management• Formalize your infrastructure

• Use same modules / recipes / playbooks / whatever everywhere

• Many out there:

• Puppet!

• Chef

• CFEngine

• Ansible

• Salt Stack

Page 9: Vagrant for Effective DevOps Culture

Problems Solved

• Issues that were caught in production started getting caught early on

• End-to-end testing was made possible

• More confident releases

• Faster releases

Page 10: Vagrant for Effective DevOps Culture

New Problems?

Page 11: Vagrant for Effective DevOps Culture

New Problems• Only Ops people writing / maintaining Puppet

code base i.e. only two guys

• Dependency and bottleneck

• Ops and devs working in isolation - details shared at a very high level

• Slow feedback, slow releases and slow resolutions

• Not scalable

Page 12: Vagrant for Effective DevOps Culture

Changes Were Required

Devs Ops OpsDevs

Shared ResponsibilityIsolation

Page 13: Vagrant for Effective DevOps Culture

How to get there?

Page 14: Vagrant for Effective DevOps Culture

For Developers

• Give developers environments for development which closely resemble production infrastructure.

• Same OS as used in production

• Possible to re-use configuration management for dev environments

Page 15: Vagrant for Effective DevOps Culture

Virtual Machines• As dev environments

• Distributable

• Re-usable

• Cheap

• Develop -> Test -> Deploy -> Destroy… Repeat!

• We did this for a while!

Page 16: Vagrant for Effective DevOps Culture

Drawbacks with VMs

• Lack of flexibility to choose your own tools, IDEs, etc.

• Was still too much manual work for setting these up - lack of tooling

• Intimidating at first

Page 17: Vagrant for Effective DevOps Culture

vagrant

Page 18: Vagrant for Effective DevOps Culture

vagrant• A super cool wrapper around:

• Virtual Machine providers (VirtualBox, VMWare, etc.)

• Docker

• Support for provisioning using configuration management tools

• Bunch of awesome tooling to make life easy

• synced folders

Page 19: Vagrant for Effective DevOps Culture

vagrant upto start a VM and provision it if not already done

Page 20: Vagrant for Effective DevOps Culture

vagrant sshto ssh into the VM

Page 21: Vagrant for Effective DevOps Culture

vagrant provisionto run your configuration management scripts again

Page 22: Vagrant for Effective DevOps Culture

vagrant destroyto throw away your VM

Page 23: Vagrant for Effective DevOps Culture

vagrant packageto package an existing VM and distribute

Page 24: Vagrant for Effective DevOps Culture

For Developers• Give developers environments for development which

closely resemble production infrastructure.

• Same OS as used in production

• Possible to re-use configuration management for dev environments

• synced folders make it possible for you to use the tools you love

• Vagrant’s tooling makes management of dev environment really simple

Page 25: Vagrant for Effective DevOps Culture

For Ops?

Page 26: Vagrant for Effective DevOps Culture

For Ops

• Use vagrant for testing out configuration management setup

• From small modules to complete scripts

• Faster feedback loop between developers and operations

Page 27: Vagrant for Effective DevOps Culture

Devs and Ops Together• Ops get control of tooling for infrastructure and

managing configuration

• Ops’ work gets tested out first in dev environments

• Developers get a closer and more up-to-date replica of production systems

• End-to-end testing is possible because all or most important services are setup using configuration management

Page 28: Vagrant for Effective DevOps Culture

Devs and Ops Together• Tighter feedback loop between devs and ops

• Reasons of failures can be pin pointed faster

• Resolutions can be made faster

• Helps with better testing of applications - what works locally has higher chances of working everywhere

• Helps with better testing of configuration management - strives for a more modular formalization of infrastructure

Page 29: Vagrant for Effective DevOps Culture

More Stability

Page 30: Vagrant for Effective DevOps Culture

New Possibilities?

• For developers to actually know how things work in production

• Slowly have developers own parts of configuration management

• Start giving developers a share of responsibility to handle infrastructure

Page 31: Vagrant for Effective DevOps Culture

Did I mention Multi-Machine?

Page 32: Vagrant for Effective DevOps Culture

Vagrant Multi-Machine• Capable of setting up multiple machines in a cluster

and controlling them.

!

$ vagrant up webserver

$ vagrant ssh dbserver

!

Page 33: Vagrant for Effective DevOps Culture

Vagrant Multi-Machine• Have all your services running across multiple VMs

• Example: web application and memcached on one VM, postgres and redis on another, elasticsearch on another.

• Test REAL ISSUES with infrastructure on your machine

• Simulate network issues in distributed systems

• Jepsen?

• Your playground!

Page 34: Vagrant for Effective DevOps Culture

VagrantfileRuby DSL - very flexible and programmable

Page 35: Vagrant for Effective DevOps Culture

It’s a long journey• Get Vagrant in place to give common playgrounds to both

developers and operations

• Have infrastructure formalized in some way - choose configuration management of your choice and have everyone use it

• Take small steps

• Do it for small projects and show success stories

• Replicate across projects

• Improve along the way

• Try to get developers also contribute

Page 36: Vagrant for Effective DevOps Culture

Thank youQuestions?