doubt72 / kitchen-metal

A metal driver for Test Kitchen.
Other
38 stars 5 forks source link

Example to make kitchen-metal work #2

Open esciara opened 10 years ago

esciara commented 10 years ago

Hi there,

I am trying to toy around with kitchen-metal but cannot get it to work by following the instruction in the README.md file. Would it be possible to have a working example so we can get it to work (and eventually contribute)?

Here is what I have done so far, using mostly things from the Chef Metal repo as is today.

I have modified my Gemfile to include the following:

group :kitchen_common do
  gem 'test-kitchen', :path => '../../git-repos/chef-metal-repos/doubt72-test-kitchen-chef-metal-branch/'
end

group :chef_metal do
  gem 'kitchen-metal', :path => '../../git-repos/chef-metal-repos/kitchen-metal'
  gem 'cheffish', :git => 'https://github.com/jkeiser/cheffish.git'
  gem 'chef-metal-vagrant', :path => '../../git-repos/chef-metal-repos/chef-metal-vagrant'
  gem 'chef-metal-fog', :path => '../../git-repos/chef-metal-repos/chef-metal-fog'
end

I did a bundle update, which worked well.

I created the .kitchen.metal.yml, which I made sure is used by kitchen by doing an export KITCHEN_YAML=.kitchen.metal.yml:

driver:
  name: metal
  layout: smaller.rb

provisioner:
  name: chef_metal

platforms:
  - name: vagrant-linux.rb

The smaller.rb is in the kitchen root directory and is a cut down version of the small.rb file given as exemple in Chef Metal, just to make sure it works in its simplest form:

machine 'mario' do
  tag 'mydb_master'
  action [:delete, :create]
end

The vagrant-linux.rb is a straight merge of the vagrant.rb file in Chef Metal and the linux.rb file:

require 'cheffish'
require 'chef_metal_vagrant'

# Set up a vagrant cluster (place for vms) in ~/machinetest
vagrant_cluster "#{ENV['HOME']}/machinetest"

# Use a Linux image
vagrant_box 'precise64' do
  url 'http://files.vagrantup.com/precise64.box'
end

I have actually made both these .rb files work in chef-metal, so I am sure problems would not come from them.

When I do a bundle exec kitchen converge with these, I get the following message:

-----> Starting Kitchen (v1.2.2.dev)
>>>>>>
No instances for regex `', try running `kitchen list'

Usage:
  kitchen converge [INSTANCE|REGEXP|all]

Options:
  -c, [--concurrency=N]              # Run a converge against all matching instances concurrently. Only N instances will run at the same time if a number is given.
  -p, [--parallel], [--no-parallel]  # [Future DEPRECATION, use --concurrency] Run a converge against all matching instances concurrently.
  -l, [--log-level=LOG_LEVEL]        # Set the log level (debug, info, warn, error, fatal)

Converge one or more instances

As you can see, it does not find any instances.

Running bundle exec kitchen list as suggested returns exactly the same output, except for the last line which is:

Lists one or more instances

As said, a working example would be nice! :)

doubt72 commented 10 years ago

Hi! Thanks for your interest, and sorry for the slow reply; I've been involuntarily OOTO and behind on my github email and all that.

At this point, I want to ask you for a little more of your patience; while things were up and running on my machine a couple weeks ago, it turns out there were a few quirks about my environment that made it difficult to get running elsewhere (as well as things that needed fixing up, like the dependencies in the gemspec). At this exact moment I'm working on cleaning those out, but more importantly, I'm working on making some changes to Test Kitchen to better integrate the driver and which will in turn entail changes in the .kitchen.yml file (i.e., making nodes first-class configuration items). So while I might be able to give you a better config that works right now, it almost certainly won't work with a newer version of the driver in a couple of days.

Once that's done, hopefully I can get the Test Kitchen changes merged back into the master version of TK (or get something like them merged), which among other things would allow things to work without being forced to use bundler (since the gem directory and the kitchen directory shouldn't need to be the same, etc.)

But... Once these changes are in, I'd be more than happy to work with you to get things up and running (and hopefully an updated README at that point would be enough, even), but in the meantime... I hope you can hold on a little longer?

[In practical terms, though, you're going to need a suite in your .kitchen.yml, I think that may be causing the immediate error, but without setting up another environment other than the one I'm actively working in, I can't verify that.]

If you've got any questions or concerns or other feedback in the meantime, feel free to reach out, I'd be happy to talk.

doubt72 commented 10 years ago

Also... Leaving this open until I can give you a working config and you can tell me it works.

esciara commented 10 years ago

Thanks @doubt72 . Let me know when I can help out! Em

doubt72 commented 10 years ago

A long, long overdue update -- much has been happening.

The main thing is that Chef Metal has still been in flux; we've been changing a LOT of things (mainly @jkeiser, but I've been helping with that a bit), and that has resulted in a near-complete rewrite of the driver here as well.

So... The first thing is that the gem as-is and a .kitchen.yml like the one in the README should now work as long as you install the branch of test-kitchen and have the right files in place. That said, I'm not sure I can recommend using it quite yet.

The reason being is that the overall plan for how things will move forward is strongly in flux (though I'm hoping we'll have a bit more clarity soon, there are a lot of people that need to talk to other people in various places). I'm not sure if we'll be trying to merge the node changes into the main test-kitchen or if we might end up doing something else; in the long run we have a vision of merging this driver into the core of test-kitchen itself and supporting arbitrary recipes in the .kitchen.yml... Who know what will actually end up happening, though.

So, if you want to play with it, it's hopefully in a good state for that, but do know that things are probably going to change (I always seem to be saying that). I'm happy to answer questions if you have any and I'm more than happy to help you out if you have issues with it if I can. I am, however, rolling off this project, so I'm not going to be able to devote much time to any big fixes.

doubt72 commented 10 years ago

An update: we've decided to just PR/see about merging the current kitchen changes needed for this driver (https://github.com/test-kitchen/test-kitchen/pull/451); so this may be useful soon, we'll see.

Let me know if you have any questions or anything.

esciara commented 10 years ago

Thanks for the update. Looking forward to see the thing when it has matured! Will wait until is has stabilised a bit before digging into it.

joshzitting commented 10 years ago

Hey are there any recent developments on this? We need something like this to run some testing a soon to be chef-metal env... Thanks for your hard work. I wish I were more competent so I could help!

JBBSS commented 9 years ago

Any update on this? I have been experimenting as well and can not seem to find a way to keep a stable kitchen-metal setup going.

doubt72 commented 9 years ago

I don't have any bandwidth to maintain this right now, and Chef-Metal has drifted in incompatable ways. For the short term, unless somebody steps up to fork/fix/maintain it, it's not going to work until I have time to get back to it, and with other deadlines on other things, no idea when that might be.

That and the fact that the node changes PR for test kitchen is still in limbo, so it only works with an old branched version of test kitchen, well, I wouldn't really recommend using this until that's dealt with, and that's not in my hands, either.

esciara commented 9 years ago

Hi there. Any update on this? Is it abandoned? (Assuming so since PR test-kitchen/test-kitchen#451 has not been pulled yet) There are some reference of kitchen-metal in https://github.com/opscode/chef-provisioning/blob/master/README.md, even though it would not work.