-
Notifications
You must be signed in to change notification settings - Fork 13
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
Should not depend on php & python #24
Comments
I super-agree with this. Unfortunately (to my knowledge) |
@swrobel I've had the same experience; As a workaround, it would be possible to remove the dependencies completely from The caveat to this is that for the end-user of this cookbook, they will need to ensure that whatever wrapper cookbook they use |
Hm, I'm a chef newb, so I'll definitely trust your experiences over mine. Is this what I'm doomed to - installing tons of packages that I don't need just to satisfy the broadest possible cookbook dependencies? But I digress... What about splitting the cookbook out into others for each specific agent? |
@swrobel with such a variety of technologies, having multiple cookbooks, one for each language/agent, may be the best path forward. This cookbook originally started life (correct me if I'm wrong @chr4) as a way to install the repository, server monitor, and Plugin Agent. It then grew to accommodate the generic Ruby agent, and most recently, the PHP agent (courtesy of me). So it might make sense to have a base cookbook for the repository & server monitor, then separate agent cookbooks:
This would also play nicely with Berkshelf, and allow the testing to be simplified all-around. |
👍 |
Here are the cookbooks that we're depending on:
Mmh, I suppose that Opscode has to take some action here, to make |
True, the keywords in metadata should work properly, but we don't have control over that. As for splitting the cookbook up, I'd argue that's relatively common, especially in a Berkshelf-driven workflow. For me, there's no issue of a cookbook depending on another; that's kind of the point, in fact. We've got a number of "wrapper" cookbooks that are just a way to customize how a more generic cookbook functions. If you haven't checked it, Jamie Winsor's The Berkshelf Way presentation does a good job explaining this way of thinking with regards to wrapper cookbooks. @chr4, you're more familiar than I am, but I don't see a ton of overlap in the recipes/providers/resources. |
Thanks @jeffbyrnes for the link to the talk. I do not recall whether there's overlapping resources in this cookbook, my statement was though in a more general way. I don't want seperate cookbooks for $database-client and $database-server, as several things like versions, repositories, etc make sense to be shared. Maybe the best approach would be to open a ticket (unless it exists already?) at Opscode and ask what their plans for There are cookbooks (even from Opscode) with ridiculous amounts of dependencies and sub-dependencies, I think the community would love us for such a feature :) |
Let's definitely raise an issue with Opscode, for sure! That being said, I'm not sure I follow with regards to separate cookbooks for |
I was reffering to opscode-cookbooks/postgresql as an example where shared attributes makes sense. If you look at the default attributes you can see that e.g. the version is specified centrally for client as well as server cookbooks (which makes sense). If those cookbooks where seperated in postgresql-client and postgresql-server, you'd have to make sure both version attributes are aligned when using them in the same environment. |
@chr4 ah, I see what you mean. In the case of PostgreSQL, yeah, makes perfect sense to keep them together. Here, however, we have separate agents, which, with the exception of the repository, don't have any dependence on each other. I can envision a scenario where each agent cookbook depends on the repostiory/server monitor cookbook (which do, in my mind, belong as one & the same cookbook), and take advantage of license key, user/group, etc., but otherwise don't share attributes. Food for thought; I'm great with the cookbook as-is, but I understand the desire to reduce the "dependencies" if you're not using PHP/Python. |
That all being said; just because those cookbooks are depended upon, doesn't mean that those cookbooks will actually have their recipes ever run. So, while the php and python cookbooks will be uploaded to your Chef Server, nothing more should come of it than that. |
The php dependencies are getting worse. In recent versions, they added |
It seems Opscode is aware of this: https://tickets.opscode.com/browse/CHEF-3870 |
@chr4 I'm curious; ignoring that Is the issue that all of those additional cookbooks are installed to your Chef Server? I can understand a desire for not cluttering things up. |
How did you get # metadata.rb
-depends 'php'
+suggests 'php' leads to this error (after doing a
Am I missing something? It's indeed all the not required cookbooks being installed on the Chef server. While it "works", it's still annoying, plus, I'm usually using |
We didn't get I'm not familiar with We have to maintain a number of our own cookbooks (most are private), but we just use Berkshelf, which deals with ensuring all the dependencies are uploaded if they don't exist on the Chef Server. Berkshelf can definitely deal with branches, commits, and tags though! If you're testing a specific version, you'd want to update the Berksfile to point to the repository & a specific branch/tag/ref, then use Test Kitchen, or just plain Vagrant, to see if your changes converge properly. If there's some interdependency of cookbooks, we usually specify in the Berksfile to look for the other cookbook(s) locally during testing, like so: site :opscode
metadata
cookbook 'et_users', path: '../et_users' All of our cookbook repositories are in the same folder, but you could set that path to anything, frankly. Once things converge well, we discard the changes to the Berksfile in the cookbook in question, merge down to master (usually via a Pull Request for some review), and craft a release by updating the Does that help explain why I don't have much trouble with |
You are right, checking out different tags and branches is certianly possible with Berkshelf!
The downside is, though, that it doesn't manage dependencies automatically :) Basically,imo it has advantages when you maintain multiple cookbooks instead of just using them. |
Interesting. I'd be curious to check out this repo tool; where might I find it? As for keeping the environment, data_bags, etc. under version control, here's our structure: .
├── .chef
│ └── contains knife config, etc.
├── cookbooks
│ ├── each cookbook is its own repo
│ └── this dir & its contents are untracked & ignored by "chef" repo
├── data_bags
│ └── tracked by "chef" repo
├── environments
│ └── tracked by "chef" repo
└── roles
└── tracked by "chef" repo Everything's under one "roof", but we avoid submodules etc. |
Yes, but you cannot sync/branch/checkout all your branches at once. :) repo can be found here: https://code.google.com/p/git-repo/ (it's also included in homebrew (for MacOS)) To get started, you can use a default.xml in your manifest repository like this: <?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="github" fetch="git://github.com" />
<remote name="chr4" fetch="ssh://[email protected]/chr4-cookbooks" />
<remote name="opscode" fetch="git://github.com/opscode-cookbooks" />
<default revision="master" remote="opscode" />
<project name="iptables-ng" path="cookbooks/iptables-ng" remote="chr4" />
<project name="newrelic-ng" path="cookbooks/newrelic-ng" remote="chr4" />
<project name="resolvconf" path="cookbooks/resolvconf" remote="chr4" />
<!-- opscode cookbooks -->
<project name="ssh_known_hosts" path="cookbooks/ssh_known_hosts" />
<project name="partial_search" path="cookbooks/partial_search" />
<!-- other cookbooks -->
<project name="customink-webops/hostsfile" path="cookbooks/hostsfile" remote="github" />
</manifest> |
Berkshelf supports:
This means you can manage your development cookbooks without berkshelf trashing them. It doesn't, however, manage the dependencies, but then ruby is ruby and Berksfile can contain ruby to pull down git repositories with a single definition in one place |
I realize these are necessary for their respective monitors, but they should be
recommends
rather thandepends
as their dependencies shouldn't be installed if we're just using the ruby agent.The text was updated successfully, but these errors were encountered: