Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Pass --no-binary=:all: to pip install when running on Ubuntu Xenial
Browse files Browse the repository at this point in the history
Installing graphite with pip >= 7.0.0 causes it to install to the wrong
location unless you pass it the `--no-binary=:all:` option. (See [pip install
of 0.9.15 = No $GRAPHITE_ROOT/webapp/graphite exists][1].) As Ubuntu Xenial
includes pip 8.1 by default, passing this option is necessary.

Note that passing install options to pip [requires Puppet v4.1+][2] so this fix
will not work on systems using older versions of Puppet. (Even Ubuntu Xenial
only includes Puppet 3.8 in its package repositories, which is unfortunate.)

Other workarounds are possible, including [downgrading to pip 6.1.1 before
installing Graphite][3], or [installing from a tarball with a name that doesn't
include all of the letters of package name][4] but this solution seems like
the most straighforward one.

[1]: graphite-project/graphite-web#1508 (comment)
[2]: puppetlabs/puppet@c2697c6
[3]: #309 (comment)
[4]: #309 (comment)
  • Loading branch information
Ajedi32 committed Mar 15, 2017
1 parent 472073d commit 71251c9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
21 changes: 15 additions & 6 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,26 @@
,
}
, {
provider => $gr_pkg_provider,
require => $gr_pkg_require,
provider => $gr_pkg_provider,
require => $gr_pkg_require,
install_options => $gr_pkg_provider ? {
'pip' => $::graphite::params::pip_install_options,
default => undef,
},
}
)

if $::graphite::gr_django_pkg {
$django_install_options = $::graphite::gr_django_provider ? {
'pip' => $::graphite::params::pip_install_options,
default => undef,
}
package { $::graphite::gr_django_pkg:
ensure => $::graphite::gr_django_ver,
provider => $::graphite::gr_django_provider,
source => $::graphite::gr_django_source,
require => $gr_pkg_require,
ensure => $::graphite::gr_django_ver,
provider => $::graphite::gr_django_provider,
source => $::graphite::gr_django_source,
require => $gr_pkg_require,
install_options => $django_install_options,
}
}

Expand Down
23 changes: 14 additions & 9 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,24 @@

case $::lsbdistcodename {
/squeeze|wheezy|precise/: {
$apache_24 = false
$graphitepkgs = union($common_os_pkgs, ['python-cairo',])
$libpath = "/usr/lib/python${pyver}/dist-packages"
$apache_24 = false
$graphitepkgs = union($common_os_pkgs, ['python-cairo',])
$libpath = "/usr/lib/python${pyver}/dist-packages"
$pip_install_options = undef
}

/jessie|trusty|utopic|vivid|wily/: {
$apache_24 = true
$graphitepkgs = union($common_os_pkgs, ['python-cairo',])
$libpath = "/usr/lib/python${pyver}/dist-packages"
$apache_24 = true
$graphitepkgs = union($common_os_pkgs, ['python-cairo',])
$libpath = "/usr/lib/python${pyver}/dist-packages"
$pip_install_options = undef
}

/xenial/: {
$apache_24 = true
$graphitepkgs = union($common_os_pkgs, ['python-cairo',])
$libpath = "/usr/local/lib/python${pyver}/dist-packages"
$apache_24 = true
$graphitepkgs = union($common_os_pkgs, ['python-cairo',])
$libpath = "/usr/local/lib/python${pyver}/dist-packages"
$pip_install_options = [{'--no-binary' => ':all:'}]
}

default: {
Expand Down Expand Up @@ -184,6 +187,8 @@
}

$libpath = "/usr/lib/python${pyver}/site-packages"

$pip_install_options = undef
}

default: {
Expand Down

0 comments on commit 71251c9

Please sign in to comment.