graphite: 1.0.2 -> 1.1.3 & moved dependencies to python-modules (#44276)

Fixes #30891

* Upgrade `graphite-web`, `carbon` and `whisper` from 1.0.2 -> 1.1.3.

* Replaced the deprecated `pythonPackages.graphite_influxdb` with
`pythonPackages.influxgraph.`

* Renamed `pythonPackages.graphite_web` to `pythonPackages.graphite-web`
to be consistent with the Python package name.

* Replaced the unmaintained `pythonPackages.graphite_pager` with
`pythonPackages.graphitepager`

* Moved all new packages from `python-packages.nix` to
`pkgs/development/python-modules`

Changed files
+207 -168
nixos
modules
services
monitoring
tests
pkgs
development
python-modules
carbon
graphite-web
graphite_beacon
graphitepager
influxgraph
whisper
top-level
+7 -7
nixos/modules/services/monitoring/graphite.nix
···
finders = mkOption {
description = "List of finder plugins to load.";
default = [];
-
example = literalExample "[ pkgs.python27Packages.graphite_influxdb ]";
+
example = literalExample "[ pkgs.python27Packages.influxgraph ]";
type = types.listOf types.package;
};
···
PYTHONPATH = let
penv = pkgs.python.buildEnv.override {
extraLibs = [
-
pythonPackages.graphite_web
+
pythonPackages.graphite-web
pythonPackages.pysqlite
];
};
···
fi
# Only collect static files when graphite_web changes.
-
if ! [ "${dataDir}/current_graphite_web" -ef "${pythonPackages.graphite_web}" ]; then
+
if ! [ "${dataDir}/current_graphite_web" -ef "${pythonPackages.graphite-web}" ]; then
mkdir -p ${staticDir}
${pkgs.pythonPackages.django_1_8}/bin/django-admin.py collectstatic --noinput --clear
chown -R graphite:graphite ${staticDir}
-
ln -sfT "${pythonPackages.graphite_web}" "${dataDir}/current_graphite_web"
+
ln -sfT "${pythonPackages.graphite-web}" "${dataDir}/current_graphite_web"
fi
'';
};
-
environment.systemPackages = [ pythonPackages.graphite_web ];
+
environment.systemPackages = [ pythonPackages.graphite-web ];
}))
(mkIf cfg.api.enable {
···
GRAPHITE_URL = cfg.pager.graphiteUrl;
};
serviceConfig = {
-
ExecStart = "${pkgs.pythonPackages.graphite_pager}/bin/graphite-pager --config ${pagerConfig}";
+
ExecStart = "${pkgs.pythonPackages.graphitepager}/bin/graphite-pager --config ${pagerConfig}";
User = "graphite";
Group = "graphite";
};
···
services.redis.enable = mkDefault true;
-
environment.systemPackages = [ pkgs.pythonPackages.graphite_pager ];
+
environment.systemPackages = [ pkgs.pythonPackages.graphitepager ];
})
(mkIf cfg.beacon.enable {
+4 -1
nixos/tests/graphite.nix
···
-
import ./make-test.nix ({ ... } :
+
import ./make-test.nix ({ pkgs, ... } :
{
name = "graphite";
nodes = {
···
api = {
enable = true;
port = 8082;
+
finders = [ pkgs.python27Packages.influxgraph ];
};
carbon.enableCache = true;
seyren.enable = true;
pager.enable = true;
+
beacon.enable = true;
};
};
};
···
$one->waitForUnit("graphiteWeb.service");
$one->waitForUnit("graphiteApi.service");
$one->waitForUnit("graphitePager.service");
+
$one->waitForUnit("graphite-beacon.service");
$one->waitForUnit("carbonCache.service");
$one->waitForUnit("seyren.service");
# The services above are of type "simple". systemd considers them active immediately
+24
pkgs/development/python-modules/carbon/default.nix
···
+
{ stdenv, buildPythonPackage, fetchPypi, isPy3k
+
, twisted, whisper, txamqp, cachetools, urllib3
+
}:
+
+
buildPythonPackage rec {
+
pname = "carbon";
+
version = "1.1.3";
+
+
disabled = isPy3k;
+
+
src = fetchPypi {
+
inherit pname version;
+
sha256 = "1s7327p30w4l9ak4gc7m5ga521233179n2lr3j0ggfbmfhd6blky";
+
};
+
+
propagatedBuildInputs = [ twisted whisper txamqp cachetools urllib3 ];
+
+
meta = with stdenv.lib; {
+
homepage = http://graphite.wikidot.com/;
+
description = "Backend data caching and persistence daemon for Graphite";
+
maintainers = with maintainers; [ rickynils offline basvandijk ];
+
license = licenses.asl20;
+
};
+
}
+54
pkgs/development/python-modules/graphite-web/default.nix
···
+
{ stdenv, buildPythonPackage, fetchPypi, isPy3k, which
+
, django, django_tagging, whisper, pycairo, cairocffi, ldap, memcached, pytz, urllib3, scandir
+
}:
+
if django.version != "1.8.18"
+
|| django_tagging.version != "0.4.3"
+
then throw "graphite-web should be build with django_1_8 and django_tagging_0_4_3"
+
else buildPythonPackage rec {
+
pname = "graphite-web";
+
version = "1.1.3";
+
+
disabled = isPy3k;
+
+
src = fetchPypi {
+
inherit pname version;
+
sha256 = "0nvyq1859abdch2l90avsjk9vb03s7wgxgrjsqvjhf2b9c1ncsfh";
+
};
+
+
propagatedBuildInputs = [
+
django django_tagging whisper pycairo cairocffi
+
ldap memcached pytz urllib3 scandir
+
];
+
+
postInstall = ''
+
wrapProgram $out/bin/run-graphite-devel-server.py \
+
--prefix PATH : ${which}/bin
+
'';
+
+
preConfigure = ''
+
# graphite is configured by storing a local_settings.py file inside the
+
# graphite python package. Since that package is stored in the immutable
+
# Nix store we can't modify it. So how do we configure graphite?
+
#
+
# First of all we rename "graphite.local_settings" to
+
# "graphite_local_settings" so that the settings are not looked up in the
+
# graphite package anymore. Secondly we place a directory containing a
+
# graphite_local_settings.py on the PYTHONPATH in the graphite module
+
# <nixpkgs/nixos/modules/services/monitoring/graphite.nix>.
+
substituteInPlace webapp/graphite/settings.py \
+
--replace "graphite.local_settings" " graphite_local_settings"
+
+
substituteInPlace webapp/graphite/settings.py \
+
--replace "join(WEBAPP_DIR, 'content')" "join('$out', 'webapp', 'content')"
+
'';
+
+
# error: invalid command 'test'
+
doCheck = false;
+
+
meta = with stdenv.lib; {
+
homepage = http://graphite.wikidot.com/;
+
description = "Enterprise scalable realtime graphing";
+
maintainers = with maintainers; [ rickynils offline basvandijk ];
+
license = licenses.asl20;
+
};
+
}
+25
pkgs/development/python-modules/graphite_beacon/default.nix
···
+
{ stdenv, buildPythonPackage, fetchPypi
+
, tornado, pyyaml, funcparserlib
+
}:
+
buildPythonPackage rec {
+
pname = "graphite_beacon";
+
version = "0.27.0";
+
+
src = fetchPypi {
+
inherit pname version;
+
sha256 = "03bp4wyfn3xhcqyvs5hnk1n87m4smsmm1p7qp459m7j8hwpbq2ks";
+
};
+
+
propagatedBuildInputs = [ tornado pyyaml funcparserlib ];
+
+
postPatch = ''
+
substituteInPlace requirements.txt --replace "==" ">="
+
'';
+
+
meta = with stdenv.lib; {
+
description = "A simple alerting application for Graphite metrics";
+
homepage = https://github.com/klen/graphite-beacon;
+
maintainers = [ maintainers.offline ];
+
license = licenses.mit;
+
};
+
}
+32
pkgs/development/python-modules/graphitepager/default.nix
···
+
{ stdenv, buildPythonPackage, fetchPypi
+
, jinja2, markupsafe, pagerduty, pushbullet, python_magic, python-simple-hipchat
+
, pyyaml, redis, requests, six, websocket_client, nose
+
}:
+
buildPythonPackage rec {
+
pname = "graphitepager";
+
version = "0.2.11";
+
+
src = fetchPypi {
+
inherit pname version;
+
sha256 = "0v3g1qcgnkpgjzh6phnv13lnk8qjrcs9sq2qg6k0dk5ik31jfk3d";
+
};
+
+
propagatedBuildInputs = [
+
jinja2 markupsafe pagerduty pushbullet python_magic python-simple-hipchat
+
pyyaml redis requests six websocket_client
+
];
+
+
postPatch = ''
+
substituteInPlace requirements.txt --replace "==" ">="
+
'';
+
+
checkInputs = [ nose ];
+
checkPhase = "nosetests";
+
+
meta = with stdenv.lib; {
+
description = "A simple alerting application for Graphite metrics";
+
homepage = https://github.com/seatgeek/graphite-pager;
+
maintainers = with maintainers; [ offline basvandijk ];
+
license = licenses.bsd2;
+
};
+
}
+30
pkgs/development/python-modules/influxgraph/default.nix
···
+
{ stdenv, buildPythonPackage, fetchPypi, isPy3k
+
, influxdb, graphite_api, memcached, gnugrep
+
}:
+
+
buildPythonPackage rec {
+
pname = "influxgraph";
+
version = "1.5.0";
+
+
src = fetchPypi {
+
inherit pname version;
+
sha256 = "0l33sfwdh4bfprmzp2kx0d9098g6yxbnhyyx9qr3kzczpm0jg9vy";
+
};
+
+
patchPhase = stdenv.lib.optionalString isPy3k ''
+
sed 's/python-memcached/python3-memcached/' \
+
-i ./influxgraph.egg-info/requires.txt \
+
-i ./setup.py
+
'';
+
+
propagatedBuildInputs = [ influxdb graphite_api memcached ];
+
+
passthru.moduleName = "influxgraph.InfluxDBFinder";
+
+
meta = with stdenv.lib; {
+
description = "InfluxDB storage plugin for Graphite-API";
+
homepage = https://github.com/InfluxGraph/influxgraph;
+
license = licenses.asl20;
+
maintainers = with maintainers; [ basvandijk ];
+
};
+
}
+20
pkgs/development/python-modules/whisper/default.nix
···
+
{ stdenv, buildPythonPackage, fetchPypi, six }:
+
+
buildPythonPackage rec {
+
pname = "whisper";
+
version = "1.1.3";
+
+
src = fetchPypi {
+
inherit pname version;
+
sha256 = "1ahzsxk52ws8k3kdq52qbsbsx2r9z350j8gg9adw4x5fjwksz4r8";
+
};
+
+
propagatedBuildInputs = [ six ];
+
+
meta = with stdenv.lib; {
+
homepage = http://graphite.wikidot.com/;
+
description = "Fixed size round-robin style database";
+
maintainers = with maintainers; [ rickynils offline basvandijk ];
+
license = licenses.asl20;
+
};
+
}
+11 -160
pkgs/top-level/python-packages.nix
···
# See build-setupcfg/default.nix for documentation.
buildSetupcfg = import ../build-support/build-setupcfg self;
-
graphiteVersion = "1.0.2";
-
fetchPypi = makeOverridable( {format ? "setuptools", ... } @attrs:
let
fetchWheel = {pname, version, sha256, python ? "py2.py3", abi ? "none", platform ? "any"}:
···
django_tagging = callPackage ../development/python-modules/django_tagging { };
django_tagging_0_4_3 = if
-
self.django != self.django_1_8
+
self.django.version != "1.8.18"
then throw "django_tagging_0_4_3 should be build with django_1_8"
else (callPackage ../development/python-modules/django_tagging {}).overrideAttrs (attrs: rec {
-
name = "django-tagging-0.4.3";
+
pname = "django-tagging";
+
version = "0.4.3";
-
src = pkgs.fetchurl {
-
url = "mirror://pypi/d/django-tagging/${name}.tar.gz";
+
src = fetchPypi {
+
inherit pname version;
sha256 = "0617azpmp6jpg3d88v2ir97qrc9aqcs2s9gyvv9bgf2cp55khxhs";
};
propagatedBuildInputs = with self; [ django ];
···
whichcraft = callPackage ../development/python-modules/whichcraft { };
-
whisper = buildPythonPackage rec {
-
name = "whisper-${version}";
-
version = graphiteVersion;
-
-
src = pkgs.fetchurl {
-
url = "mirror://pypi/w/whisper/${name}.tar.gz";
-
sha256 = "1v1bi3fl1i6p4z4ki692bykrkw6907dn3mfq0151f70lvi3zpns3";
-
};
-
-
# error: invalid command 'test'
-
doCheck = false;
-
-
meta = {
-
homepage = http://graphite.wikidot.com/;
-
description = "Fixed size round-robin style database";
-
maintainers = with maintainers; [ rickynils offline ];
-
};
-
};
+
whisper = callPackage ../development/python-modules/whisper { };
worldengine = buildPythonPackage rec {
name = "worldengine-${version}";
···
-
carbon = buildPythonPackage rec {
-
name = "carbon-${version}";
-
version = graphiteVersion;
-
-
disabled = isPy3k;
-
-
src = pkgs.fetchurl {
-
url = "mirror://pypi/c/carbon/${name}.tar.gz";
-
sha256 = "142smpmgbnjinvfb6s4ijazish4vfgzyd8zcmdkh55y051fkixkn";
-
};
-
-
propagatedBuildInputs = with self; [ whisper txamqp zope_interface twisted ];
-
-
meta = {
-
homepage = http://graphite.wikidot.com/;
-
description = "Backend data caching and persistence daemon for Graphite";
-
maintainers = with maintainers; [ rickynils offline ];
-
license = licenses.asl20;
-
};
-
};
-
+
carbon = callPackage ../development/python-modules/carbon { };
ujson = buildPythonPackage rec {
name = "ujson-1.35";
···
-
graphite_web = if
-
self.django != self.django_1_8
-
|| self.django_tagging != self.django_tagging_0_4_3
-
then throw "graphite_web should be build with django_1_8 and django_tagging_0_4_3"
-
else buildPythonPackage rec {
-
name = "graphite-web-${version}";
-
disabled = isPy3k;
-
version = graphiteVersion;
-
-
src = pkgs.fetchurl rec {
-
url = "mirror://pypi/g/graphite-web/${name}.tar.gz";
-
sha256 = "0q8bwlj75jqyzmazfsi5sa26xl58ssa8wdxm2l4j0jqyn8xpfnmc";
-
};
-
-
propagatedBuildInputs = with self; [
-
django django_tagging whisper pycairo cairocffi
-
ldap memcached pytz urllib3 scandir
-
];
-
-
postInstall = ''
-
wrapProgram $out/bin/run-graphite-devel-server.py \
-
--prefix PATH : ${pkgs.which}/bin
-
'';
-
-
preConfigure = ''
-
# graphite is configured by storing a local_settings.py file inside the
-
# graphite python package. Since that package is stored in the immutable
-
# Nix store we can't modify it. So how do we configure graphite?
-
#
-
# First of all we rename "graphite.local_settings" to
-
# "graphite_local_settings" so that the settings are not looked up in the
-
# graphite package anymore. Secondly we place a directory containing a
-
# graphite_local_settings.py on the PYTHONPATH in the graphite module
-
# <nixpkgs/nixos/modules/services/monitoring/graphite.nix>.
-
substituteInPlace webapp/graphite/settings.py \
-
--replace "graphite.local_settings" " graphite_local_settings"
-
-
substituteInPlace webapp/graphite/settings.py \
-
--replace "join(WEBAPP_DIR, 'content')" "join('$out', 'webapp', 'content')"
-
'';
-
-
# error: invalid command 'test'
-
doCheck = false;
-
-
meta = {
-
homepage = http://graphite.wikidot.com/;
-
description = "Enterprise scalable realtime graphing";
-
maintainers = with maintainers; [ rickynils offline ];
-
};
-
};
+
graphite-web = callPackage ../development/python-modules/graphite-web { };
graphite_api = callPackage ../development/python-modules/graphite-api { };
-
graphite_beacon = buildPythonPackage rec {
-
name = "graphite_beacon-0.27.0";
-
-
src = pkgs.fetchurl {
-
url = "mirror://pypi/g/graphite_beacon/${name}.tar.gz";
-
sha256 = "03bp4wyfn3xhcqyvs5hnk1n87m4smsmm1p7qp459m7j8hwpbq2ks";
-
};
-
-
propagatedBuildInputs = [ self.tornado self.pyyaml self.funcparserlib ];
-
-
preBuild = "> requirements.txt";
-
-
meta = {
-
description = "A simple alerting application for Graphite metrics";
-
homepage = https://github.com/klen/graphite-beacon;
-
maintainers = [ maintainers.offline ];
-
license = licenses.mit;
-
};
-
};
-
-
graphite_influxdb = buildPythonPackage rec {
-
name = "graphite-influxdb-0.3";
-
-
src = pkgs.fetchgit {
-
url = "https://github.com/vimeo/graphite-influxdb.git";
-
rev = "2273d12a24e1d804685a36debfd4224b7416b62f";
-
sha256 = "1v00fgrnmsd9c0ahggyw9sia5m7dyzz16i5pa4vy6w2sbfyrmm4v";
-
};
-
-
propagatedBuildInputs = with self; [ influxdb graphite_api ];
-
-
passthru.moduleName = "graphite_influxdb.InfluxdbFinder";
-
-
meta = {
-
description = "An influxdb backend for Graphite-web and graphite-api";
-
homepage = https://github.com/vimeo/graphite-influxdb;
-
license = licenses.asl20;
-
};
-
};
-
-
graphite_pager = buildPythonPackage rec {
-
name = "graphite-pager-${version}";
-
version = "2bbfe91220ec1e0ca1cdf4b5564386482a44ed7d";
-
-
src = pkgs.fetchgit {
-
url = "https://github.com/offlinehacker/graphite-pager.git";
-
sha256 = "0ylal0vkc2yrjvssfz1gls84yk9vkvvkx3pyv4lx15jm2qqzdmxd";
-
rev = version;
-
};
-
-
buildInputs = with self; [ nose mock ];
-
propagatedBuildInputs = with self; [
-
jinja2 pyyaml redis requests pagerduty
-
python-simple-hipchat pushbullet
-
];
-
-
patchPhase = "> requirements.txt";
-
checkPhase = "nosetests";
+
graphite_beacon = callPackage ../development/python-modules/graphite_beacon { };
-
meta = {
-
description = "A simple alerting application for Graphite metrics";
-
homepage = https://github.com/seatgeek/graphite-pager;
-
maintainers = with maintainers; [ offline ];
-
license = licenses.bsd2;
-
};
-
};
+
influxgraph = callPackage ../development/python-modules/influxgraph { };
+
graphitepager = callPackage ../development/python-modules/graphitepager { };
pyspotify = buildPythonPackage rec {
name = "pyspotify-${version}";