chef workflow strategies at secondmarket

14

Click here to load reader

Upload: julian-dunn

Post on 01-Jul-2015

1.653 views

Category:

Technology


3 download

DESCRIPTION

A presentation I gave at the Chef-NYC meetup group's Workflow Strategies night on January 29, 2013

TRANSCRIPT

Page 1: Chef Workflow Strategies at SecondMarket

Chef Workflow

at SecondMarket

Julian Dunn

Senior Systems Operations Engineer

[email protected]

Page 2: Chef Workflow Strategies at SecondMarket

What’s Meant by Workflow?

Page 3: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

What’s Meant by Workflow?

How to not trample on others when making

changes

Encompasses the entire process of making the

change

– cookbook development or modification

– unit/integration testing

– deployment

– notifications

Page 4: Chef Workflow Strategies at SecondMarket

Cookbook Development

Page 5: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

Development Workflow

Local development: Vagrant and VirtualBox

Unit tests: ChefSpec

RSpec.configure do |config|

config.before(:all) do ::Chef::Config(:[]).with(:solo).and_return(nil) # or false

end

end

Integration tests: test-kitchen w/ Minitests

Page 6: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

A Word About Git Organization

Break cookbooks into individual repos

– chef-cookbooks/{name}.git

Allows:

– Independent development

– Tracking & merging from upstream

– Contributing changes back

Page 7: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

Roles as Data

Roles contain only data, not run_lists

Version the roles cookbook like others

Page 8: Chef Workflow Strategies at SecondMarket

Limitations of Local

Development

Page 9: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

Limitations of Local Cookbook Development

Missing databags and search

Develop against a Chef server

– “cheftest” environment

– vagrant-butcher

– vagrant-vbguest

Page 10: Chef Workflow Strategies at SecondMarket

Deployment

Page 11: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

Deployment: It’s all about communication

Spork

– Uploading and freezing stable cookbooks

– Change versions per environment

– Notifications to HipChat

Semantic versioning

CHANGELOG.md / JIRA

Page 12: Chef Workflow Strategies at SecondMarket

The Future

Page 13: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

The Future

More people touching Chef

Modularize cookbooks

Improve unit & integration testing

Cookbooks in CI

Code reviews

Page 14: Chef Workflow Strategies at SecondMarket

Member FINRA | MSRB | SIPC © 2012 SecondMarket Holdings, Inc.

Thanks!

t: @julian_dunn

e: [email protected]

g: github.com/secondmarket-cookbooks

w: www.juliandunn.net

SecondMarket’s hiring!