Project

chef-ab

0.0
No commit activity in last 3 years
No release in over 3 years
AB test like chef conf deployement
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0

Runtime

 Project Readme

Chef AB

Build Status Gem Version Dependency Status Coverage Status Coverage Status

chef-ab is a small library to activate code in cookbooks progressively in a cluster.

It works like an AB test with increasing population.

Note: I use now rundeck at work which is much better suited for this kind of thing. I'll be happy to transfer the ownership of this gem though I still accept bug report and PR.

Usage

Very simple example in attribute file of :

# value before upgrade
default[:a_cookbook][:activate_experimental_feature] = false

upgrade = ChefAB::TimeLinearUpgrader.new(
  node_id: node['fqdn'], # we use fqdn as id for the migration
  start_time: Time.new(2014, 02, 11, 8, 30, 00, "+01:00"),
  end_time:   Time.new(2014, 02, 18, 8, 30, 00, "+01:00")
)

upgrade.execute do
  default[:a_cookbook][:activate_experimental_feature] = true
end

Another example, upgrading nodes exponentially depending on distance to a given ip address:

# value before upgrade
default[:a_cookbook][:activate_experimental_feature] = false

upgrade = ChefAB::TimeIPBasedUpgrader.new(
  node_id: node['ipaddress'],
  start_time: Time.new(2014, 02, 11, 8, 30, 00, "+01:00"),
  period: 3600, #going larger every hour
  initial_ip: "10.11.12.13"
)

upgrade.execute do
  default[:a_cookbook][:activate_experimental_feature] = true
end

Warning

  • This lib is not a substitute to release management, it will solve only the issue of progressive update.
  • It is meant to replace the ssh loop that many uses to upgrades server farms.
  • This library does not give strong garantees on the number of servers that will activate code at the same time (see chef_throttle for that).