Skip to content

Commit

Permalink
Merge pull request #266 from tas50/cairoffi
Browse files Browse the repository at this point in the history
Require Python 2.7 + Update dependencies to match the graphite docs
  • Loading branch information
tas50 committed Dec 9, 2016
2 parents 6cebb4d + 8b667a5 commit aa5ce13
Show file tree
Hide file tree
Showing 55 changed files with 166 additions and 175 deletions.
32 changes: 20 additions & 12 deletions .kitchen.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,60 +19,68 @@ platforms:
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install lsb-release procps -y
- RUN /usr/bin/apt-get install lsb-release procps net-tools -y

- name: debian-8
driver:
image: debian:8
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install lsb-release -y

- name: centos-6
driver:
image: centos:6
platform: rhel
pid_one_command: /sbin/init
intermediate_instructions:
- RUN yum -y install which initscripts
- RUN /usr/bin/apt-get install lsb-release procs net-tools -y

- name: centos-7
driver:
image: centos:7
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install lsof which systemd-sysv initscripts
- RUN yum -y install lsof which systemd-sysv initscripts wget net-tools

- name: fedora-latest
driver:
image: fedora:latest
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN dnf -y install yum which systemd-sysv initscripts
- RUN dnf -y install yum which systemd-sysv initscripts wget net-tools

- name: ubuntu-12.04
driver:
image: ubuntu-upstart:12.04
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: ubuntu-14.04
driver:
image: ubuntu-upstart:14.04
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: ubuntu-16.04
driver:
image: ubuntu:16.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https lsb-release procps net-tools -y

- name: opensuse-13.2
driver:
image: opensuse:13.2
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which net-tools

- name: opensuse-42.1
driver:
image: opensuse:42.1
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which hostname

suites:
- name: default
Expand Down
3 changes: 0 additions & 3 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ verifier:
name: inspec

platforms:
- name: centos-6.8
- name: centos-7.2
- name: debian-7.11
- name: debian-8.5
- name: fedora-24
run_list: yum::dnf_yum_compat
- name: ubuntu-12.04
- name: ubuntu-14.04
- name: ubuntu-16.04
Expand Down
46 changes: 13 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,27 @@
sudo: required
dist: trusty

# install the pre-release chef-dk. Use chef-stable-trusty to install the stable release
# Use Travis's cointainer based infrastructure
sudo: false
addons:
apt:
sources:
- chef-current-trusty
- chef-current-precise
packages:
- chefdk

# Don't `bundle install` which takes about 1.5 mins
# Don't `bundle install`
install: echo "skip bundle install"

branches:
only:
- develop
- master

services: docker

env:
matrix:
- INSTANCE=default-centos-6
- INSTANCE=default-centos-7
- INSTANCE=default-debian-7
- INSTANCE=default-debian-8
- INSTANCE=default-ubuntu-1204
- INSTANCE=default-ubuntu-1404
- INSTANCE=default-ubuntu-1604

# Ensure we make ChefDK's Ruby the default
before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(/opt/chefdk/bin/chef shell-init bash)"

script: KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}

matrix:
include:
- before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
- script:
- /opt/chefdk/bin/chef exec rake
env: UNIT_AND_LINT=1
# We have to install chef-sugar for ChefSpec
- /opt/chefdk/embedded/bin/chef gem install chef-sugar

script:
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
- /opt/chefdk/bin/chef exec rake
1 change: 0 additions & 1 deletion Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ source 'https://supermarket.chef.io'
metadata

group :integration do
cookbook 'yum'
cookbook 'graphite_example', path: './example/graphite_example'
end
39 changes: 21 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
Graphite CHANGELOG
===================
# Graphite CHANGELOG

This file is used to list changes made in each version of the graphite cookbook.

## 1.0.4

- Syntax and styling updates
- Use full Twisted version number
- Manage graphite nofile ulimit
- Fixes carbon source
- Adds License and Code of Conduct

### Known Issues
- Reordering of Carbon .ini [241](https://github.com/hw-cookbooks/graphite/issues/241)
- Graphite web timeout when restarting [224](https://github.com/hw-cookbooks/graphite/issues/224)

- Reordering of Carbon .ini [241](https://github.com/sous-chefs/graphite/issues/241)
- Graphite web timeout when restarting [224](https://github.com/sous-chefs/graphite/issues/224)

## 1.0.2
- README improvements to address resource usage and removal of Apache
dependency ([@webframp][], [#187][])
- restart graphite-web in graphite_example sample recipe ([@obazoud][], [#182][])
- remove unused `['graphite']['web_server']` attribute ([@obazoud][], [#181][])

- README improvements to address resource usage and removal of Apache dependency ([@webframp], [#187])
- restart graphite-web in graphite_example sample recipe ([@obazoud], [#182])
- remove unused `['graphite']['web_server']` attribute ([@obazoud], [#181])

## 1.0.1

- Readme improvements.

## 1.0.0

### Breaking Changes
- Initial release of graphite library style cookbook. Complete rewrite
of cookbook to provide reusable resources. Breaks backward
compatibility with cookbook version prior 1.0. ([@webframp][], [@fnichol][],
[@agoddard][])

<!--- The following link definition list is generated by PimpMyChangelog --->
[#181]: https://github.com/hw-cookbooks/graphite/issues/181
[#182]: https://github.com/hw-cookbooks/graphite/issues/182
[#187]: https://github.com/hw-cookbooks/graphite/issues/187

- Initial release of graphite library style cookbook. Complete rewrite of cookbook to provide reusable resources. Breaks backward compatibility with cookbook version prior 1.0\. ([@webframp], [@fnichol], [@agoddard])

<!-- - The following link definition list is generated by PimpMyChangelog - -->

[#181]: https://github.com/sous-chefs/graphite/issues/181
[#182]: https://github.com/sous-chefs/graphite/issues/182
[#187]: https://github.com/sous-chefs/graphite/issues/187
[@agoddard]: https://github.com/agoddard
[@fnichol]: https://github.com/fnichol
[@obazoud]: https://github.com/obazoud
[@webframp]: https://github.com/webframp
[@webframp]: https://github.com/webframp
8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ The develop branch is the current edge of development.

## Pull requests

* https://github.com/hw-cookbooks/graphite/pulls
- <https://github.com/sous-chefs/graphite-cookbook/pulls>

Please base all pull requests of the `develop` branch. Merges to
`master` only occur through the `develop` branch. Pull requests
based on `master` will likely be cherry picked.
Please base all pull requests of the `develop` branch. Merges to `master` only occur through the `develop` branch. Pull requests based on `master` will likely be cherry picked.

## Issues

Need to report an issue? Use the github issues:

* https://github.com/hw-cookbooks/graphite/issues
- <https://github.com/sous-chefs/graphite-cookbook/issues>
36 changes: 28 additions & 8 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
#!/usr/bin/env ruby
# ^syntax detection

opts = '--color --format progress'
require 'cookstyle'

guard 'rspec', cmd: "bundle exec rspec #{opts}" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^(libraries|providers|recipes|resources)/(.+)\.rb$}) { |m| "spec/#{m[1]}/#{m[2]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
watch(%r{^spec/fixtures/.+$}) { 'spec' }
guard :rubocop, keep_failed: false, cli: '-r finstyle' do
watch(/.+\.rb$/) { |m| m[0] }
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end

guard 'foodcritic', cookbook_paths: '.', cli: '-C -t ~FC001' do
watch(%r{attributes/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
end

spec_path = 'test/unit'
rspec_guard_config = {
cmd: "bundle exec rspec --color --format progress --default-path=#{spec_path}",
all_on_start: true,
spec_paths: [spec_path]
}

guard 'rspec', rspec_guard_config do
watch(%r{^#{spec_path}/.+_spec\.rb$})
watch("#{spec_path}/spec_helper.rb") { spec_path }
watch(%r{^(libraries|providers|recipes|resources)/(.+)\.rb$}) do |m|
"#{spec_path}/#{m[2]}_spec.rb"
end
end
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Graphite Cookbook

[![Build Status](https://travis-ci.org/hw-cookbooks/graphite.svg?branch=master)](https://travis-ci.org/hw-cookbooks/graphite) [![Code Climate](https://codeclimate.com/github/hw-cookbooks/graphite/badges/gpa.svg)](https://codeclimate.com/github/hw-cookbooks/graphite) [![Cookbook Version](https://img.shields.io/cookbook/v/graphite.svg)](https://supermarket.chef.io/cookbooks/graphite)
[![Build Status](https://travis-ci.org/sous-chefs/graphite.svg?branch=master)](https://travis-ci.org/sous-chefs/graphite) [![Code Climate](https://codeclimate.com/github/sous-chefs/graphite/badges/gpa.svg)](https://codeclimate.com/github/sous-chefs/graphite) [![Cookbook Version](https://img.shields.io/cookbook/v/graphite.svg)](https://supermarket.chef.io/cookbooks/graphite)

## Description

Expand All @@ -17,22 +17,22 @@ Consult the Graphite documentation for more information:

- Ubuntu
- Debian
- RHEL and derivatives (Centos, Amazon Linux, Oracle Linux, Scientific Linux)
- Fedora
- RHEL 7+ (RHEL 6 lacks Python 2.7)

### Chef

- Chef 11+

### Cookbooks

- python
- runit
- build-essential
- yum-epel

## Attributes

See [default attributes](https://github.com/hw-cookbooks/graphite/blob/master/attributes/default.rb#L48) for platform specific packages installed.
See [default attributes](https://github.com/sous-chefs/graphite/blob/master/attributes/default.rb#L48) for platform specific packages installed.

- `node['graphite']['version']` - package version to install, defaults to '0.9.12'
- `node['graphite']['twisted_version']` - twisted version to pin to, defaults to '13.1'
Expand Down Expand Up @@ -106,9 +106,9 @@ Write the configuration file for [Graphite Web](https://github.com/graphite-proj

- `graphite_web_config`: data driven python config file writer for graphite web. Assumes the whole file is managed, typically this is the path to local_settings.py. Custom python code can be placed in the optional 'dynamic template', by default a file named 'local_settings_dynamic.py' that is optimistically loaded if present.

Yes it's [writing python via ruby](https://github.com/hw-cookbooks/graphite/blob/master/libraries/chef_graphite_python.rb#L14).
Yes it's [writing python via ruby](https://github.com/sous-chefs/graphite/blob/master/libraries/chef_graphite_python.rb#L14).

A runit service definition is provided to [start a uwsgi process](https://github.com/hw-cookbooks/graphite/blob/master/example/graphite_example/recipes/single_node.rb#L105), but note that choice of web server for proxying to the application server is left up to you. No more hard Apache dependency!
A runit service definition is provided to [start a uwsgi process](https://github.com/sous-chefs/graphite/blob/master/example/graphite_example/recipes/single_node.rb#L105), but note that choice of web server for proxying to the application server is left up to you. No more hard Apache dependency!

### Accumulators

Expand All @@ -117,7 +117,7 @@ Due to the graphite config file format, the data driven resources use an accumul
- `graphite_carbon_conf_accumulator`: lookup named carbon resources in run context and gather config
- `graphite_storage_conf_accumulator`: lookup named storage schema resources in run context and gather config

If you look at the [example cookbook recipe](https://github.com/hw-cookbooks/graphite/blob/master/example/graphite_example/recipes/single_node.rb#L6) you probably notice that many of the resources simply take a single `config` attribute, which is basically a hash of the configuration to be written.
If you look at the [example cookbook recipe](https://github.com/sous-chefs/graphite/blob/master/example/graphite_example/recipes/single_node.rb#L6) you probably notice that many of the resources simply take a single `config` attribute, which is basically a hash of the configuration to be written.

This can come from attributes in a wrapper cookbook or via data bags if you like. Be as creative as you can tolerate.

Expand All @@ -129,13 +129,11 @@ It's a library cookbook, intended to be used in your custom wrapper cookbook to

We have purposefully left out web server configuration to remove the dependency, so you're free to use whatever works in your environment. This avoids the need for this cookbook to keep up to date with configuration that isn't really graphite specific.

For example usage consult the reference cookbook [example](https://github.com/hw-cookbooks/graphite/tree/master/example/graphite_example/recipes)

Feel free to ask us questions anytime on irc: #heavywater on freenode
For example usage consult the reference cookbook [example](https://github.com/sous-chefs/graphite/tree/master/example/graphite_example/recipes)

## Examples

You can find example usage in the graphite_example cookbook that is included in the [git repository](https://github.com/hw-cookbooks/graphite/blob/master/example/graphite_example/recipes/single_node.rb).
You can find example usage in the graphite_example cookbook that is included in the [git repository](https://github.com/sous-chefs/graphite/blob/master/example/graphite_example/recipes/single_node.rb).

## Data Bags

Expand Down
Loading

0 comments on commit aa5ce13

Please sign in to comment.