diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/computing')
8 files changed, 359 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/computing/slurm-spank-stunnel/default.nix b/nixpkgs/pkgs/servers/computing/slurm-spank-stunnel/default.nix new file mode 100644 index 000000000000..3534c8981a26 --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/slurm-spank-stunnel/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub, slurm } : + +stdenv.mkDerivation rec { + pname = "slurm-spank-stunnel"; + version = "0.2.2"; + + src = fetchFromGitHub { + owner = "stanford-rc"; + repo = "slurm-spank-stunnel"; + rev = version; + sha256 = "15cpd49ccvzsmmr3gk8svm2nz461rvs4ybczckyf4yla0xzp06gj"; + }; + + patches = [ ./hostlist.patch ]; + + buildPhase = '' + gcc -I${lib.getDev slurm}/include -shared -fPIC -o stunnel.so slurm-spank-stunnel.c + ''; + + installPhase = '' + mkdir -p $out/lib $out/etc/slurm/plugstack.conf.d + install -m 755 stunnel.so $out/lib + install -m 644 plugstack.conf $out/etc/slurm/plugstack.conf.d/stunnel.conf.example + ''; + + meta = with lib; { + homepage = "https://github.com/stanford-rc/slurm-spank-stunnel"; + description = "Plugin for SLURM for SSH tunneling and port forwarding support"; + platforms = platforms.linux; + license = licenses.gpl3Only; + maintainers = with maintainers; [ markuskowa ]; + }; +} diff --git a/nixpkgs/pkgs/servers/computing/slurm-spank-stunnel/hostlist.patch b/nixpkgs/pkgs/servers/computing/slurm-spank-stunnel/hostlist.patch new file mode 100644 index 000000000000..0fc1d0626aab --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/slurm-spank-stunnel/hostlist.patch @@ -0,0 +1,13 @@ +diff --git a/slurm-spank-stunnel.c b/slurm-spank-stunnel.c +index 81fb4fd..dbe69f6 100644 +--- a/slurm-spank-stunnel.c ++++ b/slurm-spank-stunnel.c +@@ -278,7 +278,7 @@ int _stunnel_connect_nodes (char* nodes) + { + + char* host; +- hostlist_t hlist; ++ hostlist_t *hlist; + + // Connect to the first host in the list + hlist = slurm_hostlist_create(nodes); diff --git a/nixpkgs/pkgs/servers/computing/slurm-spank-x11/default.nix b/nixpkgs/pkgs/servers/computing/slurm-spank-x11/default.nix new file mode 100644 index 000000000000..278e1320fa0a --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/slurm-spank-x11/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchFromGitHub, slurm } : +stdenv.mkDerivation rec { + pname = "slurm-spank-x11"; + version = "0.2.5"; + + src = fetchFromGitHub { + owner = "hautreux"; + repo = "slurm-spank-x11"; + rev = version; + sha256 = "1dmsr7whxcxwnlvl1x4s3bqr5cr6q5ssb28vqi67w5hj4sshisry"; + }; + + patches = [ ./hostlist.patch ]; + + buildPhase = '' + gcc -DX11_LIBEXEC_PROG="\"$out/bin/slurm-spank-x11\"" \ + -g -o slurm-spank-x11 slurm-spank-x11.c + gcc -I${lib.getDev slurm}/include -DX11_LIBEXEC_PROG="\"$out/bin/slurm-spank-x11\"" -shared -fPIC \ + -g -o x11.so slurm-spank-x11-plug.c + ''; + + installPhase = '' + mkdir -p $out/bin $out/lib + install -m 755 slurm-spank-x11 $out/bin + install -m 755 x11.so $out/lib + ''; + + meta = with lib; { + homepage = "https://github.com/hautreux/slurm-spank-x11"; + description = "Plugin for SLURM to allow for interactive X11 sessions"; + mainProgram = "slurm-spank-x11"; + platforms = platforms.linux; + license = licenses.gpl3Only; + maintainers = with maintainers; [ markuskowa ]; + }; +} + + + diff --git a/nixpkgs/pkgs/servers/computing/slurm-spank-x11/hostlist.patch b/nixpkgs/pkgs/servers/computing/slurm-spank-x11/hostlist.patch new file mode 100644 index 000000000000..c60bab236cea --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/slurm-spank-x11/hostlist.patch @@ -0,0 +1,13 @@ +diff --git a/slurm-spank-x11-plug.c b/slurm-spank-x11-plug.c +index bef6c14..7cb77c4 100644 +--- a/slurm-spank-x11-plug.c ++++ b/slurm-spank-x11-plug.c +@@ -608,7 +608,7 @@ int _connect_node (char* node,uint32_t jobid,uint32_t stepid) + int _x11_connect_nodes (char* nodes,uint32_t jobid,uint32_t stepid) + { + char* host; +- hostlist_t hlist; ++ hostlist_t *hlist; + int n=0; + int i; + diff --git a/nixpkgs/pkgs/servers/computing/slurm/common-env-echo.patch b/nixpkgs/pkgs/servers/computing/slurm/common-env-echo.patch new file mode 100644 index 000000000000..cff52116d145 --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/slurm/common-env-echo.patch @@ -0,0 +1,13 @@ +diff --git a/src/common/env.c b/src/common/env.c +index 4dad18fef1..730f28af96 100644 +--- a/src/common/env.c ++++ b/src/common/env.c +@@ -2073,7 +2073,7 @@ char **env_array_user_default(const char *username, int timeout, int mode, + char **env = NULL; + char *starttoken = "XXXXSLURMSTARTPARSINGHEREXXXX"; + char *stoptoken = "XXXXSLURMSTOPPARSINGHEREXXXXX"; +- char cmdstr[256], *env_loc = NULL; ++ char cmdstr[PATH_MAX], *env_loc = NULL; + char *stepd_path = NULL; + int fildes[2], found, fval, len, rc, timeleft; + int buf_read, buf_rem, config_timeout; diff --git a/nixpkgs/pkgs/servers/computing/slurm/default.nix b/nixpkgs/pkgs/servers/computing/slurm/default.nix new file mode 100644 index 000000000000..ae7c511f8401 --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/slurm/default.nix @@ -0,0 +1,105 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config, libtool, curl +, python3, munge, perl, pam, shadow, coreutils, dbus, libbpf +, ncurses, libmysqlclient, lua, hwloc, numactl +, readline, freeipmi, xorg, lz4, rdma-core, nixosTests +, pmix +, libjwt +, libyaml +, json_c +, http-parser +# enable internal X11 support via libssh2 +, enableX11 ? true +, enableGtk2 ? false, gtk2 +}: + +stdenv.mkDerivation rec { + pname = "slurm"; + version = "23.11.5.1"; + + # N.B. We use github release tags instead of https://www.schedmd.com/downloads.php + # because the latter does not keep older releases. + src = fetchFromGitHub { + owner = "SchedMD"; + repo = "slurm"; + # The release tags use - instead of . + rev = "${pname}-${builtins.replaceStrings ["."] ["-"] version}"; + hash = "sha256-YUsAPADRVf5JUd06DuSloeVNb8+3x7iwhFZ/JQyj0ZU="; + }; + + outputs = [ "out" "dev" ]; + + patches = [ + # increase string length to allow for full + # path of 'echo' in nix store + ./common-env-echo.patch + ]; + + prePatch = '' + substituteInPlace src/common/env.c \ + --replace "/bin/echo" "${coreutils}/bin/echo" + + # Autoconf does not support split packages for pmix (libs and headers). + # Fix the path to the pmix libraries, so dlopen can find it. + substituteInPlace src/plugins/mpi/pmix/mpi_pmix.c \ + --replace 'xstrfmtcat(full_path, "%s/", PMIXP_LIBPATH)' \ + 'xstrfmtcat(full_path, "${lib.getLib pmix}/lib/")' + + '' + (lib.optionalString enableX11 '' + substituteInPlace src/common/x11_util.c \ + --replace '"/usr/bin/xauth"' '"${xorg.xauth}/bin/xauth"' + ''); + + # 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 = [ pkg-config libtool python3 perl ]; + buildInputs = [ + curl python3 munge pam + libmysqlclient ncurses lz4 rdma-core + lua hwloc numactl readline freeipmi shadow.su + pmix json_c libjwt libyaml dbus libbpf + http-parser + ] ++ lib.optionals enableX11 [ xorg.xauth ] + ++ lib.optionals enableGtk2 [ gtk2 ]; + + configureFlags = with lib; + [ "--with-freeipmi=${freeipmi}" + "--with-http-parser=${http-parser}" + "--with-hwloc=${lib.getDev hwloc}" + "--with-json=${lib.getDev json_c}" + "--with-jwt=${libjwt}" + "--with-lz4=${lib.getDev lz4}" + "--with-munge=${munge}" + "--with-yaml=${lib.getDev libyaml}" + "--with-ofed=${lib.getDev rdma-core}" + "--sysconfdir=/etc/slurm" + "--with-pmix=${lib.getDev pmix}" + "--with-bpf=${libbpf}" + "--without-rpath" # Required for configure to pick up the right dlopen path + ] ++ (optional enableGtk2 "--disable-gtktest") + ++ (optional (!enableX11) "--disable-x11"); + + + preConfigure = '' + patchShebangs ./doc/html/shtml2html.py + patchShebangs ./doc/man/man2html.py + ''; + + postInstall = '' + rm -f $out/lib/*.la $out/lib/slurm/*.la + ''; + + enableParallelBuilding = true; + + passthru.tests.slurm = nixosTests.slurm; + + meta = with lib; { + homepage = "http://www.schedmd.com/"; + description = "Simple Linux Utility for Resource Management"; + platforms = platforms.linux; + license = licenses.gpl2Only; + maintainers = with maintainers; [ jagajaga markuskowa ]; + }; +} diff --git a/nixpkgs/pkgs/servers/computing/storm/default.nix b/nixpkgs/pkgs/servers/computing/storm/default.nix new file mode 100644 index 000000000000..d4669488901a --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/storm/default.nix @@ -0,0 +1,70 @@ +{ stdenv, lib, fetchurl, zip, unzip +, jdk, python2 +, confFile ? "" +, extraLibraryPaths ? [] +, extraJars ? [] +}: + +stdenv.mkDerivation rec { + pname = "apache-storm"; + version = "2.4.0"; + name = "${pname}-${version}"; + + src = fetchurl { + url = "mirror://apache/storm/${name}/${name}.tar.gz"; + sha256 = "sha256-VFNcaISPBRMGR5l/P6/pGnK7lHClDW2AmXJ00gzxwMY="; + }; + + nativeBuildInputs = [ zip unzip ]; + + installPhase = '' + mkdir -p $out/share/${name} + mv public $out/docs + mv examples $out/share/${name}/. + + mv external extlib* lib $out/. + mv conf bin $out/. + mv log4j2 $out/conf/. + ''; + + fixupPhase = '' + # Fix python reference + sed -i \ + -e '19iPYTHON=${python2}/bin/python' \ + -e 's|#!/usr/bin/.*python|#!${python2}/bin/python|' \ + $out/bin/storm + sed -i \ + -e 's|#!/usr/bin/.*python|#!${python2}/bin/python|' \ + -e "s|STORM_CONF_DIR = .*|STORM_CONF_DIR = os.getenv('STORM_CONF_DIR','$out/conf')|" \ + -e 's|STORM_LOG4J2_CONF_DIR =.*|STORM_LOG4J2_CONF_DIR = os.path.join(STORM_CONF_DIR, "log4j2")|' \ + $out/bin/storm.py + + # Default jdk location + sed -i -e 's|#.*export JAVA_HOME=.*|export JAVA_HOME="${jdk.home}"|' \ + $out/conf/storm-env.sh + ls -lh $out/lib + unzip $out/lib/storm-client-${version}.jar defaults.yaml; + zip -d $out/lib/storm-client-${version}.jar defaults.yaml; + sed -i \ + -e 's|java.library.path: .*|java.library.path: "${lib.concatStringsSep ":" extraLibraryPaths}"|' \ + -e 's|storm.log4j2.conf.dir: .*|storm.log4j2.conf.dir: "conf/log4j2"|' \ + defaults.yaml + ${lib.optionalString (confFile != "") "cat ${confFile} >> defaults.yaml"} + mv defaults.yaml $out/conf; + + # Link to extra jars + cd $out/lib; + ${lib.concatMapStrings (jar: "ln -s ${jar};\n") extraJars} + ''; + + dontStrip = true; + + meta = with lib; { + homepage = "https://storm.apache.org/"; + description = "Distributed realtime computation system"; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + license = licenses.asl20; + maintainers = with maintainers; [ edwtjo vizanto ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/servers/computing/torque/default.nix b/nixpkgs/pkgs/servers/computing/torque/default.nix new file mode 100644 index 000000000000..9cf0b9ba0b20 --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/torque/default.nix @@ -0,0 +1,73 @@ +{ lib, stdenv, fetchFromGitHub, openssl, flex, bison, pkg-config, groff, libxml2, util-linux +, coreutils, file, libtool, which, boost, autoreconfHook +}: + +stdenv.mkDerivation rec { + pname = "torque"; + version = "6.1.3h2"; + + src = fetchFromGitHub { + owner = "adaptivecomputing"; + repo = pname; + # branch 6.1.3h2, as they aren't pushing tags + # https://github.com/adaptivecomputing/torque/issues/467 + rev = "458883319157cfc5c509046d09f9eb8e68e8d398"; + sha256 = "1b56bc5j9wg87kcywzmhf7234byyrwax9v1pqsr9xmv2x7saakrr"; + }; + + strictDeps = true; + nativeBuildInputs = [ autoreconfHook pkg-config flex bison libxml2 ]; + buildInputs = [ + openssl groff libxml2 util-linux libtool + which boost + ]; + + enableParallelBuilding = true; + + # added to fix build with gcc7 + env.NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive"; + + postPatch = '' + substituteInPlace Makefile.am \ + --replace "contrib/init.d contrib/systemd" "" + substituteInPlace src/cmds/Makefile.am \ + --replace "/etc/" "$out/etc/" + substituteInPlace src/mom_rcp/pathnames.h \ + --replace /bin/cp ${coreutils}/bin/cp + substituteInPlace src/resmom/requests.c \ + --replace /bin/cp ${coreutils}/bin/cp + ''; + + preConfigure = '' + substituteInPlace ./configure \ + --replace '/usr/bin/file' '${file}/bin/file' + + # fix broken libxml2 detection + sed -i '/xmlLib\=/c\xmlLib=xml2' ./configure + + for s in fifo cray_t3e dec_cluster msic_cluster sgi_origin umn_cluster; do + substituteInPlace src/scheduler.cc/samples/$s/Makefile.in \ + --replace "schedprivdir = " "schedprivdir = $out/" + done + + for f in $(find ./ -name Makefile.in); do + echo patching $f... + sed -i $f -e '/PBS_MKDIRS/d' -e '/chmod u+s/d' + done + + patchShebangs buildutils + ''; + + postInstall = '' + cp -v buildutils/pbs_mkdirs $out/bin/ + cp -v torque.setup $out/bin/ + chmod +x $out/bin/pbs_mkdirs $out/bin/torque.setup + ''; + + meta = with lib; { + homepage = "http://www.adaptivecomputing.com/products/open-source/torque"; + description = "Resource management system for submitting and controlling jobs on supercomputers, clusters, and grids"; + platforms = platforms.linux; + license = "TORQUEv1.1"; + }; +} |