SlideShare a Scribd company logo
Using Berkshelf
Evolution in Cookbook Development at
Fiksu.
What is Berkshelf?
● A Cookbook authoring productivity tool by
Jamie Windsor and the Riot Games crew.
● Replaces some functions of knife (cookbook
download / upload / create)
● A package manager of sorts (think bundler
for cookbooks)
Why Berkshelf?
● Simplifies collaborative development.
● Promotes wrapping and extending public
cookbooks.
● Greatly simplifies cookbook and dependency
upload process.
● Seamless vagrant integration. (via plugin)
“The Berkshelf Way”
1. Work in verticals from the outside in:
● Start with the application cookbook and work down through the
dependencies.
2. Favor Data-driven Cookbooks:
● Cookbook attributes preferred; tune on an environment level.
3. Write well-encapsulated Cookbooks:
● Stop using Roles. They aren’t immutably versioned and add additional
setup and complexity for users. Cookbooks should be self-contained.
4. Have short iteration loops:
● Use vagrant with berkshelf plugin to greatly reduce iteration cycle time.
Berksfile
● Think Gemfile; tells Berkshelf where it
should look for dependent cookbooks:
○ cookbook “nginx”, chef_api :config (Your chef server)
○ cookbook “nginx”, site :opscode (Opscode Public Cookbooks)
○ cookbook “nginx”, git: 'git://github.com/opscode-cookbooks/nginx.git'
○ cookbook “nginx”, path: '/Users/bob/cookbooks/nginx'
● You can tell Berkshelf to use your metadata
file:
○ metadata
Fiksu specifics
● Application, Wrapper, Utility Cookbooks
○ All explicitly namespaced.
● Cookbook metadata is the source of truth
○ depends statements in metadata.rb constrain
versions, not Berksfile.
● Chef Environments
○ Use of metadata makes production constraints much
simpler.
○ Staging is unconstrained
■ Promotes faster iteration cycle
■ Reduces Ops overhead/bottleneck
● Roles
○ For now, a placeholder that binds our base role with
an app cookbook.
Fiksu’s Berksfile
# Check our hosted chef server first. Looks for the chef configuration
# info in ~/.berkshelf/config.json. If not there, run 'berks configure'.
chef_api :config
# Now look at the community cookbooks.
site :opscode
# Finally, reference the metadata file in the cookbook.
metadata
metadata.rb
maintainer "Fiksu Inc."
maintainer_email "xxxxxxx@fiksu.com"
license "All rights reserved"
description "Installs/Configures Fiksu’s awesome app!"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
name “fiksu_awesome_app”
version “1.0.0”
depends "fiksu_nginx", "1.1.4"
depends "fiksu_redis", "1.2.3"
depends "monit", "0.0.15"
The Past
● All chef artifacts (cookbooks, roles, envs, etc.) in one
giant chef-repo.
● Adding or extending public cookbooks was painful and
sloppy… git submodules were less than ideal.
● A very role-centric environment; tough to easily see the
“big picture” while working on a single cookbook.
● No use of Vagrant for testing. Everything was uploaded
to Hosted Chef and tested in EC2… cookbook testing in
isolation was impossible.
The Present
● One cookbook per repo.
● All Application Cookbooks use Berkshelf and Vagrant
for much faster iteration cycles.
● CI: Use TravisCI for linting (foodcritic) and syntax
checks (knife cookbook check).
● Little to no test coverage with chefspec/fauxhai or
minitest-handler.
● Still using roles.
The Future
● Well defined cookbook development workflow process
that empowers both dev and ops as productive
cookbook authors.
● Matured CI workflow (automated cookbook uploads to
chef-server, etc.).
● Embrace TDD in cookbook authoring is a must.
● Roles days numbered?
Some references:
http://berkshelf.com/
http://www.opscode.com/blog/chefconf-talks/the-berkshelf-
way-jamie-winsor/
http://alluvium.com/blog/2013/05/03/the-application-
cookbook-pattern-berkshelf-and-team-chef-workflow/
http://realityforge.org/code/2012/11/19/role-cookbooks-and-
wrapper-cookbooks.html

More Related Content

PDF
Chef Intro @ SF Bay Area LSPE meetup
PDF
PDF
Growing Pains with Chef – a Tale of DevOps in a Large Organization
PDF
2015 08-11-scdo-meetup
KEY
Cooking with Chef
PPT
Chef - managing yours servers with Code
PDF
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
PPTX
Cook Infrastructure with chef -- Justeat.IN
Chef Intro @ SF Bay Area LSPE meetup
Growing Pains with Chef – a Tale of DevOps in a Large Organization
2015 08-11-scdo-meetup
Cooking with Chef
Chef - managing yours servers with Code
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
Cook Infrastructure with chef -- Justeat.IN

What's hot (20)

PPTX
Angular 1.5 Components
PPT
Chef, Devops, and You
PDF
Using Chef and Vagrant at Gengo
PDF
Automating your infrastructure with Chef
PDF
Customizing Chef for Fun and Profit
PPT
Managing Servers with Chef
PDF
Jenkins automation
PDF
Introduction to Cooking with Chef
PPTX
Kickstarter - Chef Opswork
PPTX
Django elastic beanstalk
PDF
CHEF - by Scott Russel
PPTX
Chef for Openstack
PDF
Hand Crafted Artisanal Chef Resources
PDF
Chef for the Symfony developer
PDF
PDF
Be happy with Ruby on Rails - CEUNSP Itu
PPTX
Introduce cucumber
PDF
Chef, Vagrant and Friends
PPTX
Changing layouts
PDF
ServerMessaging Workflow v1.0
Angular 1.5 Components
Chef, Devops, and You
Using Chef and Vagrant at Gengo
Automating your infrastructure with Chef
Customizing Chef for Fun and Profit
Managing Servers with Chef
Jenkins automation
Introduction to Cooking with Chef
Kickstarter - Chef Opswork
Django elastic beanstalk
CHEF - by Scott Russel
Chef for Openstack
Hand Crafted Artisanal Chef Resources
Chef for the Symfony developer
Be happy with Ruby on Rails - CEUNSP Itu
Introduce cucumber
Chef, Vagrant and Friends
Changing layouts
ServerMessaging Workflow v1.0
Ad

Viewers also liked (20)

PDF
PPTX
The Internet own boy
PDF
DevconTLV 2014 (Jan) - DIY DevOps
PDF
Vagrant up-and-running
PPTX
Unit testing
PDF
Chef Howto with Vagrant + Berkshelf
PPTX
DevOps and Chef
PPTX
2011-05-28 #qpstudy 勉強会ツール作ろうの会
PDF
Secrets of JavaScript Libraries
PPTX
Node.js, Vagrant, Chef, and Mathoid @ Benetech
PDF
セキュリティ・キャンプ参加してみた #ssmjp #seccamp
PDF
Developers Summit 2014 PaaS Time Attack!
PDF
Integrated Marketing: Why a Website Isn't Enough
PDF
The Berkshelf Way
PPTX
Chef Cookbook Design Patterns
PDF
Node.js and How JavaScript is Changing Server Programming
PPTX
Vagrant + Docker
PPTX
Vagrant vs Docker
PDF
Patterns and Practices of a Successful DevOps Transformation
PDF
DevOps and Chef
The Internet own boy
DevconTLV 2014 (Jan) - DIY DevOps
Vagrant up-and-running
Unit testing
Chef Howto with Vagrant + Berkshelf
DevOps and Chef
2011-05-28 #qpstudy 勉強会ツール作ろうの会
Secrets of JavaScript Libraries
Node.js, Vagrant, Chef, and Mathoid @ Benetech
セキュリティ・キャンプ参加してみた #ssmjp #seccamp
Developers Summit 2014 PaaS Time Attack!
Integrated Marketing: Why a Website Isn't Enough
The Berkshelf Way
Chef Cookbook Design Patterns
Node.js and How JavaScript is Changing Server Programming
Vagrant + Docker
Vagrant vs Docker
Patterns and Practices of a Successful DevOps Transformation
DevOps and Chef
Ad

Similar to 2013-08-27 Chef-Boston Meetup - Using Berkshelf (20)

PPTX
Building a PaaS using Chef
PPTX
Chef Tutorial for DEVOPS Newbies
PDF
Chef: Smart infrastructure automation
PDF
Cloud Automation with Opscode Chef
PPTX
habitat at docker bud
PDF
OSDC 2016 - Kaiten Zushi - Chef at Goodgame Studios by Jan Ulferts
PPTX
Berkshelf Tutorial : Better Way to Create and Manage Chef Cookbooks
PPTX
The Berkshelf Way
PDF
Infrastructure as-code-guide-en-v6 299129
PPT
What Makes a Good Cookbook?
PDF
IT Automation with Chef
PDF
Don't Fear the Autotools
PPTX
Habitat Managed Chef
PPTX
DevOps hackathon Session 2: Basics of Chef
PDF
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
PDF
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
PDF
What is Chef and how we use it at tripsta
PPTX
Chef at EIS
PDF
Chef conf-2014
PDF
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Building a PaaS using Chef
Chef Tutorial for DEVOPS Newbies
Chef: Smart infrastructure automation
Cloud Automation with Opscode Chef
habitat at docker bud
OSDC 2016 - Kaiten Zushi - Chef at Goodgame Studios by Jan Ulferts
Berkshelf Tutorial : Better Way to Create and Manage Chef Cookbooks
The Berkshelf Way
Infrastructure as-code-guide-en-v6 299129
What Makes a Good Cookbook?
IT Automation with Chef
Don't Fear the Autotools
Habitat Managed Chef
DevOps hackathon Session 2: Basics of Chef
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
What is Chef and how we use it at tripsta
Chef at EIS
Chef conf-2014
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...

Recently uploaded (20)

PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Architecture types and enterprise applications.pdf
PDF
Unlock new opportunities with location data.pdf
PDF
STKI Israel Market Study 2025 version august
PPTX
Tartificialntelligence_presentation.pptx
PDF
Hybrid model detection and classification of lung cancer
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPT
What is a Computer? Input Devices /output devices
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
The various Industrial Revolutions .pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Getting started with AI Agents and Multi-Agent Systems
DOCX
search engine optimization ppt fir known well about this
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Five Habits of High-Impact Board Members
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
DP Operators-handbook-extract for the Mautical Institute
Taming the Chaos: How to Turn Unstructured Data into Decisions
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Architecture types and enterprise applications.pdf
Unlock new opportunities with location data.pdf
STKI Israel Market Study 2025 version august
Tartificialntelligence_presentation.pptx
Hybrid model detection and classification of lung cancer
Group 1 Presentation -Planning and Decision Making .pptx
What is a Computer? Input Devices /output devices
sustainability-14-14877-v2.pddhzftheheeeee
The various Industrial Revolutions .pptx
Hindi spoken digit analysis for native and non-native speakers
Getting started with AI Agents and Multi-Agent Systems
search engine optimization ppt fir known well about this
O2C Customer Invoices to Receipt V15A.pptx
Five Habits of High-Impact Board Members
1 - Historical Antecedents, Social Consideration.pdf
Module 1.ppt Iot fundamentals and Architecture
A comparative study of natural language inference in Swahili using monolingua...
DP Operators-handbook-extract for the Mautical Institute

2013-08-27 Chef-Boston Meetup - Using Berkshelf

  • 1. Using Berkshelf Evolution in Cookbook Development at Fiksu.
  • 2. What is Berkshelf? ● A Cookbook authoring productivity tool by Jamie Windsor and the Riot Games crew. ● Replaces some functions of knife (cookbook download / upload / create) ● A package manager of sorts (think bundler for cookbooks)
  • 3. Why Berkshelf? ● Simplifies collaborative development. ● Promotes wrapping and extending public cookbooks. ● Greatly simplifies cookbook and dependency upload process. ● Seamless vagrant integration. (via plugin)
  • 4. “The Berkshelf Way” 1. Work in verticals from the outside in: ● Start with the application cookbook and work down through the dependencies. 2. Favor Data-driven Cookbooks: ● Cookbook attributes preferred; tune on an environment level. 3. Write well-encapsulated Cookbooks: ● Stop using Roles. They aren’t immutably versioned and add additional setup and complexity for users. Cookbooks should be self-contained. 4. Have short iteration loops: ● Use vagrant with berkshelf plugin to greatly reduce iteration cycle time.
  • 5. Berksfile ● Think Gemfile; tells Berkshelf where it should look for dependent cookbooks: ○ cookbook “nginx”, chef_api :config (Your chef server) ○ cookbook “nginx”, site :opscode (Opscode Public Cookbooks) ○ cookbook “nginx”, git: 'git://github.com/opscode-cookbooks/nginx.git' ○ cookbook “nginx”, path: '/Users/bob/cookbooks/nginx' ● You can tell Berkshelf to use your metadata file: ○ metadata
  • 6. Fiksu specifics ● Application, Wrapper, Utility Cookbooks ○ All explicitly namespaced. ● Cookbook metadata is the source of truth ○ depends statements in metadata.rb constrain versions, not Berksfile. ● Chef Environments ○ Use of metadata makes production constraints much simpler. ○ Staging is unconstrained ■ Promotes faster iteration cycle ■ Reduces Ops overhead/bottleneck ● Roles ○ For now, a placeholder that binds our base role with an app cookbook.
  • 7. Fiksu’s Berksfile # Check our hosted chef server first. Looks for the chef configuration # info in ~/.berkshelf/config.json. If not there, run 'berks configure'. chef_api :config # Now look at the community cookbooks. site :opscode # Finally, reference the metadata file in the cookbook. metadata
  • 8. metadata.rb maintainer "Fiksu Inc." maintainer_email "xxxxxxx@fiksu.com" license "All rights reserved" description "Installs/Configures Fiksu’s awesome app!" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) name “fiksu_awesome_app” version “1.0.0” depends "fiksu_nginx", "1.1.4" depends "fiksu_redis", "1.2.3" depends "monit", "0.0.15"
  • 9. The Past ● All chef artifacts (cookbooks, roles, envs, etc.) in one giant chef-repo. ● Adding or extending public cookbooks was painful and sloppy… git submodules were less than ideal. ● A very role-centric environment; tough to easily see the “big picture” while working on a single cookbook. ● No use of Vagrant for testing. Everything was uploaded to Hosted Chef and tested in EC2… cookbook testing in isolation was impossible.
  • 10. The Present ● One cookbook per repo. ● All Application Cookbooks use Berkshelf and Vagrant for much faster iteration cycles. ● CI: Use TravisCI for linting (foodcritic) and syntax checks (knife cookbook check). ● Little to no test coverage with chefspec/fauxhai or minitest-handler. ● Still using roles.
  • 11. The Future ● Well defined cookbook development workflow process that empowers both dev and ops as productive cookbook authors. ● Matured CI workflow (automated cookbook uploads to chef-server, etc.). ● Embrace TDD in cookbook authoring is a must. ● Roles days numbered?