3 ms·
Any comments on what people use to manage the chef cookbooks (and why)? Librarian or Berkshelf seem to be the two main contenders to make updating cookbooks si
by rb2k_ 13y ago
Any comments on what people use to manage the chef cookbooks (and why)?
Librarian or Berkshelf seem to be the two main contenders to make updating cookbooks similar to updating gems with bundler.
- timruffles 13y agoI used Berkshelf and it works nicely! The only confusion comes when actually deploying via Chef solo and I forget to ensure the cookbooks are actually present. Haven't tried Librarian - only because I saw Berkshelf first and it integrated nicely with Vagrant.
- tomku 13y agoI've tried both Librarian and Berkshelf to manage cookbooks for my Vagrant VMs for use with Vagrant's chef-solo provisioner. They both have nearly identical core features. Both can grab cookbooks from the Chef community site, local path, generic Git repository (which includes getting a single cookbook from a subdir) or Github. Their syntax is nearly identical. The only difference that I can think of is that Berkshelf has pessimistic version matching support (a la Bundler), while I'm not sure that librarian-chef does. Where they differ is in where they put your cookbooks, and what additional features they offer. Librarian-chef puts your cookbooks in a "cookbooks" folder in the project root, while Berkshelf keeps a global cache of all the versions of each cookbook you've installed outside of the project. Both provide support for uploading your cookbooks to a Chef server, librarian-chef through plain knife and Berkshelf through it's own upload command. Berkshelf also features scaffolding support for Vagrantfiles and new cookbooks, and generally has extra features specifically for rapidly iterating on cookbooks themselves. It also provides a vagrant plugin to manage bundling/uploading cookbooks to a Vagrant VM, since they need to be copied out of the central repo and made available. Overall, I've found that I like Berkshelf better. It feels a little more idiomatic, and I like having my cookbook versions shared between projects rather than duplicated everywhere. If you have any specific questions about either, I'd be happy to answer them.
- bryanlarsen 13y agoI've never tried Berkshelf, didn't even know about it. librarian-chef works great for our needs; I doubt it's worth investigating alternatives. I will note that the librarian-chef also has a vagrant plugin: vagrant-librarian-chef.
- hosh 13y agoBerkshelf is worth investigating simply because there's a lot of momentum behind it, even though it came out after Librarian. By "momentum", I mean that since the session introducing it en mass at the Opscode Community Summit in 2012, it's being adopted by the community. No hard numbers, but the main thing is that Berkshelf could not have really happen without enough standardized community cookbooks. By putting the cookbooks into a global directory, it works more like Ruby gems and Bundler: instead of focusing on your customized (and probably divergent) cookbooks loaded into your project directory, you focus only on the few cookbooks that are specific for your needs. It comes out of a bigger theme in the 2012 Summit, that of creating "library cookbooks" that gets assembled by your "application cookbook". If it's a library cookbook, you don't necessarily need it in your project library any more than you need to import a Ruby gem into your Rails directory during development. Test-kitchen is also worth looking into, though as far as I know, that still uses Librarian under the covers. Berkshelf support for test-kitchen is pending (http://tickets.opscode.com/browse/KITCHEN-9 http://tickets.opscode.com/browse/KITCHEN-9). In summary: Berkshelf is part of the overall trend in modularizing these cookbooks and developing tighter engineering discipline.
- bryanlarsen 13y agoI guess I'm still confused -- that's pretty much exactly why and how I use librarian-chef. After all, it's explicitly modelled on Bundler
- hackerboos 13y agoLast time I looked Berkshelf didn't even support Chef-Solo, or at least Knife-Solo since it stuffs the cookbooks in your home dir. I'd be interested to hear how people were setting up their local chef environments.
- hosh 13y agoBerkshelf works nicely with Vagrant when you are using the chef-solo provisioner. If you're looking to use knife solo for setting up production environments, perhaps one thing to look at is Vagrant 1.1+ support for EC2 provisioning (assuming you're using AWS). You can also have Berkshelf install the declared cookbooks into a directory with `berks install -c $cookbook_dir` and then using knife-solo. Seems awkward, but I'd rather have dependencies managed in some way, rather than resolving the dependencies by hand.