Cookbook vs gem


#1

Hi,

the design decision I love most about chef is that one has the full featured ruby language at
hand. The main method of packaging and distributing ruby chef code is via cookbooks - one could
think of them as chef code libraries, so in fact a subset of generic ruby libraries. The most
important tools to manage our cookbooks are some SCM like git and berkshelf. Berkshelf looks very
similar to bundler.

Up to now I could not answer myself the question: Why are cookbooks different from gems?

People are developing cookbook repository servers with indexes, state-of-the-art APIs and all that
cool stuff. As I understand, there are not any good solutions to mirror the official or even host
your own gem repository. What about features like signed cookbooks/gems? My point is, I have a
strong feeling we could benefit from collaboration with the rubygems project (and vice versa).

I would claim that the most important features of our cookbook stack overlaps with gems and it
feels to me like reinventing the wheel just because it is perceived as seperate domains of
concerns.

I am writing to this list to ask you, if I am missing a major point?! Is anyone aware of
discussions, articles, projects or efforts on consolidating cookbooks and gems?

I greatly appreciate your feedback!

Best regards,
Dennis


#2

So this is a somewhat contentious issue among a few of us, but the short answer is “not much if done correctly”. The biggest difference is that cookbooks have more file structure than a gem for things like cookbook files and templates. A few people are starting to experiment more with managing the bulk of their chef code as plain gems and I’m starting work on a tool to automatically convert a gem to a cookbook as part of its release cycle.

–Noah

On May 8, 2014, at 4:51 AM, Dennis d.klein@gsi.de wrote:

Hi,

the design decision I love most about chef is that one has the full featured ruby language at
hand. The main method of packaging and distributing ruby chef code is via cookbooks - one could
think of them as chef code libraries, so in fact a subset of generic ruby libraries. The most
important tools to manage our cookbooks are some SCM like git and berkshelf. Berkshelf looks very
similar to bundler.

Up to now I could not answer myself the question: Why are cookbooks different from gems?

People are developing cookbook repository servers with indexes, state-of-the-art APIs and all that
cool stuff. As I understand, there are not any good solutions to mirror the official or even host
your own gem repository. What about features like signed cookbooks/gems? My point is, I have a
strong feeling we could benefit from collaboration with the rubygems project (and vice versa).

I would claim that the most important features of our cookbook stack overlaps with gems and it
feels to me like reinventing the wheel just because it is perceived as seperate domains of
concerns.

I am writing to this list to ask you, if I am missing a major point?! Is anyone aware of
discussions, articles, projects or efforts on consolidating cookbooks and gems?

I greatly appreciate your feedback!

Best regards,
Dennis