From bbb4e423e476622c47a55db710887b010a79bd8b Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Mon, 20 Jun 2022 17:22:24 -0400 Subject: [PATCH] nomad: remove dependency on Nvidia (#178287) Nomad 1.2.0 externalized[1] the Nvidia device driver out of the main codebase and into a separate plugin[2], so there is no need to load the Nvidia libraries anymore when building Nomad itself. [1]: https://github.com/hashicorp/nomad/blob/main/CHANGELOG.md#120-november-15-2021 [2]: https://github.com/hashicorp/nomad-device-nvidia --- .../networking/cluster/nomad/1.2.nix | 4 +--- .../networking/cluster/nomad/1.3.nix | 4 +--- .../networking/cluster/nomad/generic.nix | 17 +---------------- pkgs/top-level/all-packages.nix | 4 ---- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/pkgs/applications/networking/cluster/nomad/1.2.nix b/pkgs/applications/networking/cluster/nomad/1.2.nix index c888581ae4d8..5df87528448c 100644 --- a/pkgs/applications/networking/cluster/nomad/1.2.nix +++ b/pkgs/applications/networking/cluster/nomad/1.2.nix @@ -1,11 +1,9 @@ { callPackage , buildGoModule -, nvidia_x11 -, nvidiaGpuSupport }: callPackage ./generic.nix { - inherit buildGoModule nvidia_x11 nvidiaGpuSupport; + inherit buildGoModule; version = "1.2.8"; sha256 = "11yn8g9wsdb35q97wn5vy93kgbn5462k0a33wxlfdz14i5h00yj8"; vendorSha256 = "06wyfnlm37qjvd1pwzygflfpcp9p52f61wgi6pb9l7hnqy2ph6j5"; diff --git a/pkgs/applications/networking/cluster/nomad/1.3.nix b/pkgs/applications/networking/cluster/nomad/1.3.nix index 6670b35f67e0..0145a5b10905 100644 --- a/pkgs/applications/networking/cluster/nomad/1.3.nix +++ b/pkgs/applications/networking/cluster/nomad/1.3.nix @@ -1,11 +1,9 @@ { callPackage , buildGoModule -, nvidia_x11 -, nvidiaGpuSupport }: callPackage ./generic.nix { - inherit buildGoModule nvidia_x11 nvidiaGpuSupport; + inherit buildGoModule; version = "1.3.1"; sha256 = "03ckhqh5xznvhbk380ka0g9w9hrvsi389h5maw68f3g3acx68jm7"; vendorSha256 = "08k5dxaq4r2q0km6y9mc14haski6l7hmhmzn5wjb961hwf5hkfgh"; diff --git a/pkgs/applications/networking/cluster/nomad/generic.nix b/pkgs/applications/networking/cluster/nomad/generic.nix index 180cf48e3fb1..c5d92eaf1f7e 100644 --- a/pkgs/applications/networking/cluster/nomad/generic.nix +++ b/pkgs/applications/networking/cluster/nomad/generic.nix @@ -4,9 +4,6 @@ , version , sha256 , vendorSha256 -, nvidiaGpuSupport -, patchelf -, nvidia_x11 , nixosTests }: @@ -25,22 +22,10 @@ buildGoModule rec { inherit vendorSha256; - 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. - tags = [ "ui" ] ++ lib.optional (!nvidiaGpuSupport) "nonvidia"; - - # 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 - ''; + tags = [ "ui" ]; passthru.tests.nomad = nixosTests.nomad; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 43903c555e54..80ee01e38895 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8747,13 +8747,9 @@ with pkgs; # https://github.com/hashicorp/nomad/blob/master/contributing/golang.md nomad_1_2 = callPackage ../applications/networking/cluster/nomad/1.2.nix { buildGoModule = buildGo117Module; - inherit (linuxPackages) nvidia_x11; - nvidiaGpuSupport = config.cudaSupport or false; }; nomad_1_3 = callPackage ../applications/networking/cluster/nomad/1.3.nix { buildGoModule = buildGo117Module; - inherit (linuxPackages) nvidia_x11; - nvidiaGpuSupport = config.cudaSupport or false; }; nomad-autoscaler = callPackage ../applications/networking/cluster/nomad-autoscaler { };