Skip to content

Commit

Permalink
Revert "Merge pull request #107030 from cpcloud/nomad-nvml"
Browse files Browse the repository at this point in the history
This broke eval.

#107030 (comment)

This reverts commit 20489e3, reversing
changes made to 590feee.
  • Loading branch information
FRidh committed Jan 3, 2021
1 parent 20489e3 commit 6c9b507
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 48 deletions.
8 changes: 2 additions & 6 deletions pkgs/applications/networking/cluster/nomad/0.11.nix
@@ -1,11 +1,7 @@
{ callPackage
, buildGoPackage
, nvidia_x11
, nvidiaGpuSupport
}:
{ callPackage, buildGoPackage }:

callPackage ./generic.nix {
inherit buildGoPackage nvidia_x11 nvidiaGpuSupport;
inherit buildGoPackage;
version = "0.11.8";
sha256 = "1dhh07bifr02jh2lls8fv1d9ra67ymgh8qxqvpvm0cd0qdd469z1";
}
8 changes: 2 additions & 6 deletions pkgs/applications/networking/cluster/nomad/0.12.nix
@@ -1,11 +1,7 @@
{ callPackage
, buildGoPackage
, nvidia_x11
, nvidiaGpuSupport
}:
{ callPackage, buildGoPackage }:

callPackage ./generic.nix {
inherit buildGoPackage nvidia_x11 nvidiaGpuSupport;
inherit buildGoPackage;
version = "0.12.9";
sha256 = "1a0ig6pb0z3qp7zk4jgz3h241bifmjlyqsfikyy3sxdnzj7yha27";
}
46 changes: 14 additions & 32 deletions pkgs/applications/networking/cluster/nomad/generic.nix
@@ -1,12 +1,4 @@
{ lib
, buildGoPackage
, fetchFromGitHub
, version
, sha256
, nvidiaGpuSupport
, patchelf
, nvidia_x11
}:
{ stdenv, buildGoPackage, fetchFromGitHub, version, sha256 }:

buildGoPackage rec {
pname = "nomad";
Expand All @@ -22,33 +14,23 @@ buildGoPackage rec {
inherit rev sha256;
};

nativeBuildInputs = lib.optionals nvidiaGpuSupport [
patchelf
];

# ui:
# Nomad release commits include the compiled version of the UI, but the file
# is only included if we build with the ui tag.
preBuild =
let
tags = [ "ui" ] ++ lib.optional (!nvidiaGpuSupport) "nonvidia";
tagsString = lib.concatStringsSep " " tags;
in
''
export buildFlagsArray=(
-tags="${tagsString}"
)
'';

# The dependency on NVML isn't explicit. We have to make it so otherwise the
# 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
'';
# nonvidia:
# We disable Nvidia GPU scheduling on Linux, as it doesn't work there:
# Ref: https://github.com/hashicorp/nomad/issues/5535
preBuild = let
tags = ["ui"]
++ stdenv.lib.optional stdenv.isLinux "nonvidia";
tagsString = stdenv.lib.concatStringsSep " " tags;
in ''
export buildFlagsArray=(
-tags="${tagsString}"
)
'';

meta = with lib; {
meta = with stdenv.lib; {
homepage = "https://www.nomadproject.io/";
description = "A Distributed, Highly Available, Datacenter-Aware Scheduler";
platforms = platforms.unix;
Expand Down
4 changes: 0 additions & 4 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -6129,13 +6129,9 @@ in
# with different versions we pin Go for all versions.
nomad_0_11 = callPackage ../applications/networking/cluster/nomad/0.11.nix {
buildGoPackage = buildGo114Package;
inherit (linuxPackages) nvidia_x11;
nvidiaGpuSupport = config.cudaSupport or (!stdenv.isLinux);
};
nomad_0_12 = callPackage ../applications/networking/cluster/nomad/0.12.nix {
buildGoPackage = buildGo114Package;
inherit (linuxPackages) nvidia_x11;
nvidiaGpuSupport = config.cudaSupport or (!stdenv.isLinux);
};
nomad_1_0 = callPackage ../applications/networking/cluster/nomad/1.0.nix {
buildGoPackage = buildGo115Package;
Expand Down

1 comment on commit 6c9b507

@cpcloud
Copy link
Contributor

@cpcloud cpcloud commented on 6c9b507 Jan 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah looks like it might be because nvidiaGpuSupport needs to be passed to the nomad_1_0 derivation.

Please sign in to comment.