Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nixos/modules/services/computing/slurm/slurm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ in

package = mkOption {
type = types.package;
default = pkgs.slurm-llnl;
defaultText = "pkgs.slurm-llnl";
example = literalExample "pkgs.slurm-llnl-full";
default = pkgs.slurm;
defaultText = "pkgs.slurm";
example = literalExample "pkgs.slurm-full";
description = ''
The package to use for slurm binaries.
'';
Expand Down
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/pyslurm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ lib, fetchFromGitHub, buildPythonPackage, cython, slurm }:

buildPythonPackage rec {
name = "pyslurm";

src = fetchFromGitHub {
repo = "pyslurm";
owner = "PySlurm";
rev = "69e4f4fd66003b98ddb7da25613fe641d4ae160d";
sha256 = "051kafkndbniklxyf0drb360aiblnqcf9rqjbvmqh66zrfya1m28";
};

patches = [ ./pyslurm-dlfcn.patch ];

buildInputs = [ cython slurm ];
setupPyBuildFlags = [ "--slurm-lib=${slurm}/lib" "--slurm-inc=${slurm.dev}/include" ];

meta = with lib; {
homepage = "https://github.com/PySlurm/pyslurm";
description = "Python bindings to Slurm";
license = licenses.gpl2;
maintainers = [ maintainers.veprbl ];
};
}
18 changes: 18 additions & 0 deletions pkgs/development/python-modules/pyslurm/pyslurm-dlfcn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/pyslurm/__init__.py b/pyslurm/__init__.py
index 81643e1..e8b6836 100644
--- a/pyslurm/__init__.py
+++ b/pyslurm/__init__.py
@@ -11,8 +11,11 @@ import sys
old_dlopen_flags = ''
if hasattr(sys, "setdlopenflags"):
old_dlopen_flags = sys.getdlopenflags()
- import DLFCN
- sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL)
+ if sys.version_info >= (3,6):
+ from os import RTLD_GLOBAL
+ else:
+ from DLFCN import RTLD_GLOBAL
+ sys.setdlopenflags(old_dlopen_flags | RTLD_GLOBAL)

from .pyslurm import *

21 changes: 13 additions & 8 deletions pkgs/servers/computing/slurm/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
{ stdenv, fetchurl, pkgconfig, curl, python, munge, perl, pam, openssl
{ stdenv, fetchurl, pkgconfig, libtool, curl, python, munge, perl, pam, openssl
, ncurses, mysql, gtk2, lua, hwloc, numactl
}:

stdenv.mkDerivation rec {
name = "slurm-llnl-${version}";
version = "15-08-5-1";
name = "slurm-${version}";
version = "17.02.6";

src = fetchurl {
url = "https://github.com/SchedMD/slurm/archive/slurm-${version}.tar.gz";
sha256 = "05si1cn7zivggan25brsqfdw0ilvrlnhj96pwv16dh6vfkggzjr1";
url = "https://www.schedmd.com/downloads/latest/slurm-17.02.6.tar.bz2";
sha256 = "1sp4xg15jc569r6dh61svgk2fmy3ndcgr5358yryajslf1w14mzh";
};

outputs = [ "out" "dev" ];

nativeBuildInputs = [ pkgconfig ];
# nixos test fails to start slurmd with 'undefined symbol: slurm_job_preempt_mode'
# https://groups.google.com/forum/#!topic/slurm-devel/QHOajQ84_Es
# this doesn't fix tests completely at least makes slurmd to launch
hardeningDisable = [ "bindnow" ];

nativeBuildInputs = [ pkgconfig libtool ];
buildInputs = [
curl python munge perl pam openssl mysql.lib ncurses gtk2 lua hwloc numactl
];
Expand All @@ -25,8 +30,8 @@ stdenv.mkDerivation rec {
] ++ stdenv.lib.optional (gtk2 == null) "--disable-gtktest";

preConfigure = ''
substituteInPlace ./doc/html/shtml2html.py --replace "/usr/bin/env python" "${python.interpreter}"
substituteInPlace ./doc/man/man2html.py --replace "/usr/bin/env python" "${python.interpreter}"
patchShebangs ./doc/html/shtml2html.py
patchShebangs ./doc/man/man2html.py
Copy link
Member

Choose a reason for hiding this comment

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

Solution is ok. Often I just prefer the shotgun method and use patchShebangs . to avoid future shebangs maintenance.

'';

postInstall = ''
Expand Down
20 changes: 11 additions & 9 deletions pkgs/tools/security/munge/default.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
{ stdenv, fetchFromGitHub, gnused, perl, libgcrypt, zlib, bzip2 }:
{ stdenv, fetchFromGitHub, autoreconfHook, gawk, gnused, libgcrypt, zlib, bzip2 }:

stdenv.mkDerivation rec {
name = "munge-0.5.11";
name = "munge-0.5.12";

src = fetchFromGitHub {
owner = "dun";
repo = "munge";
rev = "${name}";
sha256 = "02847p742nq3cb8ayf5blrdicybq72nfsnggqkxr33cpppmsfwg9";
sha256 = "1wvkc63bqclpm5xmp3rn199x3jqd99255yicyydgz83cixp7wdbh";
};

buildInputs = [ gnused perl libgcrypt zlib bzip2 ];
nativeBuildInputs = [ autoreconfHook gawk gnused ];
buildInputs = [ libgcrypt zlib bzip2 ];

preConfigure = ''
preAutoreconf = ''
# Remove the install-data stuff, since it tries to write to /var
sed -i '505,511d' src/etc/Makefile.in
substituteInPlace src/Makefile.am --replace "etc \\" "\\"
'';

configureFlags = [
"--localstatedir=/var"
];

meta = {
meta = with stdenv.lib; {
description = ''
An authentication service for creating and validating credentials
'';
maintainers = [ stdenv.lib.maintainers.rickynils ];
platforms = stdenv.lib.platforms.unix;
license = licenses.lgpl3;
platforms = platforms.unix;
maintainers = [ maintainers.rickynils ];
};
}
4 changes: 2 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11485,9 +11485,9 @@ with pkgs;

storm = callPackage ../servers/computing/storm { };

slurm-llnl = callPackage ../servers/computing/slurm { gtk2 = null; };
slurm = callPackage ../servers/computing/slurm { gtk2 = null; };

slurm-llnl-full = appendToName "full" (callPackage ../servers/computing/slurm { });
Copy link
Member

Choose a reason for hiding this comment

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

It is cool to leave an alias.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right! #27364

slurm-full = appendToName "full" (callPackage ../servers/computing/slurm { });

systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { };

Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ in {

pysideTools = callPackage ../development/python-modules/pyside/tools.nix { };

pyslurm = callPackage ../development/python-modules/pyslurm {
slurm = pkgs.slurm;
};

python-sql = callPackage ../development/python-modules/python-sql { };

python-stdnum = callPackage ../development/python-modules/python-stdnum { };
Expand Down