Revert "Merge pull request #107030 from cpcloud/nomad-nvml"

This broke eval.

https://github.com/NixOS/nixpkgs/pull/107030#issuecomment-753591854

This reverts commit 20489e31cd, reversing
changes made to 590feeecfb.
This commit is contained in:
Frederik Rietdijk 2021-01-03 11:18:51 +01:00
parent 20489e31cd
commit 6c9b5071e4
4 changed files with 18 additions and 48 deletions

View File

@ -1,11 +1,7 @@
{ callPackage { callPackage, buildGoPackage }:
, buildGoPackage
, nvidia_x11
, nvidiaGpuSupport
}:
callPackage ./generic.nix { callPackage ./generic.nix {
inherit buildGoPackage nvidia_x11 nvidiaGpuSupport; inherit buildGoPackage;
version = "0.11.8"; version = "0.11.8";
sha256 = "1dhh07bifr02jh2lls8fv1d9ra67ymgh8qxqvpvm0cd0qdd469z1"; sha256 = "1dhh07bifr02jh2lls8fv1d9ra67ymgh8qxqvpvm0cd0qdd469z1";
} }

View File

@ -1,11 +1,7 @@
{ callPackage { callPackage, buildGoPackage }:
, buildGoPackage
, nvidia_x11
, nvidiaGpuSupport
}:
callPackage ./generic.nix { callPackage ./generic.nix {
inherit buildGoPackage nvidia_x11 nvidiaGpuSupport; inherit buildGoPackage;
version = "0.12.9"; version = "0.12.9";
sha256 = "1a0ig6pb0z3qp7zk4jgz3h241bifmjlyqsfikyy3sxdnzj7yha27"; sha256 = "1a0ig6pb0z3qp7zk4jgz3h241bifmjlyqsfikyy3sxdnzj7yha27";
} }

View File

@ -1,12 +1,4 @@
{ lib { stdenv, buildGoPackage, fetchFromGitHub, version, sha256 }:
, buildGoPackage
, fetchFromGitHub
, version
, sha256
, nvidiaGpuSupport
, patchelf
, nvidia_x11
}:
buildGoPackage rec { buildGoPackage rec {
pname = "nomad"; pname = "nomad";
@ -22,33 +14,23 @@ buildGoPackage rec {
inherit rev sha256; inherit rev sha256;
}; };
nativeBuildInputs = lib.optionals nvidiaGpuSupport [
patchelf
];
# ui: # ui:
# Nomad release commits include the compiled version of the UI, but the file # Nomad release commits include the compiled version of the UI, but the file
# is only included if we build with the ui tag. # is only included if we build with the ui tag.
preBuild = # nonvidia:
let # We disable Nvidia GPU scheduling on Linux, as it doesn't work there:
tags = [ "ui" ] ++ lib.optional (!nvidiaGpuSupport) "nonvidia"; # Ref: https://github.com/hashicorp/nomad/issues/5535
tagsString = lib.concatStringsSep " " tags; preBuild = let
in tags = ["ui"]
'' ++ stdenv.lib.optional stdenv.isLinux "nonvidia";
tagsString = stdenv.lib.concatStringsSep " " tags;
in ''
export buildFlagsArray=( export buildFlagsArray=(
-tags="${tagsString}" -tags="${tagsString}"
) )
''; '';
# The dependency on NVML isn't explicit. We have to make it so otherwise the meta = with stdenv.lib; {
# binary will not know where to look for the relevant symbols.
postFixup = lib.optionalString nvidiaGpuSupport ''
for bin in $out/bin/*; do
patchelf --add-needed "${nvidia_x11}/lib/libnvidia-ml.so" "$bin"
done
'';
meta = with lib; {
homepage = "https://www.nomadproject.io/"; homepage = "https://www.nomadproject.io/";
description = "A Distributed, Highly Available, Datacenter-Aware Scheduler"; description = "A Distributed, Highly Available, Datacenter-Aware Scheduler";
platforms = platforms.unix; platforms = platforms.unix;

View File

@ -6129,13 +6129,9 @@ in
# with different versions we pin Go for all versions. # with different versions we pin Go for all versions.
nomad_0_11 = callPackage ../applications/networking/cluster/nomad/0.11.nix { nomad_0_11 = callPackage ../applications/networking/cluster/nomad/0.11.nix {
buildGoPackage = buildGo114Package; buildGoPackage = buildGo114Package;
inherit (linuxPackages) nvidia_x11;
nvidiaGpuSupport = config.cudaSupport or (!stdenv.isLinux);
}; };
nomad_0_12 = callPackage ../applications/networking/cluster/nomad/0.12.nix { nomad_0_12 = callPackage ../applications/networking/cluster/nomad/0.12.nix {
buildGoPackage = buildGo114Package; buildGoPackage = buildGo114Package;
inherit (linuxPackages) nvidia_x11;
nvidiaGpuSupport = config.cudaSupport or (!stdenv.isLinux);
}; };
nomad_1_0 = callPackage ../applications/networking/cluster/nomad/1.0.nix { nomad_1_0 = callPackage ../applications/networking/cluster/nomad/1.0.nix {
buildGoPackage = buildGo115Package; buildGoPackage = buildGo115Package;