-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support for cookbook dependencies with their own 'non-Supermarket' dependencies #66
Comments
I feel like what you've described should be possible, but I'm having trouble mapping it out exactly in my mind. Can you provide your Batali file (or at least the relevant portion)? |
@luckymike Sure Here's the Batali file for the myapp cookbook:
The Batali file for the myappdev cookbook:
The Batali file for my infrastructure repo:
I can't just copy the line for the postgresql cookbook from my myapp cookbook Batali file (and get
Is there a way to combine a source and version constraints in a Batali file? If I remove the version constraint and re-run
After changing the Git URL to use HTTPS instead,
I changed the postgresql dependency in the Batali file of myapp and commenting it out in the infrastructure repo. The results of running
and then:
|
The above does kind of work as a workaround, i.e. run |
Hi!
Suggestions: There are a few options you can investigate. If you are running your own chef server instance (chef server 12 or greater) you can create an organization just for cookbook asset storage. You can then use this new organization within your Batali file so it can use cookbooks within that organization when generating a solution. This is an easy way to store custom cookbook assets (internal cookbooks or customized/different cookbooks). Another option would be to run a personal supermarket to store these cookbook assets. Outside of those, copying your customized source information to the infra repository Batali file is going to be your only option for now. Cheers! |
@chrisroberts Thanks for the detailed response. For [1], it seems reasonable (to me) that one could treat a custom or explicit source the same way as an 'implied source', e.g. capable of providing multiple versions just as 'a supermarket'. Git tags seem perfectly suited for providing versions. I get that it doesn't work this way now, but I don't (yet) understand why it couldn't work this way potentially. Given what you've written, I'd expect to have to implement this myself. If I did tho, would you be open to merging? [4] would be great. I actually started using Batali for this project because I thought this was already supported. My real problem is that I'm trying to use Chef without a server. Despite it being possible, it's certainly not straightforward or easy with any existing tools (of which I'm aware). And it's actively discouraged. I persist because the Chef ecosystem is valuable and unlocking it without needing to run a Chef server seems so tantalizingly close to realizable. |
@kenny-evitt even if you don't want to use Chef Server for node data, you probably should use Chef Server or a Supermarket server as an artifact store for your cookbooks. Batali can be used to perform the dependency resolution and vendoring on the client side from either a Chef or Supermarket server. The git option should be understood as a source "build," and as in other software contexts, you may retrieve a specific revision of the source code, but the "version" you build is determined solely by the versioning present in the revision that you've checked out. |
@luckymike Thanks |
I've got a Chef infrastructure repo that depends on two private cookbooks myapp and myappdev.
The myappdev cookbook depends on myapp.
The myapp cookbook itself depends on a non-Supermarket postgresql cookbook – this one by-the-way.
But when I run
chef exec batali resolve -V -D
from the root directory of the infrastructure repo, it seems that it can't find the non-Supermarket postgresql cookbook:Is it just not possible for Batali to resolve the postgresql cookbook? Or is that non-Supermarket dependencies cannot be resolved for dependencies themselves?
When I first tried resolving dependencies, the myapp cookbook did not contain its own Batali file – I was using Berkshelf previously to specify the non-Supermarket cookbook dependency. But it doesn't seem that Batali 'nests' and uses Batali files in dependency cookbooks – that would be nice if it did.
But even if Batali did resolve nested non-Supermarket dependencies, it seems like explicit support would need to be added for other dependency libraries, e.g. Berkshelf and Librarian. Neither Berkshelf or Librarian support nested non-default-source dependencies.
The text was updated successfully, but these errors were encountered: