Cookbook dependencies doc

Hi,

Could somebody point to a document describing how the cookbook dependencies are calculated ?

I found for attributes http://docs.opscode.com/chef_overview_attributes.html but not sure if apply for cookbook version constraints.

thanks!

  • silviu

Did you read http://docs.opscode.com/essentials_cookbook_versions.html ?

Best,
-M

On Thu, Feb 27, 2014 at 1:32 PM, Silviu Dicu silviudicu@gmail.com wrote:

Hi,

Could somebody point to a document describing how the cookbook
dependencies are calculated ?

I found for attributes
About Attributes but not sure if
apply for cookbook version constraints.

thanks!

  • silviu

Hi,

I was looking for a document that explains what is the merging order of the
dependencies and who will win in the end
Take a situation like this

Node run config
{
"name": "test-constraints",
"chef_environment": "test",
"normal": {
},
"run_list": [
"recipe[a]"
]
}

$ grep depends cookbooks/a/metadata.rb
depends "b"
depends "tech", "= 0.3.0"

$ tail -1 cookbooks/a/recipes/default.rb
include_recipe "b"

$ grep depends cookbooks/b/metadata.rb
depends "tech", "= 0.1.0"

$ tail -1 cookbooks/b/recipes/default.rb
include_recipe "tech"

$ grep tech environments/test.json
"tech": "= 0.2.0"

This runs w/o problems.
But if I change environment to = 0.1.0 will do this

[2014-02-28T00:07:36+00:00] INFO: HTTP Request Returned 412 Precondition
Failed: {"message"=>"Unable to solve constraints, the following solutions
were attempted \n\n Unable to satisfy goal constraint a due to
constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to
satisfy goal constraint a due to constraints on tech\n (a = 0.2.0)
-> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n",
"unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>,
"most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

If I change environment to = 0.3.0

[2014-02-28T00:13:08+00:00] INFO: HTTP Request Returned 412 Precondition
Failed: {"message"=>"Unable to solve constraints, the following solutions
were attempted \n\n Unable to satisfy goal constraint a due to
constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to
satisfy goal constraint a due to constraints on tech\n (a = 0.2.0)
-> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n",
"unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>,
"most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

$ knife cookbook show tech
tech 0.3.0 0.2.0 0.1.0

thanks!

-silviu

Best,
-M

On Thu, Feb 27, 2014 at 1:32 PM, Silviu Dicu silviudicu@gmail.com wrote:

Hi,

Could somebody point to a document describing how the cookbook
dependencies are calculated ?

I found for attributes
About Attributes but not sure if
apply for cookbook version constraints.

thanks!

  • silviu

There is no winner per se, all constraints must be satisfied. You will have to fix your dependencies for this to have a valid solution.

--Noah

On Feb 27, 2014, at 4:17 PM, Silviu Dicu silviudicu@gmail.com wrote:

Hi,

I was looking for a document that explains what is the merging order of the dependencies and who will win in the end
Take a situation like this

Node run config
{
"name": "test-constraints",
"chef_environment": "test",
"normal": {
},
"run_list": [
"recipe[a]"
]
}

$ grep depends cookbooks/a/metadata.rb
depends "b"
depends "tech", "= 0.3.0"

$ tail -1 cookbooks/a/recipes/default.rb
include_recipe "b"

$ grep depends cookbooks/b/metadata.rb
depends "tech", "= 0.1.0"

$ tail -1 cookbooks/b/recipes/default.rb
include_recipe "tech"

$ grep tech environments/test.json
"tech": "= 0.2.0"

This runs w/o problems.
But if I change environment to = 0.1.0 will do this

[2014-02-28T00:07:36+00:00] INFO: HTTP Request Returned 412 Precondition Failed: {"message"=>"Unable to solve constraints, the following solutions were attempted \n\n Unable to satisfy goal constraint a due to constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to satisfy goal constraint a due to constraints on tech\n (a = 0.2.0) -> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n", "unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>, "most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

If I change environment to = 0.3.0

[2014-02-28T00:13:08+00:00] INFO: HTTP Request Returned 412 Precondition Failed: {"message"=>"Unable to solve constraints, the following solutions were attempted \n\n Unable to satisfy goal constraint a due to constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to satisfy goal constraint a due to constraints on tech\n (a = 0.2.0) -> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n", "unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>, "most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

$ knife cookbook show tech
tech 0.3.0 0.2.0 0.1.0

thanks!

-silviu

Best,
-M

On Thu, Feb 27, 2014 at 1:32 PM, Silviu Dicu silviudicu@gmail.com wrote:
Hi,

Could somebody point to a document describing how the cookbook dependencies are calculated ?

I found for attributes About Attributes but not sure if apply for cookbook version constraints.

thanks!

  • silviu

Hi Noah,

Thanks for your answer, as I said I was looking to find a document that
explains
how the decision is taken, the closest I found as a 'doc' is

-silviu

On Thu, Feb 27, 2014 at 7:26 PM, Noah Kantrowitz noah@coderanger.netwrote:

There is no winner per se, all constraints must be satisfied. You will
have to fix your dependencies for this to have a valid solution.

--Noah

On Feb 27, 2014, at 4:17 PM, Silviu Dicu silviudicu@gmail.com wrote:

Hi,

I was looking for a document that explains what is the merging order of
the dependencies and who will win in the end
Take a situation like this

Node run config
{
"name": "test-constraints",
"chef_environment": "test",
"normal": {
},
"run_list": [
"recipe[a]"
]
}

$ grep depends cookbooks/a/metadata.rb
depends "b"
depends "tech", "= 0.3.0"

$ tail -1 cookbooks/a/recipes/default.rb
include_recipe "b"

$ grep depends cookbooks/b/metadata.rb
depends "tech", "= 0.1.0"

$ tail -1 cookbooks/b/recipes/default.rb
include_recipe "tech"

$ grep tech environments/test.json
"tech": "= 0.2.0"

This runs w/o problems.
But if I change environment to = 0.1.0 will do this

[2014-02-28T00:07:36+00:00] INFO: HTTP Request Returned 412 Precondition
Failed: {"message"=>"Unable to solve constraints, the following solutions
were attempted \n\n Unable to satisfy goal constraint a due to
constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to
satisfy goal constraint a due to constraints on tech\n (a = 0.2.0)
-> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n",
"unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>,
"most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

If I change environment to = 0.3.0

[2014-02-28T00:13:08+00:00] INFO: HTTP Request Returned 412 Precondition
Failed: {"message"=>"Unable to solve constraints, the following solutions
were attempted \n\n Unable to satisfy goal constraint a due to
constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to
satisfy goal constraint a due to constraints on tech\n (a = 0.2.0)
-> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n",
"unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>,
"most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

$ knife cookbook show tech
tech 0.3.0 0.2.0 0.1.0

thanks!

-silviu

Best,
-M

On Thu, Feb 27, 2014 at 1:32 PM, Silviu Dicu silviudicu@gmail.com
wrote:
Hi,

Could somebody point to a document describing how the cookbook
dependencies are calculated ?

I found for attributes
About Attributes but not sure if
apply for cookbook version constraints.

thanks!

  • silviu

I wouldn't count on that behavior. Erchef will switching back the Ruby (gecode) depsolver soon, and Berkshelf as its own based on the Solve gem :frowning:

--Noah

On Feb 28, 2014, at 6:44 PM, Silviu Dicu silviudicu@gmail.com wrote:

Hi Noah,

Thanks for your answer, as I said I was looking to find a document that explains
how the decision is taken, the closest I found as a 'doc' is https://github.com/opscode/depsolver/blob/master/src/depsolver.erl#L23

-silviu

On Thu, Feb 27, 2014 at 7:26 PM, Noah Kantrowitz noah@coderanger.net wrote:
There is no winner per se, all constraints must be satisfied. You will have to fix your dependencies for this to have a valid solution.

--Noah

On Feb 27, 2014, at 4:17 PM, Silviu Dicu silviudicu@gmail.com wrote:

Hi,

I was looking for a document that explains what is the merging order of the dependencies and who will win in the end
Take a situation like this

Node run config
{
"name": "test-constraints",
"chef_environment": "test",
"normal": {
},
"run_list": [
"recipe[a]"
]
}

$ grep depends cookbooks/a/metadata.rb
depends "b"
depends "tech", "= 0.3.0"

$ tail -1 cookbooks/a/recipes/default.rb
include_recipe "b"

$ grep depends cookbooks/b/metadata.rb
depends "tech", "= 0.1.0"

$ tail -1 cookbooks/b/recipes/default.rb
include_recipe "tech"

$ grep tech environments/test.json
"tech": "= 0.2.0"

This runs w/o problems.
But if I change environment to = 0.1.0 will do this

[2014-02-28T00:07:36+00:00] INFO: HTTP Request Returned 412 Precondition Failed: {"message"=>"Unable to solve constraints, the following solutions were attempted \n\n Unable to satisfy goal constraint a due to constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to satisfy goal constraint a due to constraints on tech\n (a = 0.2.0) -> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n", "unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>, "most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

If I change environment to = 0.3.0

[2014-02-28T00:13:08+00:00] INFO: HTTP Request Returned 412 Precondition Failed: {"message"=>"Unable to solve constraints, the following solutions were attempted \n\n Unable to satisfy goal constraint a due to constraint on tech\n (a = 0.1.0) -> (tech = 0.2.0)\n Unable to satisfy goal constraint a due to constraints on tech\n (a = 0.2.0) -> (tech = 0.3.0)\n (a = 0.2.0) -> (b = 0.1.0) -> (tech = 0.1.0)\n", "unsatisfiable_run_list_item"=>["a"], "non_existent_cookbooks"=>, "most_constrained_cookbooks"=>["(tech = 0.2.0)"]}

$ knife cookbook show tech
tech 0.3.0 0.2.0 0.1.0

thanks!

-silviu

Best,
-M

On Thu, Feb 27, 2014 at 1:32 PM, Silviu Dicu silviudicu@gmail.com wrote:
Hi,

Could somebody point to a document describing how the cookbook dependencies are calculated ?

I found for attributes About Attributes but not sure if apply for cookbook version constraints.

thanks!

  • silviu

On Fri Feb 28 18:48:05 2014, Noah Kantrowitz wrote:

I wouldn't count on that behavior. Erchef will switching back the Ruby (gecode) depsolver soon, and Berkshelf as its own based on the Solve gem :frowning:

Berkshelf will be switching to gecode as well. Dan has been working on
getting gecode to compile under windows.

On Feb 28, 2014, at 9:21 PM, Lamont Granquist lamont@opscode.com wrote:

On Fri Feb 28 18:48:05 2014, Noah Kantrowitz wrote:

I wouldn't count on that behavior. Erchef will switching back the Ruby (gecode) depsolver soon, and Berkshelf as its own based on the Solve gem :frowning:

Berkshelf will be switching to gecode as well. Dan has been working on getting gecode to compile under windows.

To those that haven't had the pleasure of solver inconsistencies this is is an improvement roughly on par with "we are replacing your Geo Metro with a Model S".

--Noah

On Fri Feb 28 21:27:22 2014, Noah Kantrowitz wrote:

On Feb 28, 2014, at 9:21 PM, Lamont Granquist lamont@opscode.com wrote:

On Fri Feb 28 18:48:05 2014, Noah Kantrowitz wrote:

I wouldn't count on that behavior. Erchef will switching back the Ruby (gecode) depsolver soon, and Berkshelf as its own based on the Solve gem :frowning:

Berkshelf will be switching to gecode as well. Dan has been working on getting gecode to compile under windows.

To those that haven't had the pleasure of solver inconsistencies this is is an improvement roughly on par with "we are replacing your Geo Metro with a Model S".

--Noah

Well, a Model S that takes 10 minutes to compile every time you refuel
it...

On 27.2.2014 19:32, Silviu Dicu wrote:

Hi,

Could somebody point to a document describing how the cookbook dependencies are calculated ?

I found for attributes About Attributes but not sure if apply for cookbook version constraints.

thanks!

  • silviu

Hey Silviu,

FWIW, I also had problems figuring out a cookbook's full dependency list
and sent a patch to have chef list the full dependency branch when it
fails to find a cookbook's dependencies at runtime:
https://tickets.opscode.com/browse/CHEF-5065

This might help you or others.

-Ionuț

May I know how to put new problem for discussion on this forum?

-----Original Message-----
From: Ionuț Arțăriși [mailto:iartarisi@suse.cz]
Sent: Monday, March 3, 2014 4:12 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Cookbook dependencies doc

On 27.2.2014 19:32, Silviu Dicu wrote:

Hi,

Could somebody point to a document describing how the cookbook dependencies are calculated ?

I found for attributes About Attributes but not sure if apply for cookbook version constraints.

thanks!

  • silviu

Hey Silviu,

FWIW, I also had problems figuring out a cookbook's full dependency list and sent a patch to have chef list the full dependency branch when it fails to find a cookbook's dependencies at runtime:
https://tickets.opscode.com/browse/CHEF-5065

This might help you or others.

-Ionuț

DISCLAIMER

This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Not entirely sure what you mean. If you think you've found a bug or error in Chef you can just file a ticket on tickets.opscode.com. If you just have a question, you can email this list.

--Noah

On Mar 3, 2014, at 5:48 AM, Milind Patil milind_patil1@persistent.co.in wrote:

May I know how to put new problem for discussion on this forum?

-----Original Message-----
From: Ionuț Arțăriși [mailto:iartarisi@suse.cz]
Sent: Monday, March 3, 2014 4:12 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Cookbook dependencies doc

On 27.2.2014 19:32, Silviu Dicu wrote:

Hi,

Could somebody point to a document describing how the cookbook dependencies are calculated ?

I found for attributes About Attributes but not sure if apply for cookbook version constraints.

thanks!

  • silviu

Hey Silviu,

FWIW, I also had problems figuring out a cookbook's full dependency list and sent a patch to have chef list the full dependency branch when it fails to find a cookbook's dependencies at runtime:
https://tickets.opscode.com/browse/CHEF-5065

This might help you or others.

-Ionuț

DISCLAIMER

This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.