This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Install to Python virtualenv #17
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1a60469
Remove extraenous subscribe from config file
dcarley 778da32
Install to Python virtualenv
dcarley b0eac9b
Prevent carbon/graphite from being reinstalled
dcarley 18b431e
Add tests for virtualenv changes
dcarley bbe815f
Virtualenv support for carbon-aggregator
dcarley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
fixtures: | ||
repositories: | ||
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git | ||
python: git://github.com/stankevich/puppet-python.git | ||
symlinks: | ||
graphite: "#{source_dir}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,36 @@ | ||
# == Class: graphite::deps | ||
# | ||
# Class to install all graphite dependency packages | ||
# Class to create a Python virtualenv and install all graphite dependencies | ||
# within that sandbox. | ||
# | ||
# With the exception of pycairo which can't be installed by pip. It is | ||
# installed as a system package and symlinked into the virtualenv. This is a | ||
# slightly hacky alternative to `--system-site-packages` which would mess | ||
# with Graphite's other dependencies. | ||
# | ||
class graphite::deps { | ||
$root_dir = $::graphite::root_dir | ||
|
||
ensure_packages([ | ||
'python-ldap', | ||
'python-cairo', | ||
'python-django', | ||
'python-twisted', | ||
'python-django-tagging', | ||
'python-simplejson', | ||
'python-memcache', | ||
'python-pysqlite2', | ||
'python-support', | ||
'python-pip', | ||
python::virtualenv { $root_dir: } -> | ||
python::pip { [ | ||
'gunicorn', | ||
]) | ||
'twisted==11.1.0', | ||
'django==1.4.10', | ||
'django-tagging==0.3.1', | ||
'python-memcached==1.47', | ||
'simplejson==2.1.6', | ||
]: | ||
virtualenv => $root_dir, | ||
} | ||
|
||
ensure_packages(['python-cairo']) | ||
|
||
file { "${root_dir}/lib/python2.7/site-packages/cairo": | ||
ensure => link, | ||
target => '/usr/lib/python2.7/dist-packages/cairo', | ||
require => [ | ||
Python::Virtualenv[$root_dir], | ||
Package['python-cairo'], | ||
], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
require 'spec_helper' | ||
|
||
describe 'graphite::deps', :type => :class do | ||
describe 'graphite', :type => :class do | ||
|
||
[ | ||
'python-ldap', | ||
'python-cairo', | ||
'python-django', | ||
'python-twisted', | ||
'python-django-tagging', | ||
'python-simplejson', | ||
'python-memcache', | ||
'python-pysqlite2', | ||
'python-support', | ||
'python-pip', | ||
'gunicorn', | ||
].each do |pkg| | ||
it { | ||
should contain_package(pkg) | ||
} | ||
context 'root_dir' do | ||
let(:params) {{ | ||
:root_dir => '/this/is/root', | ||
}} | ||
|
||
it { should contain_python__virtualenv('/this/is/root') } | ||
it { should contain_python__pip('gunicorn').with_virtualenv('/this/is/root') } | ||
|
||
it { should contain_package('python-cairo').with_ensure('present') } | ||
it { should contain_file('/this/is/root/lib/python2.7/site-packages/cairo'). | ||
with_ensure('link'). | ||
with_target('/usr/lib/python2.7/dist-packages/cairo'). | ||
with_require(['Python::Virtualenv[/this/is/root]', 'Package[python-cairo]']) } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
require 'spec_helper' | ||
|
||
shared_examples "pip_package" do |package| | ||
it { should contain_python__pip("#{package}==1.2.3"). | ||
with_virtualenv('/this/is/root'). | ||
with_environment(["PYTHONPATH=/this/is/root/lib:/this/is/root/webapp"]) } | ||
end | ||
|
||
describe 'graphite', :type => :class do | ||
let(:version) { '0.9.12' } | ||
context 'root_dir and version' do | ||
let(:params) {{ | ||
:version => '1.2.3', | ||
:root_dir => '/this/is/root', | ||
}} | ||
|
||
it { should contain_package('whisper').with_ensure(version) } | ||
it { should contain_exec('graphite/install carbon'). | ||
with_command("/usr/bin/pip install --install-option=\"--prefix=/opt/graphite\" --install-option=\"--install-lib=/opt/graphite/lib\" carbon==#{version}") } | ||
it { should contain_exec('graphite/install graphite-web'). | ||
with_command("/usr/bin/pip install --install-option=\"--prefix=/opt/graphite\" --install-option=\"--install-lib=/opt/graphite/webapp\" graphite-web==#{version}") } | ||
it_should_behave_like "pip_package", "whisper" | ||
it_should_behave_like "pip_package", "carbon" | ||
it_should_behave_like "pip_package", "graphite-web" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
who's responsible for actually creating the
$root_dir
directory?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out it's
python::virtualenv
, but stankevich/python 1.6.0 had a bug which caused this to fail (fixed by stankevich/python@e6b4b941713, in 1.6.1)