cookbook 'cwb', '~> 0.1.3'
cwb (4) Versions 0.1.3 Follow0
Installs/Configures cwb
cookbook 'cwb', '~> 0.1.3', :supermarket
knife supermarket install cwb
knife supermarket download cwb
Cloud WorkBench Cookbook (CWB Cookbook)
This cookbook prepares a machine for CWB benchmarks.
Attributes
Logging
default['benchmark']['logging_enabled'] = false
System Specific
# This attribute will overwrite owner and group if present default['benchmark']['ssh_username'] = nil default['benchmark']['owner'] = 'ubuntu' default['benchmark']['group'] = 'ubuntu'
Resource
Use the cwb_benchmark
resource to define a benchmark. Make sure you place the Ruby implementation of the benchmark within files/default/benchmark_name.rb
.
Take care of correct naming! Example:
* Cookbook and benchmark name: http-benchmark
(hyphen)
* Ruby benchmark implementation: http_benchmark
(underscore)
* Ruby benchmark class name: HttpBenchmark
(CamelCase => HTTPBenchmark is wrong!)
cwb_benchmark 'benchmark-name'
Libraries
cwb_defaults(self)
Instead of hardcoding owner
and group
you should use the cwb_defaults(self)
utility method:
file '/tmp/something' do cwb_defaults(self) action :create end
Cwb::BenchmarkUtil
Provides path utilities for your benchmark.
Example usage within your recipe:
my_bench = Cwb::BenchmarkUtil.new('benchmark-name', node) cwb_benchmark my_bench.name # Create a config file from a template that should reside # at the same directory as the Ruby benchmark file. template my_bench.path_for('config.ini') do cwb_defaults(self) source 'config.ini.erb' end
Cwb::Util
Cwb::Util.root_dir(node) cwb_util = Cwb::Util.new(node) cwb_util.root_dir
Usage
cwb::default
You should not explicitly include the cwb::default
recipe within your cookbooks. Instead the CWB Server will take care of adding cwb to the Chef run list.
Internal Structure
The cwb::core
recipe prepares the following structure for benchmarks that are subsequently added by custom benchmark cookbooks.
Do NOT rely in this internal structure as it might change in the future.
.
├── benchmark_suite.txt [single benchmark suite to be executed]
├── benchmarks.txt [ordered list of benchmarks to be executed]
├── node.yml [hash of Chef node attributes]
├── app-bench
│ └── app_bench.rb
├── micro-bench
│ └── micro_bench.rb
├── my-bench
│ └── my_bench.rb
│ └── config.ini
cwb CLI
The command line utility is able to execute single benchmarks in isolation or an entire benchmark suite. The default benchmark suite will execute all benchmarks according to the order in benchmarks.txt
which reflects the recipe order in the Chef run list.
cwb execute micro-bench/micro_bench.rb cwb execute .
Notes
- This cookbook monkypatches the String class by adding the utility methods
camelize
andunderscore
. These methods are for internal use, do NOT depend on them.
Development
Integration Tests
Requirements: VirtualBox , Vagrant, and vagrant plugin install vagrant-omnibus
kitchen list kitchen converge kitchen verify
All together with kitchen test
Publish Cookbook
Publish Chef Cookbook to Chef Supermarket (only for owners)
Bump version in metadata.rb
knife cookbook site share "cwb" "Other" git tag -a cwb/v0.1.X -m 'COMMENT' git push origin --tags
License and Authors
Author:: Joel Scheuner (joel.scheuner.dev@gmail.com)
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
0.1.3 (2016-07-25)
- Fix metadata request for google provider to obtain the
provider_instance_id
0.1.2 (2015-04-29)
- Fix
cookbook
attribute implementation forcwb_benchmark
andcwb_benchmark_suite
implementations
0.1.1 (2015-04-27)
- Introduce the
benchmark.logging_enabled
attribute to replacebenchmark.redirect_io
- Fix internal resource duplication issue that prevented adding multiple benchmarks (internally using attribute now)
- Add integration tests
- Restructure README.md docs
- Add additional code documentation
- Ensure consistent use of quotes preferring single quotes
'
0.1.0 (2015-04-25)
- Initial release of cwb
Collaborator Number Metric
0.1.3 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.3 failed this metric
FC064: Ensure issues_url is set in metadata: cwb/metadata.rb:1
FC065: Ensure source_url is set in metadata: cwb/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cwb/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: cwb/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:32
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:39
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:51
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:58
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:66
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:81
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:32
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:44
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:56
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:64
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:72
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.3 passed this metric
Testing File Metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.3 failed this metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.3 failed this metric
FC064: Ensure issues_url is set in metadata: cwb/metadata.rb:1
FC065: Ensure source_url is set in metadata: cwb/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cwb/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: cwb/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:32
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:39
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:51
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:58
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:66
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:81
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:32
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:44
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:56
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:64
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:72
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.3 passed this metric
Testing File Metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.3 failed this metric
FC065: Ensure source_url is set in metadata: cwb/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cwb/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: cwb/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:32
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:39
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:51
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:58
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:66
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark.rb:81
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:32
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:44
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:56
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:64
FC085: Resource using new_resource.updated_by_last_action to converge resource: cwb/providers/benchmark_suite.rb:72
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.3 passed this metric
Testing File Metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.3 failed this metric
0.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number