prometheus-dcgm-exporter: init at 3.1.8-3.1.5

This commit is contained in:
Elliot Cameron 2023-05-30 12:05:23 -04:00
parent 1cdc3752a5
commit b25101f159
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,66 @@
{ lib
, buildGoModule
, fetchFromGitHub
, cudaPackages
, dcgm
, linuxPackages
}:
buildGoModule rec {
pname = "dcgm-exporter";
version = "3.1.8-3.1.5";
src = fetchFromGitHub {
owner = "NVIDIA";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-Jzv3cU3gmGIXV+DV3wV/1zSWwz18s3Jax6JC7WZW7Z4=";
};
# Upgrade to go 1.17 during the vendoring FOD build because it fails otherwise.
overrideModAttrs = _: {
preBuild = ''
substituteInPlace go.mod --replace 'go 1.16' 'go 1.17'
go mod tidy
'';
postInstall = ''
cp go.mod "$out/go.mod"
'';
};
CGO_LDFLAGS = "-ldcgm";
buildInputs = [
dcgm
];
# gonvml and go-dcgm do not work with ELF BIND_NOW hardening because not all
# symbols are available on startup.
hardeningDisable = [ "bindnow" ];
# Copy the modified go.mod we got from the vendoring process.
preBuild = ''
cp vendor/go.mod go.mod
'';
vendorHash = "sha256-KMCV79kUY1sNYysH0MmB7pVU98r7v+DpLIoYHxyyG4U=";
nativeBuildInputs = [
cudaPackages.autoAddOpenGLRunpathHook
];
# Tests try to interact with running DCGM service.
doCheck = false;
postFixup = ''
patchelf --add-needed libnvidia-ml.so "$out/bin/dcgm-exporter"
'';
meta = with lib; {
description = "NVIDIA GPU metrics exporter for Prometheus leveraging DCGM";
homepage = "https://github.com/NVIDIA/dcgm-exporter";
license = licenses.asl20;
maintainers = teams.deshaw.members;
mainProgram = "dcgm-exporter";
platforms = platforms.linux;
};
}

View file

@ -26693,6 +26693,7 @@ with pkgs;
prometheus-cloudflare-exporter = callPackage ../servers/monitoring/prometheus/cloudflare-exporter.nix { };
prometheus-collectd-exporter = callPackage ../servers/monitoring/prometheus/collectd-exporter.nix { };
prometheus-consul-exporter = callPackage ../servers/monitoring/prometheus/consul-exporter.nix { };
prometheus-dcgm-exporter = callPackage ../servers/monitoring/prometheus/dcgm-exporter { };
prometheus-dnsmasq-exporter = callPackage ../servers/monitoring/prometheus/dnsmasq-exporter.nix { };
prometheus-dovecot-exporter = callPackage ../servers/monitoring/prometheus/dovecot-exporter.nix { };
prometheus-domain-exporter = callPackage ../servers/monitoring/prometheus/domain-exporter.nix { };