Giter Club home page Giter Club logo

kitchen-bluebox's Introduction

Kitchen::Bluebox: A Test Kitchen Driver for Blue Box Blocks

Gem Version Build Status Code Climate

A Test Kitchen Driver for Blue Box Blocks.

This driver uses the fog gem to provision and destroy blocks instances. Use Blue Box's cloud for your infrastructure testing!

Requirements

There are no external system requirements for this driver. However you will need access to a Blue Box account.

Installation and Setup

Please read the Driver usage page for more details.

Configuration

bluebox_customer_id

Required The Blue Blue customer id to use.

The default is unset, or nil.

bluebox_api_key

Required The Blue Blue api key to use.

The default is unset, or nil.

flavor_id

The blocks product type (also known as size) to use.

The default is "94fd37a7-2606-47f7-84d5-9000deda52ae".

image_id

The blocks template id to use.

The default is "573b8e80-823f-4100-bc2c-51b7c60f633c".

location_id

The blocks location to use.

The default is "37c2bd9a-3e81-46c9-b6e2-db44a25cc675".

port

The SSH port number to be used when communicating with the instance.

The default is 22.

ssh_key

Path to the private SSH key used to connect to the instance.

The default is unset, or nil.

username

The SSH username that will be used to communicate with the instance.

The default is "kitchen".

Example

The following could be used in a .kitchen.yml or in a .kitchen.local.yml to override default configuration.

---
driver:
  name: bluebox
  bluebox_customer_id: 123...
  bluebox_api_key: abc...
  location_id: def789...
  ssh_public_key: /path/to/id_dsa.pub
  ssh_key: /path/to/id_dsa

platforms:
  - name: ubuntu-12.04
    driver:
      image_id: b137c423-bade-4b01-9d13-271eea552563
  - name: scientific-6.3
    driver:
      image_id: caaaca6b-fbe0-4e27-af2b-d100e46767bd

suites:
  - name: default

Both .kitchen.yml and .kitchen.local.yml files are pre-processed through ERB which can help to factor out secrets and credentials. For example:

---
driver:
  name: bluebox
  bluebox_customer_id: <%= ENV['BLUEBOX_CUSTOMER_ID'] %>
  bluebox_api_key: <%= ENV['BLUEBOX_API_KEY'] %>
  ssh_public_key: <%= File.expand_path('~/.ssh/id_dsa.pub') %>
  ssh_key: <%= File.expand_path('~/.ssh/id_dsa') %>

platforms:
  - name: ubuntu-12.04
    driver:
      image_id: b137c423-bade-4b01-9d13-271eea552563
  - name: scientific-6.3
    driver:
      image_id: caaaca6b-fbe0-4e27-af2b-d100e46767bd

suites:
  - name: default

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Authors

Created by Fletcher Nichol ([email protected]) and maintained by Blue Box Group

License

Apache 2.0 (see LICENSE)

kitchen-bluebox's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kitchen-bluebox's Issues

need better feedback when a cookbook is missing

It is not obvious that a cookbook is missing

The failure you see in kitchen-vagrant when a cookbook is missing:

[Berkshelf] Using build-essential (1.2.0)
[Berkshelf] Using windows (1.7.0)
[Berkshelf] Using chef_handler (1.1.4)
[Berkshelf] Using logrotate (1.0.2)[Berkshelf] Using ark (0.1.0)
[Berkshelf] Using bluepill (2.2.0)
[Berkshelf] Using rsyslog (1.5.0)
[Berkshelf] Using ohai (1.1.6)
[Berkshelf] Using openssl (1.0.0)
STDERR: Berkshelf::CookbookNotFound: Cookbook 'bluebox' not found in any of the default locations
---- End output of vagrant up --no-provision ----
Ran vagrant up --no-provision returned 1]
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:277:in action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:249:inperform_action'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:228:in create_action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:222:inblock in transition_to'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:in each' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:intransition_to'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:143:in verify' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:172:inblock in test'
from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:in measure' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:168:intest'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in public_send' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inblock in run_serial'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in map' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inrun_serial'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:110:in block in test' from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:inmeasure'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:102:in test' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:inrun'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in invoke_task' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:229:ininvoke_task'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor.rb:275:in dispatch' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:instart'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/bin/kitchen:12:in <top (required)>' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:inload'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:in `

'

The failure you see in kitchen-bluebox when a cookbook is missing:

[06:06:33 dhcp121:~/git_repos/cookbooks/squash][master*] $ be kitchen test
-----> Starting Kitchen
-----> Cleaning up any prior instances of
-----> Destroying
DEBUG: test
Finished destroying (0m0.00s).
-----> Testing
-----> Creating
DEBUG: state is {}
Blocks instance created.
............................. (server ready)
(ssh ready)

   DEBUG: test
   Finished creating <default-scientific-63> (0m55.11s).

-----> Converging
-----> Installing Chef Omnibus (10.22)
Downloading Chef for el...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 14.4M 100 14.4M 0 0 1251k 0 0:00:11 0:00:11 --:--:-- 1616k
Installing Chef
warning: /tmp/tmp.fezZMoA1/chef-.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
Preparing... ##### ########################################### [100%]
1:chef ########################################### [100%]
Thank you for installing Chef!
[local command] BEGIN (if ! command -v berks >/dev/null; then exit 1; fi)
[local command] END (0m0.01s)
[local command] BEGIN (berks install --path /var/folders/b_/xydcbx6n5v95btgc5j_wp7qr0000gn/T/default-scientific-63-cookbooks20130401-92307-ecdubr)
Using squash (0.1.0) at path: '/Users/scooper/git_repos/cookbooks/squash'
Using yum (2.1.0)
Using apt (1.8.4)
Using git (2.1.2)
Installing java (1.10.0) from git: 'git://github.com/opscode-cookbooks/java.git' with branch: 'c9fe9875b2e4f764847070972b5a2559b1d72cd3'
Installing jboss (0.0.13) from git: 'git://github.com/sandfish8/chef-jboss.git' with branch: 'bluebox'
Installing maven (0.15.0) from git: 'git://github.com/bbg-cookbooks/maven.git' with branch: '23b2e9393fd9ba3f505565a761292c58344177dd'
Installing ruby_build (0.7.2) from git: 'git://github.com/fnichol/chef-ruby_build.git' with branch: 'c940b5e9cd40eaba10d6285de6648f4d25fe959d'
Installing rbenv (0.7.3) from git: 'git://github.com/fnichol/chef-rbenv.git' with branch: '3b1c59abc1134a50b0b8844954eca9a566aaffb8'
Installing nginx (1.1.2) from git: 'git://github.com/bbg-cookbooks/nginx.git' with branch: 'bluebox'
Using unicorn (1.1.0)
Installing postgresql (2.2.2) from git: 'git://github.com/opscode-cookbooks/postgresql.git' with branch: '1dfa582a9b844c3cbe6019a3ddb831af004dce52'
Installing bbg_repositories (0.1.1) from git: '[email protected]:chef/bbg_repositories.git' with branch: '565973bfd289bf65b573f5be7efaccbc3adbd0b0'
Installing user (0.3.0) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks'
Using dmg (1.0.0)
Using runit (0.15.0)
Using build-essential (1.2.0)
Using windows (1.7.0)
Using chef_handler (1.1.4)
Using logrotate (1.0.2)
Using ark (0.1.0)
Using bluepill (2.2.0)
Using rsyslog (1.5.0)
Using ohai (1.1.6)
Using openssl (1.0.0)
[local command] END (0m35.89s)
/Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:274:in rescue in action': Failed to complete #converge action: [can't convert nil into String] (Kitchen::ActionFailed) from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:277:inaction'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:249:in perform_action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:232:inconverge_action'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:222:in block in transition_to' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:ineach'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:in transition_to' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:143:inverify'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:172:in block in test' from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:inmeasure'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:168:in test' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inpublic_send'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in block in run_serial' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inmap'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in run_serial' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:110:inblock in test'
from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:in measure' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:102:intest'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in run' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:ininvoke_task'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:229:in invoke_task' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor.rb:275:indispatch'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in start' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/bin/kitchen:12:in<top (required)>'
from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:in load' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:in

'

Consider computed defaults for several configuration options

Hey there!

Just floating a suggestion (and can definitely help with an implementation) about adding smarter defaults for the following configuration options:

  • location_id
  • flavor_id
  • image_id

There is currently support in Test Kitchen drivers to "compute" or dynamically calculate a default value for a configuration option based on other values or state. For example, in the EC2 driver, the image_id depends on the Platform name and the region you are in. I dumped this information in raw JSON so that it might be easier to maintain in the long run as code doesn't need to be updated.

It's my recollection that the location_id and flavor_id options are consistent UUIDs as are the image_id values across locations. What I couldn't remember was whether or not the image_id values change over time as images are rebuilt.

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.