Skip to content
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

Cluster support with Kitchen #905

Closed
Lax77 opened this issue Jan 7, 2016 · 9 comments
Closed

Cluster support with Kitchen #905

Lax77 opened this issue Jan 7, 2016 · 9 comments

Comments

@Lax77
Copy link

Lax77 commented Jan 7, 2016

I have a use case where I need to spin off a cluster (A Master and multiple Slaves) and run test suites against them.

  • Would like Master node aware of Slave nodes and vice versa
  • Carry out regular checks on master instance to ensure all the expected SW components are installed and running
  • Similarly on Slave nodes check expected software components are installed and running

So far I could get both Master & Slave deployed on a single Instance with kitchen and run my test suites. However I am interested to have Kitchen launch separate instance for Master & Slave and run test suites. Is this possible with Kitchen? Any pointers are appreciated.

@cheeseplus
Copy link

tl;dr This is not possible with test-kitchen currently.

Longer version:
This has been something folks have been punting around for at least 2 years in the community but at present is still very much out of scope for TK. It's something a lot of us think would be neat but the TK design has always been targeted at doing one thing and doing it well. If we do take it on, it will be after paying off a bunch of technical debt before adding any more features - ideally this would be something we could abstract to a driver and keep out of core TK if possible.

@mwrock
Copy link
Member

mwrock commented Jan 7, 2016

Just to throw out how you might accomplish this today is to use the kitchen-nodes plugin that will allow nodes to use chef search and find each other in kitchen runs.

The clunky thing is you do need to create/converge the nodes separately. You can orchestrate this in a rakefile. Something like this:

  desc "run integration tests"
  task :integration do
    system('kitchen destroy')
    system('kitchen converge primary-windows-2012R2')
    system("kitchen exec primary-windows-2012R2 -c 'Restart-Computer -Force'")
    system('kitchen converge backup-windows-2012R2')
    system("kitchen exec backup-windows-2012R2 -c 'Restart-Computer -Force'")
    system('kitchen verify primary-windows-2012R2')
    system('kitchen verify backup-windows-2012R2')
  end

Clunky but it works.

I blogged about doing this with kitchen/docker/couchbase here.

@Lax77
Copy link
Author

Lax77 commented Jan 7, 2016

Thanks for the responses. Still wish it was supported with TK. Are there any other tool, you guys aware of will help in this space outside TK?

Matt, will try out the kitchen-nodes. Thanks for the pointer to the blog.

@cheeseplus
Copy link

We all, at various points, wish it was supported as well but it's a drastic divergence from our core competence. We'd love to add it but the effort/dedication required is significant not to mention there is plenty of debt that needs to be paid off first. There really aren't any great alternatives that I am aware of but the related projects may be helpful even if dated.

Related projects:
https://github.com/chrisroberts/vagabond - tried to do this by wrapping TK but is kinda niche as it requires Librarian (vs Berkshelf) also not touched for a bit
https://github.com/Atalanta/leibniz - author left the project and it's been kinda unmaintained

@Lax77
Copy link
Author

Lax77 commented Jan 11, 2016

Ok, Thanks for the pointers Seth

@cheeseplus cheeseplus added this to the Later milestone Jan 13, 2016
@cheeseplus
Copy link

Closing this in favor of #873

@neillturner
Copy link
Contributor

i'm doing this with kitchen-ansible but that's because ansible support remote ssh. see http://ec2dream.blogspot.co.uk/2015/12/automated-devops-with-test-kitchen.html
to me if chef could run in a remote ssh fashion like ansible then this would be easy.

@Lax77
Copy link
Author

Lax77 commented Feb 13, 2016

Interesting way to connect, thanks for sharing.

To get around the cluster limitation, I ended up creating 2 flows in my
case.

  1. Single Node Testing
    • Use Kitchen + Ansible Spec
    • Fire up single instance
    • Provision infra (Master and Slave both)
    • Fire up the test suite
  2. For cluster testing ( Vagrant + Ansible for provision, Serverspec + Rake
    for firing test suites)
    • Have Vagrant to provision cluster
      • Which means fire up cluster(multiple masters and slave instances) on
        env of choice (Virtual (Virtual Box) / Cloud (EC2, Open Stack, RackSpace,
        etc))
    • Provision infra with Ansible on each of the instance that vagrant
      provisioned
  3. Generate Inventory file(either manually or dynamically) for my cluster,
    basically detailing IP and server roles(Master/Slave) etc.
  4. Use Serverspec + Rake to connect to the provisioned cluster and fire up
    test suites

Also as I didn't want to maintain separate test cases for both the flows, I
ended up tweaking Rake definition to look up the test suites that were
written for Kitchen.

On Fri, Feb 12, 2016 at 11:24 AM, Neill Turner notifications@github.com
wrote:

i'm doing this with kitchen-ansible but that's because ansible support
remote ssh. see
http://ec2dream.blogspot.co.uk/2015/12/automated-devops-with-test-kitchen.html
to me if chef could run in a remote ssh fashion like ansible then this
would be easy.


Reply to this email directly or view it on GitHub
#905 (comment)
.

@retr0h
Copy link

retr0h commented Sep 2, 2016

For you ansible fans, check out molecule. This solves your particular issues with test-kitchen.

@test-kitchen test-kitchen locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants