Unverified Commit bbb4e423 authored by Luiz Aoqui's avatar Luiz Aoqui Committed by GitHub
Browse files

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
parent 1938f36f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
{ callPackage
, buildGoModule
, nvidia_x11
, nvidiaGpuSupport
}:

callPackage ./generic.nix {
  inherit buildGoModule nvidia_x11 nvidiaGpuSupport;
  inherit buildGoModule;
  version = "1.2.8";
  sha256 = "11yn8g9wsdb35q97wn5vy93kgbn5462k0a33wxlfdz14i5h00yj8";
  vendorSha256 = "06wyfnlm37qjvd1pwzygflfpcp9p52f61wgi6pb9l7hnqy2ph6j5";
+1 −3
Original line number Diff line number Diff line
{ callPackage
, buildGoModule
, nvidia_x11
, nvidiaGpuSupport
}:

callPackage ./generic.nix {
  inherit buildGoModule nvidia_x11 nvidiaGpuSupport;
  inherit buildGoModule;
  version = "1.3.1";
  sha256 = "03ckhqh5xznvhbk380ka0g9w9hrvsi389h5maw68f3g3acx68jm7";
  vendorSha256 = "08k5dxaq4r2q0km6y9mc14haski6l7hmhmzn5wjb961hwf5hkfgh";
+1 −16
Original line number Diff line number Diff line
@@ -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;

+0 −4
Original line number Diff line number Diff line
@@ -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 { };