-
Notifications
You must be signed in to change notification settings - Fork 584
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
gem_package using chef_zero installing packages into /tmp/kitchen-chef-zero making binstubs unavailable to chef #240
Comments
As a follow-up, I rolled things back to using test-kitchen v1.0.0-beta3 and the recipe worked as expected. |
@schisamo there have been a few bugs around this that make me suspect the sandboxed stuff, but it's only a suspicion. |
This def looks like an issue caused by the sandbox. I'll take a look and see what we can do to bust the sandbox. — On Tue, Nov 5, 2013 at 3:54 PM, John Keiser notifications@github.com
|
This ensures gems installed via gem_package land in Chef's GEM_HOME.
^^ @adnichols I used your repo to verify the above commit fixes things. If you don't want to wait for the next TK release you can just clone this repo and do a I also wanted to share share with you a simplified
I was able to remove quite a bit since you had many of the defaults: One great thing about using the default values for box name is these boxes will be installed only once as you move between Test Kitchen-enabled cookbooks that leverage the same default values. |
Fixed in 55c69d4 |
This ensures gems installed via gem_package land in Chef's GEM_HOME.
Awesome - thanks folks for the fast turnaround. Also, definitely appreciate the simplified kitchen.yml - we auto-generate ours so it's generally consistent across cookbooks but if we can simplify it, all the better. I'll give this a whirl tomorrow and holler if we run into any problems. |
@schisamo Is this related as well? https://gist.github.com/petecheslock/bb464c1ebb5ec12f49d7 Happens on a |
@petecheslock When was that instance last built? I made this fix in busser-serverspec recently: |
@petecheslock Try to rebuild the instance OR blow away |
@schisamo Actually spoke too soon - did another test and it TK specific - but somehow related to TK on HEAD (vs tk beta.3) https://gist.github.com/petecheslock/5754e7f196e9c8892f4c In the gist - you can see the test pass in beta.3 - but in beta 4 or HEAD it fails. The test is to look at the gems install in the omnibus package (chef in this case). but most interesting is that I can't run the "chef-client --version" command either because it can't find chef gem. |
@petecheslock Can you please open a separate issue and I'll try to figure out a fix. |
The current strategy here is to install a modern version of Chef into the gem sandbox directory outside of the Omnibus installation in order to get Chef Zero, the Knife Essentials code which was folded into Chef. Next we change the chef-client-zero.rb wrapper script to setup the Chef Zero server and finally fork-and-exec the `chef-client` run in order to use the `chef-client` binary found in PATH. This would normally correspond to /usr/bin/chef-client which is a symlink to the Omnibus Chef package install in most cases. Otherwise if Chef is installed somewhere else found on the path, this will be used instead. Granted installing Chef twice over (once for the Omnibus install and once by gem install for Chef Zero) is tedious but this will be remedied in a later commit to only use the chef-client-zero.rb wrapper if the desired version of Chef is less than 11.8.0. Closes #243 References #240 References #224
We ran into this with bluepill so I'll use that as the example. Take a cookbook which depends on the 'bluepill' cookbook and starts a simple service:
Cookbook available here: https://github.com/adnichols/test-gem.git
If I converge this cookbook in test-kitchen I run into the following error when it tries to start the service via bluepill:
Indeed this is accurate - if I login to the box after being converged, the bluepill binstub isn't available in the path:
It appears that bluepill is actually being installed under the test-kitchen ruby but is not functional there:
It's unclear to me why this is happening. This was not happening before we updated to beta4, but that update also pulled in chef 11.8 and we aren't sure which is causing the problem.
We also created a cookbook which simply performs a gem_package 'bluepill' and it behaved the same way installing the bluepill gem into a location which isn't in the normal chef path.
This problem appears to be specific to using chef_zero inside test-kitchen. If we use chef_solo this works fine under both chef 11.6 & 11.8.
We have also observed that using the "require_chef_omnibus:" parameter in our .kitchen.yml doesn't appear to affect the version of chef which is used when using chef_zero. This appears to be related to the installation of knife-essentials which pulls in the latest version of chef, and that version appears to be used to converge the system vs. the omnibus installed version.
The other thing we tried, and we may be misunderstanding what this does, is to set "ruby_binpath:" that was added in #225 . This doesn't seem to change the ruby that is used during the converge, but that may not be the purpose.
We aren't able to move forward with our cookbooks which rely on bluepill and we assume this same problem will impact testing any cookbook which installs gems via gem_package. Can someone advise either a workaround or a solution to this?
The text was updated successfully, but these errors were encountered: