Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using recommends "monit" in metadata.rb #162

Closed
mahmoudimus opened this issue Nov 20, 2013 · 11 comments
Closed

Avoid using recommends "monit" in metadata.rb #162

mahmoudimus opened this issue Nov 20, 2013 · 11 comments
Labels
Bug Something isn't working

Comments

@mahmoudimus
Copy link

Recommending monit, when using Berkshelf, will upload an undesired version of monit to the chef server. While this is being addressed by berkshelf/berkshelf#895, we should not depend on the recommends keyword.

@karmi
Copy link
Contributor

karmi commented Feb 3, 2014

Hi, sorry for not getting to you sooner.

I always understood Chef's recommends as a "soft" dependency declaration, and liked it.

(...) will upload an undesired version of monit to the chef server (...)

Can you be more specific what "undesired" here means? What is uploaded and what do you expect? How do you declare dependency on monit cookbook? Since the Berkshelf#895 has been since merged, do you still experience the issue?

@sethvargo
Copy link

I would highly suggest using binary dependencies - it's either a dep, or it's not.

@karmi
Copy link
Contributor

karmi commented Feb 3, 2014

@sethvargo That's quite problematic in this specific use case. There are multiple Monit cookbooks, with varying functionality and features. So the cookbook won't specify a "binary" dependency, because it leaves the decision about which Monit cookbook to use to the user.

@sethvargo
Copy link

That's a documentation issue though, not a dependency issue. Your cookbook is designed to work with one or more of those monit cookbooks, right? So you document that, then depend on monit.

@mahmoudimus
Copy link
Author

I agree with @sethvargo -- although I am agreeing because I think the elasticsearch cookbook needs to be explicit about what version of monit it supports if it's required.

@karmi
Copy link
Contributor

karmi commented Feb 3, 2014

And here's where our approach differs, Seth. I document the situation like this in the README:

If you include the elasticsearch::monit recipe, it will create a configuration file for Monit, which will check whether Elasticsearch is running, reachable by HTTP and the cluster is in the "green" state. (Assumed you have included a compatible "monit" cookbook in your run list first.)

Based on long years of fighting dependency hell as an end-user in Ruby, in pre- and post- Bundler years, the last thing I want to do is to force that on them. So, if you want to use the elasticsearch::monit recipe, make sure you pick and use a Monit cookbook. Maybe you don't want to use the Monit integration at all -- then the dependency would be totally useless..

It's exactly the same issue with Java, by the way, which is arguably much more central to Elasticsearch usage:

It requires a working Java installation on the target node; add your preferred java cookbook to the node run_list.

Given how much I struggled with the Opscode Java cookbook over the years, the last thing I want to do to my end users is forcing them to use it. I can imagine many people writing their own lightweight Java cookbooks and perfectly satisfiying Elasticsearch requirements in that way.

@karmi
Copy link
Contributor

karmi commented Feb 3, 2014

@mahmoudimus No, the cookbook won't make that decision for you. Pick up a Monit cookbook you consider "good" (to quote you: “I am currently using https://github.com/phlipper/chef-monit which is a much superior cookbook for monit.”) and use it. The contract it has to provide to the Elasticsearch cookbook is quite minimal.

@mahmoudimus
Copy link
Author

@karmi fair enough :)

@sethvargo
Copy link

@karmi - you mean like this: https://github.com/opscode-cookbooks/jenkins#java 😄

@sethvargo
Copy link

@karmi
Copy link
Contributor

karmi commented Feb 3, 2014

@sethvargo Yeah, exactly like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants