diff options
Diffstat (limited to 'sys-cluster/slurm')
-rw-r--r-- | sys-cluster/slurm/Manifest | 12 | ||||
-rw-r--r-- | sys-cluster/slurm/files/logrotate | 20 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurm-22.05.3_autoconf-lua.patch | 49 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurm.confd | 6 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurm.tmpfiles | 3 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmctld.initd | 76 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmd.initd | 77 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmdbd.initd | 74 | ||||
-rw-r--r-- | sys-cluster/slurm/metadata.xml | 30 | ||||
-rw-r--r-- | sys-cluster/slurm/slurm-22.05.11.ebuild | 275 | ||||
-rw-r--r-- | sys-cluster/slurm/slurm-24.05.3.ebuild | 272 |
11 files changed, 894 insertions, 0 deletions
diff --git a/sys-cluster/slurm/Manifest b/sys-cluster/slurm/Manifest new file mode 100644 index 000000000000..35bd4e8ad44d --- /dev/null +++ b/sys-cluster/slurm/Manifest @@ -0,0 +1,12 @@ +AUX logrotate 360 BLAKE2B 36c5ce908a6434f03a3e140cd1fc0bfec50a6fa89d6120061a5a83d3b12d9a6137ae2fa3a83bd36f55f48c79d140f24d6933cda18fc79674e8b758cacc34a948 SHA512 f6edceef15960accbe72ddd34ff34934fa46b6d647c83e0d3a512d2ddc1ae6c60352e377cfa5332fd5cd817689e23680f7384f1b27fc49677b2e671e1bfe86b9 +AUX slurm-22.05.3_autoconf-lua.patch 1754 BLAKE2B 6968fdbd6520346b60ba88225cdca18b66cde2bad210d61c00cad725e88dd215b4c166aaf69e751c227679245d1c6d7949be381c89aa7629984efa6194878261 SHA512 46e1d8514cc07974477abf397b9b2ec591ae18c202e3447a3016fa6d1bdaa8ff66630eeedcc0dc3fae680f08206b0de87c3c2f9fc16ddf8863b6b845a5fd33a3 +AUX slurm.confd 155 BLAKE2B 4f0793808328b88ffa2b32b1accab6c0dfe0b01dc84210fee6a674361ddf9ea7b3f15ccc775c354198577849ab0791d403b153adee476fc7f1237d2177275bab SHA512 e4d21cdb6a427f0beaef0e157202308f9e86a41dea4532ee98b274a5979b5e82ec2ca4ca2996f6cb59045fd8b01e815aaad71673e2011cead788de3d879aa11f +AUX slurm.tmpfiles 108 BLAKE2B 9158c8be8d23c3d5505edb1932df9520be70b11ad778936653f09e4f247e1cfefb628f72fe977112acd94ea4a481d7881e5f3d0e0cfd3f725d0a751913bf0bf1 SHA512 a21ba949f8ed747a24aba856055e04fffb3d137c6c65f97ddd441efa08de2494c902f71a2ffb4c02328572acc9cf09a3075a4aa2021aa125216c0a5e4e792c24 +AUX slurmctld.initd 1842 BLAKE2B 25c9fd76dc888544888abb2790d8a0ae66254c0f8807bf48433a54fd34f49d2f4f95b5c6dd9e4ab1f40938c274be6be2e88cdb8959ecb12b4a86d07bc0a5bc86 SHA512 4356552630d1a154bbf369012c0315baf08b5b98ff6411d66ea3b1b039bfff5f105091b110e8fa1e64209eb0990038abda86d980cf2316ca97a5c10a43243df6 +AUX slurmd.initd 1962 BLAKE2B 231a734de92456d9e372906bc88f9942a559d3aa823c532c4d490928db37defe5493c62c0d70c33ee20933b22e66accf194a18842bc42d73a58148524092f7fe SHA512 9c83700e5c6ee01f4614ffdedb79012215552cc10c351bd0477404330a1aa5fb5ee9ac38426fef604cc0c3f8bfe1c80107df3e611d5e8afdca854ada7168bd7c +AUX slurmdbd.initd 1717 BLAKE2B e177a937f8bd97bb2f45e479e0f34b23cc23ab44b0000165a856ff8476560638a567baecad8aa8d57aeb76062f248039da7f440ddca8f5827e4729136a10d7de SHA512 6d21f667f4222ab62dc8d7f648e00205da982612d58b98e8e35e6b6602b3ad31c03e5130402437c77d3677b424da7b5226e2bfa8c5d29bc908fd618fc02697a8 +DIST slurm-22.05.11.tar.bz2 7151614 BLAKE2B f79406d50c74ecea9d612d2fad2b61cf8d87bf835d1f5d0482e9aa31e515ee7b017780bd4661af5d432e70805d1b069918f5924ff5a3d38dcc5b1f38d639a3b2 SHA512 ebe82f6ad6dec45ba611a294d1d19e8ad7853322190bf4be1f8175cd89e35120b26c349d45a1048aca802e96795a61d9ab432a9b4106c757835b7044bcbe459b +DIST slurm-24.05.3.tar.bz2 7189600 BLAKE2B 4da4c49a7db334494ea03529f45016741e93603680f592d0baf34657e12079f3766e32f67725d16c17336b28206cf920ae2314c9b7076bda22ee1cb239932229 SHA512 fa903aea77b667911d90e9bd7aec3a21b43d4f642e2fdf3f6eb309fd6c8ca0892fba36f371f67e944a4198248ff44d5b6ac6c0edd03cfd4f3e1828b03c12a539 +EBUILD slurm-22.05.11.ebuild 7737 BLAKE2B be18805a4e606f22561858eb15e0b4a33b03a2cd1328515511e19c64bf349d2a218eafed151b2f625f9a78f7c228289a46d10dd144a80c27fcc49ac2a780e3a0 SHA512 9aa0329597ff55f88a1c9fe80e327fd7f5fa08c87de277d146b48b4b3e85cab9cdcff5cb4fdc954346e14065139106fbb8a8f5a883ea47a1971249c76127f1e3 +EBUILD slurm-24.05.3.ebuild 7707 BLAKE2B 803385e2c14479ec923348aaa79ef3860185223cd8d7ae7078172a4515107739bb7e24380648eabf19dc2efd157199b1a86e5e4afb2f6509fb76b08d9816cb26 SHA512 113a57d50376d285fe1700f540ac910f3baa659980794d3078aa036f132cd9416e891892216050338e63b49dddbb5ade9b7811ac5b1b8d7fe1e251733a77bbe2 +MISC metadata.xml 1284 BLAKE2B 83de6a4aa9f76c609f91b01514e43191801e8843d714900bcc9c0aa4f895220fd14d9ccfa74f78d714298a92b73ea9bd3f636ffff850e257c4de37392d1aebed SHA512 7598eafbd07109ce281f977858ef7a48e6a5f7107219052aec09e0487e9a58999cb497466165a7c392c68631fc215e82b8db37f57ad7a1c13b51c5d09e8170cc diff --git a/sys-cluster/slurm/files/logrotate b/sys-cluster/slurm/files/logrotate new file mode 100644 index 000000000000..978a869eb993 --- /dev/null +++ b/sys-cluster/slurm/files/logrotate @@ -0,0 +1,20 @@ +/var/log/slurm/*.log { + weekly + compress + missingok + nocopytruncate + nocreate + nodelaycompress + nomail + notifempty + noolddir + rotate 5 + sharedscripts + size=5M + create 640 slurm slurm + postrotate + /etc/init.d/slurmd reload + /etc/init.d/slurmctld reload + /etc/init.d/slurmdbd reload + endscript +} diff --git a/sys-cluster/slurm/files/slurm-22.05.3_autoconf-lua.patch b/sys-cluster/slurm/files/slurm-22.05.3_autoconf-lua.patch new file mode 100644 index 000000000000..f5723f7b85bc --- /dev/null +++ b/sys-cluster/slurm/files/slurm-22.05.3_autoconf-lua.patch @@ -0,0 +1,49 @@ +diff --git a/auxdir/x_ac_lua.m4 b/auxdir/x_ac_lua.m4 +index 6941281bd5..206498191f 100644 +--- a/auxdir/x_ac_lua.m4 ++++ b/auxdir/x_ac_lua.m4 +@@ -12,20 +12,21 @@ + + AC_DEFUN([X_AC_LUA], + [ +- x_ac_lua_pkg_name="lua" +- #check for 5.4, 5.3, 5.2 and then 5.1 +- PKG_CHECK_EXISTS([lua5.4], [x_ac_lua_pkg_name=lua5.4], +- [PKG_CHECK_EXISTS([lua-5.4], [x_ac_lua_pkg_name=lua-5.4], +- [PKG_CHECK_EXISTS([lua5.3], [x_ac_lua_pkg_name=lua5.3], +- [PKG_CHECK_EXISTS([lua-5.3], [x_ac_lua_pkg_name=lua-5.3], +- [PKG_CHECK_EXISTS([lua5.2], [x_ac_lua_pkg_name=lua5.2], +- [PKG_CHECK_EXISTS([lua-5.2], [x_ac_lua_pkg_name=lua-5.2], +- [PKG_CHECK_EXISTS([lua5.1], [x_ac_lua_pkg_name=lua5.1], +- [PKG_CHECK_EXISTS([lua-5.1], [x_ac_lua_pkg_name=lua-5.1], +- [x_ac_lua_pkg_name="lua >= 5.1"])])])])])])])]) +- PKG_CHECK_MODULES([lua], ${x_ac_lua_pkg_name}, +- [x_ac_have_lua="yes"], +- [x_ac_have_lua="no"]) ++ AC_MSG_CHECKING([whether to enable support for job scripts written in Lua]) ++ AC_ARG_ENABLE( ++ [lua], ++ AS_HELP_STRING(--enable-lua, enable support for job scripts written in Lua), ++ [x_ac_enable_lua="$enableval"], ++ [x_ac_enable_lua=yes]) ++ AC_MSG_RESULT([$x_ac_enable_lua]) ++ ++ x_ac_have_lua=no ++ if test "x$x_ac_enable_lua" = "xyes"; then ++ x_ac_lua_pkg_name="lua" ++ PKG_CHECK_MODULES([lua], ${x_ac_lua_pkg_name}, ++ [x_ac_have_lua="yes"], ++ [AC_MSG_ERROR([Lua support requested but Lua not found])]) ++ fi + + if test "x$x_ac_have_lua" = "xyes"; then + saved_CFLAGS="$CFLAGS" +@@ -60,8 +61,6 @@ AC_DEFUN([X_AC_LUA], + fi + CFLAGS="$saved_CFLAGS" + LIBS="$saved_LIBS" +- else +- AC_MSG_WARN([unable to locate lua package]) + fi + + AM_CONDITIONAL(HAVE_LUA, test "x$x_ac_have_lua" = "xyes") diff --git a/sys-cluster/slurm/files/slurm.confd b/sys-cluster/slurm/files/slurm.confd new file mode 100644 index 000000000000..c406dc3f2a2c --- /dev/null +++ b/sys-cluster/slurm/files/slurm.confd @@ -0,0 +1,6 @@ +# /etc/conf.d/slurm: config file for /etc/init.d/slurm* +SLURMCTLD_OPTIONS="" +SLURMDBD_OPTIONS="" +SLURMD_OPTIONS="" +SLURM_USE_MUNGE="0" +SLURM_USE_YPBIND="0"
\ No newline at end of file diff --git a/sys-cluster/slurm/files/slurm.tmpfiles b/sys-cluster/slurm/files/slurm.tmpfiles new file mode 100644 index 000000000000..e8f5fa4103a9 --- /dev/null +++ b/sys-cluster/slurm/files/slurm.tmpfiles @@ -0,0 +1,3 @@ +d /run/slurm 755 slurm slurm - +d /var/tmp/slurm/slurmd 755 slurm slurm - +d /var/tmp/slurm 755 slurm slurm - diff --git a/sys-cluster/slurm/files/slurmctld.initd b/sys-cluster/slurm/files/slurmctld.initd new file mode 100644 index 000000000000..5cb5888fa153 --- /dev/null +++ b/sys-cluster/slurm/files/slurmctld.initd @@ -0,0 +1,76 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="reload" + +[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm + +depend() { + local _need + [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged" + [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind" + after logger slurmdbd + need ${_need} +} + +create_folder_and_set_permission() { + folder=${1} + # Fix permissions (/tmp is wiped at boot) + if [[ "${folder}" == "/tmp" ]]; then + eerror "SLURM: folder == ${folder} == /tmp" + exit + fi + if [[ "${folder}" == "/var/tmp" ]]; then + eerror "SLURM: folder == ${folder} == /var/tmp" + exit + fi + checkpath -d -o slurm:slurm "${folder}" +} + +checkconfig() { + if [ ! -e "/etc/slurm/slurm.conf" ]; then + eerror "Missing config /etc/slurm/slurm.conf" + eerror "Customize sample one or generate new by configurator.html" + eerror "in slurm doc directory" + return 1 + fi + + # Make sure folders exists + . /etc/slurm/slurm.conf + folders=( + ${SlurmdSpoolDir} + $(dirname ${SlurmctldLogFile}) + $(dirname ${SlurmctldPidFile}) + $(dirname ${SlurmdLogFile}) + $(dirname ${SlurmdPidFile}) + ${SlurmdSpoolDir} + ${StateSaveLocation} + ) + for folder in ${folders[@]}; do + create_folder_and_set_permission "${folder}" + done +} + +start() { + ebegin "Starting slurm control daemon" + checkconfig + start-stop-daemon --start --quiet --background \ + --pidfile /run/slurm/slurmctld.pid \ + --user slurm \ + --group slurm \ + --exec /usr/sbin/slurmctld -- ${SLURMCTLD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping slurm control daemon" + start-stop-daemon --stop --pidfile /run/slurm/slurmctld.pid + eend $? +} + +reload() { + ebegin "Reloading slurm daemon configuration" + start-stop-daemon --signal HUP --pidfile /run/slurm/slurmctld.pid + eend $? +} diff --git a/sys-cluster/slurm/files/slurmd.initd b/sys-cluster/slurm/files/slurmd.initd new file mode 100644 index 000000000000..c912468e8152 --- /dev/null +++ b/sys-cluster/slurm/files/slurmd.initd @@ -0,0 +1,77 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="reload" + +[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm + +depend() { + local _need + [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged" + [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind" + after logger + need ${_need} +} + +create_folder_and_set_permission() { + folder=${1} + # Fix permissions (/tmp is wiped at boot) + if [[ "${folder}" == "/tmp" ]]; then + eerror "SLURM: folder == ${folder} == /tmp" + exit + fi + if [[ "${folder}" == "/var/tmp" ]]; then + eerror "SLURM: folder == ${folder} == /var/tmp" + exit + fi + checkpath -d -o slurm:slurm ${folder} +} + +checkconfig() { + if [ ! -e "/etc/slurm/slurm.conf" ]; then + eerror "Missing config /etc/slurm/slurm.conf" + eerror "Customize sample one or generate new by configurator.html" + eerror "in slurm doc directory" + return 1 + fi + # Make sure folders exists + . /etc/slurm/slurm.conf + + for folder in ${SlurmdSpoolDir} \ + $(dirname ${SlurmctldLogFile}) \ + $(dirname ${SlurmctldPidFile}) \ + $(dirname ${SlurmdLogFile}) \ + $(dirname ${SlurmdPidFile}) \ + ${StateSaveLocation} + do + create_folder_and_set_permission "${folder}" + done +} + +start() { + ebegin "Starting slurm daemon" + checkconfig + # Slurm does not propagate limits, which can brakes InfiniBand + # See http://www.open-mpi.org/faq/?category=openfabrics + # and https://computing.llnl.gov/linux/slurm/faq.html#rlimit + ulimit -l unlimited + start-stop-daemon --start --quiet --background \ + --pidfile /run/slurm/slurmd.pid \ + --user root \ + --group root \ + --exec /usr/sbin/slurmd -- ${SLURMD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping slurm daemon" + start-stop-daemon --stop --pidfile /run/slurm/slurmd.pid + eend $? +} + +reload() { + ebegin "Reloading slurm daemon configuration" + start-stop-daemon --signal HUP --pidfile /run/slurm/slurmd.pid + eend $? +} diff --git a/sys-cluster/slurm/files/slurmdbd.initd b/sys-cluster/slurm/files/slurmdbd.initd new file mode 100644 index 000000000000..27b5102101cb --- /dev/null +++ b/sys-cluster/slurm/files/slurmdbd.initd @@ -0,0 +1,74 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="reload" + +[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm + +depend() { + local _need + [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged" + [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind" + after logger + need ${_need} +} + +create_folder_and_set_permission() { + folder=${1} + # Fix permissions (/tmp is wiped at boot) + if [[ "${folder}" == "/tmp" ]]; then + eerror "SLURM: folder == ${folder} == /tmp" + exit + fi + if [[ "${folder}" == "/var/tmp" ]]; then + eerror "SLURM: folder == ${folder} == /var/tmp" + exit + fi + checkpath -d -o slurm:slurm ${folder} +} + +checkconfig() { + if [ ! -e "/etc/slurm/slurmdbd.conf" ]; then + eerror "Missing config /etc/slurm/slurmdbd.conf" + return 1 + fi + + # Make sure folders exists + . /etc/slurm/slurm.conf + folders=( + ${SlurmdSpoolDir} + $(dirname ${SlurmctldLogFile}) + $(dirname ${SlurmctldPidFile}) + $(dirname ${SlurmdLogFile}) + $(dirname ${SlurmdPidFile}) + ${SlurmdSpoolDir} + ${StateSaveLocation} + ) + for folder in ${folders[@]}; do + create_folder_and_set_permission "${folder}" + done +} + +start() { + ebegin "Starting slurmdb daemon" + checkconfig + start-stop-daemon --start --quiet --background \ + --pidfile /run/slurm/slurmdbd.pid \ + --user slurm \ + --group slurm \ + --exec /usr/sbin/slurmdbd -- ${SLURMD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping slurmdb daemon" + start-stop-daemon --stop --pidfile /run/slurm/slurmdbd.pid + eend $? +} + +reload() { + ebegin "Reloading slurmdb daemon configuration" + start-stop-daemon --signal HUP --pidfile /run/slurm/slurmdbd.pid + eend $? +} diff --git a/sys-cluster/slurm/metadata.xml b/sys-cluster/slurm/metadata.xml new file mode 100644 index 000000000000..03dd0eb0dcf9 --- /dev/null +++ b/sys-cluster/slurm/metadata.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <upstream> + <remote-id type="github">SchedMD/slurm</remote-id> + </upstream> + <maintainer type="person"> + <email>alexxy@gentoo.org</email> + <name>Alexey Shvetsov</name> + </maintainer> + <maintainer type="project"> + <email>cluster@gentoo.org</email> + <name>Gentoo Cluster Project</name> + </maintainer> + <use> + <flag name="html">Build html documentation</flag> + <flag name="ipmi">Build support for collecting some ipmi stats</flag> + <flag name="json">Add support for json-persing via json-c</flag> + <flag name="munge">Enable authentication via munge</flag> + <flag name="multiple-slurmd">Allow multiple slurmd to run</flag> + <flag name="numa">Add NUMA awareness</flag> + <flag name="nvml">Enable the NVML device discovery</flag> + <flag name="ofed">Add Infiniband support via ofed</flag> + <flag name="slurmdbd">Install SQL server for slurmdbd</flag> + <flag name="slurmrestd">Enable interface to Slurm via REST API</flag> + <flag name="torque">Enable perl scripts that emulates pbs (qstat, qsub etc.)</flag> + <flag name="ucx">Enable Unified Communication X library support</flag> + <flag name="yaml">Enable YAML support</flag> + </use> +</pkgmetadata> diff --git a/sys-cluster/slurm/slurm-22.05.11.ebuild b/sys-cluster/slurm/slurm-22.05.11.ebuild new file mode 100644 index 000000000000..e074bd8ddc39 --- /dev/null +++ b/sys-cluster/slurm/slurm-22.05.11.ebuild @@ -0,0 +1,275 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1..4} ) + +if [[ ${PV} == *9999* ]]; then + EGIT_REPO_URI="https://github.com/SchedMD/slurm.git" + INHERIT_GIT="git-r3" + MY_P="${P}" +else + if [[ ${PV} == *pre* || ${PV} == *rc* ]]; then + MY_PV=$(ver_rs '-0.') # pre-releases or release-candidate + else + MY_PV=$(ver_rs 1-4 '-') # stable releases + fi + MY_P="${P}" + INHERIT_GIT="" + SRC_URI="https://download.schedmd.com/slurm/${MY_P}.tar.bz2" + KEYWORDS="~amd64 ~arm64 ~riscv ~x86" +fi + +inherit autotools bash-completion-r1 flag-o-matic lua-single pam \ + perl-module prefix toolchain-funcs systemd ${INHERIT_GIT} \ + tmpfiles + +DESCRIPTION="A Highly Scalable Resource Manager" +HOMEPAGE="https://www.schedmd.com https://github.com/SchedMD/slurm" + +LICENSE="GPL-2" +S="${WORKDIR}/${MY_P}" +SLOT="0" + +IUSE="X debug hdf5 html ipmi json lua multiple-slurmd +munge mysql numa + nvml ofed pam perl slurmdbd slurmrestd static-libs torque ucx yaml" + +# See bug #813924 for hdf5lib < dep, needs proper fix +COMMON_DEPEND=" + !sys-cluster/torque + !net-analyzer/slurm + !net-analyzer/sinfo + || ( sys-cluster/pmix[-pmi] >=sys-cluster/openmpi-2.0.0 ) + mysql? ( + || ( dev-db/mariadb-connector-c dev-db/mysql-connector-c ) + slurmdbd? ( || ( dev-db/mariadb:* dev-db/mysql:* ) ) + ) + slurmrestd? ( + net-libs/http-parser + ) + munge? ( sys-auth/munge ) + pam? ( sys-libs/pam ) + lua? ( ${LUA_DEPS} ) + ipmi? ( sys-libs/freeipmi ) + json? ( dev-libs/json-c:= ) + hdf5? ( <sci-libs/hdf5-1.12:= ) + numa? ( sys-process/numactl ) + nvml? ( dev-util/nvidia-cuda-toolkit x11-drivers/nvidia-drivers ) + ofed? ( sys-cluster/rdma-core ) + ucx? ( sys-cluster/ucx ) + yaml? ( dev-libs/libyaml ) + X? ( net-libs/libssh2 ) + >=sys-apps/hwloc-1.1.1-r1:= + sys-libs/ncurses:0= + app-arch/lz4:0= + dev-libs/glib:2= + sys-apps/dbus + sys-libs/readline:0=" + +DEPEND="${COMMON_DEPEND} + html? ( sys-apps/man2html )" + +BDEPEND="acct-user/slurm + acct-group/slurm" + +RDEPEND="${COMMON_DEPEND} + dev-libs/libcgroup" + +REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} ) + torque? ( perl ) + slurmrestd? ( json ) " + +LIBSLURM_PERL_S="${S}/contribs/perlapi/libslurm/perl" +LIBSLURMDB_PERL_S="${S}/contribs/perlapi/libslurmdb/perl" + +RESTRICT="test" + +PATCHES=( + "${FILESDIR}"/${PN}-22.05.3_autoconf-lua.patch +) + +pkg_setup() { + append-ldflags -Wl,-z,lazy + use lua && lua-single_pkg_setup +} + +src_unpack() { + if [[ ${PV} == *9999* ]]; then + git-r3_src_unpack + else + default + fi +} + +src_prepare() { + tc-ld-force-bfd + default + + # pids should go to /var/run/slurm + sed \ + -e 's:/tmp:/var/tmp:g' \ + -e "s:/var/run/slurmctld.pid:${EPREFIX}/run/slurm/slurmctld.pid:g" \ + -e "s:/var/run/slurmd.pid:${EPREFIX}/run/slurm/slurmd.pid:g" \ + -e "s:StateSaveLocation=.*:StateSaveLocation=${EPREFIX}/var/spool/slurm:g" \ + -e "s:SlurmdSpoolDir=.*:SlurmdSpoolDir=${EPREFIX}/var/spool/slurm/slurmd:g" \ + -i "${S}/etc/slurm.conf.example" \ + || die "Can't sed for /var/run/slurmctld.pid" + sed \ + -e "s:/var/run/slurmdbd.pid:${EPREFIX}/run/slurm/slurmdbd.pid:g" \ + -i "${S}/etc/slurmdbd.conf.example" \ + || die "Can't sed for /var/run/slurmdbd.pid" + # gentooify systemd services + sed \ + -e 's:sysconfig/.*:conf.d/slurm:g' \ + -e 's:var/run/:run/slurm/:g' \ + -e '/^EnvironmentFile=.*/d' \ + -i "${S}/etc"/*.service.in \ + || die "Can't sed systemd services for sysconfig or var/run/" + + sed -e '/AM_PATH_GTK_2_0/d' -i configure.ac || die + + hprefixify auxdir/{ax_check_zlib,x_ac_{lz4,ofed,munge}}.m4 + eautoreconf +} + +src_configure() { + local myconf=( + CPPFLAGS="-I/opt/cuda/include" + --sysconfdir="${EPREFIX}/etc/${PN}" + --with-hwloc="${EPREFIX}/usr" + --htmldir="${EPREFIX}/usr/share/doc/${PF}" + $(use_enable debug) + $(use_enable lua) + $(use_enable pam) + $(use_enable X x11) + $(use_with munge) + $(use_with json) + $(use_with hdf5) + $(use_with nvml) + $(use_with ofed) + $(use_with ucx) + $(use_with yaml) + $(use_enable static-libs static) + $(use_enable slurmrestd) + $(use_enable multiple-slurmd) + ) + use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) ) + use mysql || myconf+=( --without-mysql_config ) + econf "${myconf[@]}" + + if use perl ; then + # small hack to make it compile + mkdir -p "${S}/src/api/.libs" || die + mkdir -p "${S}/src/db_api/.libs" || die + touch "${S}/src/api/.libs/libslurm.so" || die + touch "${S}/src/db_api/.libs/libslurmdb.so" || die + cd "${LIBSLURM_PERL_S}" || die + S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure + cd "${LIBSLURMDB_PERL_S}" || die + S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure + cd "${S}" || die + rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs" || die + fi +} + +src_compile() { + default + use pam && emake -C contribs/pam + if use perl ; then + cd "${LIBSLURM_PERL_S}" || die + S="${LIBSLURM_PERL_S}" perl-module_src_compile + cd "${LIBSLURMDB_PERL_S}" || die + S="${LIBSLURMDB_PERL_S}" perl-module_src_compile + cd "${S}" || die + fi + use torque && emake -C contribs/torque +} + +src_install() { + default + use pam && emake DESTDIR="${D}" -C contribs/pam install + if use perl; then + cd "${LIBSLURM_PERL_S}" || die + S="${LIBSLURM_PERL_S}" perl-module_src_install + cd "${LIBSLURMDB_PERL_S}" || die + S="${LIBSLURMDB_PERL_S}" perl-module_src_install + cd "${S}" || die + fi + if use torque; then + emake DESTDIR="${D}" -C contribs/torque + rm -f "${D}"/usr/bin/mpiexec || die + fi + use static-libs || find "${ED}" -name '*.la' -exec rm {} + + # install sample configs + keepdir /etc/slurm + insinto /etc/slurm + doins \ + etc/prolog.example \ + etc/cgroup.conf.example \ + etc/slurm.conf.example \ + etc/slurmdbd.conf.example + exeinto /etc/slurm + keepdir /etc/slurm/layouts.d + # install init.d files + newinitd "$(prefixify_ro "${FILESDIR}/slurmd.initd")" slurmd + newinitd "$(prefixify_ro "${FILESDIR}/slurmctld.initd")" slurmctld + newinitd "$(prefixify_ro "${FILESDIR}/slurmdbd.initd")" slurmdbd + # install conf.d files + newconfd "${FILESDIR}/slurm.confd" slurm + # install logrotate file + insinto /etc/logrotate.d + newins "${FILESDIR}/logrotate" slurm + # install bashcomp + newbashcomp contribs/slurm_completion_help/slurm_completion.sh scontrol + bashcomp_alias scontrol \ + sreport sacctmgr squeue scancel sshare sbcast sinfo \ + sprio sacct salloc sbatch srun sattach sdiag sstat + # install systemd files + newtmpfiles "${FILESDIR}/slurm.tmpfiles" slurm.conf + systemd_dounit etc/slurmd.service etc/slurmctld.service etc/slurmdbd.service + + paths=( + /var/${PN}/checkpoint + /var/${PN} + /var/spool/${PN}/slurmd + /var/spool/${PN} + /var/log/${PN} + ) + local folder_path + for folder_path in ${paths[@]}; do + keepdir ${folder_path} + fowners ${PN}:${PN} ${folder_path} + done +} + +pkg_preinst() { + if use munge; then + sed -i 's,\(SLURM_USE_MUNGE=\).*,\11,' "${D}"/etc/conf.d/slurm || die + fi +} + +pkg_postinst() { + tmpfiles_process slurm.conf + + elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html" + elog "through a (javascript enabled) browser to create a configureation file." + elog "Copy that file to /etc/slurm/slurm.conf on all nodes (including the headnode) of your cluster." + echo + elog "For cgroup support, please see https://www.schedmd.com/slurmdocs/cgroup.conf.html" + elog "Your kernel must be compiled with the wanted cgroup feature:" + elog " For the proctrack plugin:" + elog " freezer" + elog " For the task plugin:" + elog " cpuset, memory, devices" + elog " For the accounting plugin:" + elog " cpuacct, memory, blkio" + elog "Then, set these options in /etc/slurm/slurm.conf:" + elog " ProctrackType=proctrack/cgroup" + elog " TaskPlugin=task/cgroup" + einfo + ewarn "Paths were created for slurm. Please use these paths in /etc/slurm/slurm.conf:" + for folder_path in ${paths[@]}; do + ewarn " ${folder_path}" + done +} diff --git a/sys-cluster/slurm/slurm-24.05.3.ebuild b/sys-cluster/slurm/slurm-24.05.3.ebuild new file mode 100644 index 000000000000..9c7134d77ef4 --- /dev/null +++ b/sys-cluster/slurm/slurm-24.05.3.ebuild @@ -0,0 +1,272 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1..4} ) + +if [[ ${PV} == *9999* ]]; then + EGIT_REPO_URI="https://github.com/SchedMD/slurm.git" + INHERIT_GIT="git-r3" + MY_P="${P}" +else + if [[ ${PV} == *pre* || ${PV} == *rc* ]]; then + MY_PV=$(ver_rs '-0.') # pre-releases or release-candidate + else + MY_PV=$(ver_rs 1-4 '-') # stable releases + fi + MY_P="${P}" + INHERIT_GIT="" + SRC_URI="https://download.schedmd.com/slurm/${MY_P}.tar.bz2" + KEYWORDS="~amd64 ~arm64 ~riscv ~x86" +fi + +inherit autotools bash-completion-r1 flag-o-matic lua-single pam \ + perl-module prefix toolchain-funcs systemd ${INHERIT_GIT} \ + tmpfiles + +DESCRIPTION="A Highly Scalable Resource Manager" +HOMEPAGE="https://www.schedmd.com https://github.com/SchedMD/slurm" + +LICENSE="GPL-2" +S="${WORKDIR}/${MY_P}" +SLOT="0" + +IUSE="X debug hdf5 html ipmi json lua multiple-slurmd +munge mysql numa + nvml ofed pam perl slurmdbd slurmrestd static-libs torque ucx yaml" + +# See bug #813924 for hdf5lib < dep, needs proper fix +COMMON_DEPEND=" + !sys-cluster/torque + !net-analyzer/slurm + !net-analyzer/sinfo + || ( sys-cluster/pmix[-pmi] >=sys-cluster/openmpi-2.0.0 ) + mysql? ( + || ( dev-db/mariadb-connector-c dev-db/mysql-connector-c ) + slurmdbd? ( || ( dev-db/mariadb:* dev-db/mysql:* ) ) + ) + slurmrestd? ( + net-libs/http-parser + ) + munge? ( sys-auth/munge ) + pam? ( sys-libs/pam ) + lua? ( ${LUA_DEPS} ) + ipmi? ( sys-libs/freeipmi ) + json? ( dev-libs/json-c:= ) + hdf5? ( <sci-libs/hdf5-1.12:= ) + numa? ( sys-process/numactl ) + nvml? ( dev-util/nvidia-cuda-toolkit x11-drivers/nvidia-drivers ) + ofed? ( sys-cluster/rdma-core ) + ucx? ( sys-cluster/ucx ) + yaml? ( dev-libs/libyaml ) + X? ( net-libs/libssh2 ) + >=sys-apps/hwloc-1.1.1-r1:= + sys-libs/ncurses:0= + app-arch/lz4:0= + dev-libs/glib:2= + sys-apps/dbus + sys-libs/readline:0=" + +DEPEND="${COMMON_DEPEND} + html? ( sys-apps/man2html )" + +BDEPEND="acct-user/slurm + acct-group/slurm" + +RDEPEND="${COMMON_DEPEND} + dev-libs/libcgroup" + +REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} ) + torque? ( perl ) + slurmrestd? ( json ) " + +LIBSLURM_PERL_S="${S}/contribs/perlapi/libslurm/perl" +LIBSLURMDB_PERL_S="${S}/contribs/perlapi/libslurmdb/perl" + +RESTRICT="test" + +pkg_setup() { + append-ldflags -Wl,-z,lazy + use lua && lua-single_pkg_setup +} + +src_unpack() { + if [[ ${PV} == *9999* ]]; then + git-r3_src_unpack + else + default + fi +} + +src_prepare() { + tc-ld-force-bfd + default + + # pids should go to /var/run/slurm + sed \ + -e 's:/tmp:/var/tmp:g' \ + -e "s:/var/run/slurmctld.pid:${EPREFIX}/run/slurm/slurmctld.pid:g" \ + -e "s:/var/run/slurmd.pid:${EPREFIX}/run/slurm/slurmd.pid:g" \ + -e "s:StateSaveLocation=.*:StateSaveLocation=${EPREFIX}/var/spool/slurm:g" \ + -e "s:SlurmdSpoolDir=.*:SlurmdSpoolDir=${EPREFIX}/var/spool/slurm/slurmd:g" \ + -i "${S}/etc/slurm.conf.example" \ + || die "Can't sed for /var/run/slurmctld.pid" + sed \ + -e "s:/var/run/slurmdbd.pid:${EPREFIX}/run/slurm/slurmdbd.pid:g" \ + -i "${S}/etc/slurmdbd.conf.example" \ + || die "Can't sed for /var/run/slurmdbd.pid" + # gentooify systemd services + sed \ + -e 's:sysconfig/.*:conf.d/slurm:g' \ + -e 's:var/run/:run/slurm/:g' \ + -e '/^EnvironmentFile=.*/d' \ + -i "${S}/etc"/*.service.in \ + || die "Can't sed systemd services for sysconfig or var/run/" + + sed -e '/AM_PATH_GTK_2_0/d' -i configure.ac || die + + hprefixify auxdir/{ax_check_zlib,x_ac_{lz4,ofed,munge}}.m4 + eautoreconf +} + +src_configure() { + local myconf=( + CPPFLAGS="-I/opt/cuda/include" + --sysconfdir="${EPREFIX}/etc/${PN}" + --with-hwloc="${EPREFIX}/usr" + --htmldir="${EPREFIX}/usr/share/doc/${PF}" + $(use_enable debug) + $(use_with lua) + $(use_enable pam) + $(use_enable X x11) + $(use_with munge) + $(use_with json) + $(use_with hdf5) + $(use_with nvml) + $(use_with ofed) + $(use_with ucx) + $(use_with yaml) + $(use_enable static-libs static) + $(use_enable slurmrestd) + $(use_enable multiple-slurmd) + ) + use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) ) + use mysql || myconf+=( --without-mysql_config ) + econf "${myconf[@]}" + + if use perl ; then + # small hack to make it compile + mkdir -p "${S}/src/api/.libs" || die + mkdir -p "${S}/src/db_api/.libs" || die + touch "${S}/src/api/.libs/libslurm.so" || die + touch "${S}/src/db_api/.libs/libslurmdb.so" || die + cd "${LIBSLURM_PERL_S}" || die + S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure + cd "${LIBSLURMDB_PERL_S}" || die + S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure + cd "${S}" || die + rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs" || die + fi +} + +src_compile() { + default + use pam && emake -C contribs/pam + if use perl ; then + cd "${LIBSLURM_PERL_S}" || die + S="${LIBSLURM_PERL_S}" perl-module_src_compile + cd "${LIBSLURMDB_PERL_S}" || die + S="${LIBSLURMDB_PERL_S}" perl-module_src_compile + cd "${S}" || die + fi + use torque && emake -C contribs/torque +} + +src_install() { + default + use pam && emake DESTDIR="${D}" -C contribs/pam install + if use perl; then + cd "${LIBSLURM_PERL_S}" || die + S="${LIBSLURM_PERL_S}" perl-module_src_install + cd "${LIBSLURMDB_PERL_S}" || die + S="${LIBSLURMDB_PERL_S}" perl-module_src_install + cd "${S}" || die + fi + if use torque; then + emake DESTDIR="${D}" -C contribs/torque + rm -f "${D}"/usr/bin/mpiexec || die + fi + use static-libs || find "${ED}" -name '*.la' -exec rm {} + + # install sample configs + keepdir /etc/slurm + insinto /etc/slurm + doins \ + etc/prolog.example \ + etc/cgroup.conf.example \ + etc/slurm.conf.example \ + etc/slurmdbd.conf.example + exeinto /etc/slurm + keepdir /etc/slurm/layouts.d + # install init.d files + newinitd "$(prefixify_ro "${FILESDIR}/slurmd.initd")" slurmd + newinitd "$(prefixify_ro "${FILESDIR}/slurmctld.initd")" slurmctld + newinitd "$(prefixify_ro "${FILESDIR}/slurmdbd.initd")" slurmdbd + # install conf.d files + newconfd "${FILESDIR}/slurm.confd" slurm + # install logrotate file + insinto /etc/logrotate.d + newins "${FILESDIR}/logrotate" slurm + # install bashcomp + newbashcomp contribs/slurm_completion_help/slurm_completion.sh scontrol + bashcomp_alias scontrol \ + sreport sacctmgr squeue scancel sshare sbcast sinfo \ + sprio sacct salloc sbatch srun sattach sdiag sstat \ + scrontab slurmrestd strigger + # install systemd files + newtmpfiles "${FILESDIR}/slurm.tmpfiles" slurm.conf + systemd_dounit etc/slurmd.service etc/slurmctld.service etc/slurmdbd.service + + paths=( + /var/${PN}/checkpoint + /var/${PN} + /var/spool/${PN}/slurmd + /var/spool/${PN} + /var/log/${PN} + ) + local folder_path + for folder_path in ${paths[@]}; do + keepdir ${folder_path} + fowners ${PN}:${PN} ${folder_path} + done +} + +pkg_preinst() { + if use munge; then + sed -i 's,\(SLURM_USE_MUNGE=\).*,\11,' "${D}"/etc/conf.d/slurm || die + fi +} + +pkg_postinst() { + tmpfiles_process slurm.conf + + elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html" + elog "through a (javascript enabled) browser to create a configureation file." + elog "Copy that file to /etc/slurm/slurm.conf on all nodes (including the headnode) of your cluster." + echo + elog "For cgroup support, please see https://www.schedmd.com/slurmdocs/cgroup.conf.html" + elog "Your kernel must be compiled with the wanted cgroup feature:" + elog " For the proctrack plugin:" + elog " freezer" + elog " For the task plugin:" + elog " cpuset, memory, devices" + elog " For the accounting plugin:" + elog " cpuacct, memory, blkio" + elog "Then, set these options in /etc/slurm/slurm.conf:" + elog " ProctrackType=proctrack/cgroup" + elog " TaskPlugin=task/cgroup" + einfo + ewarn "Paths were created for slurm. Please use these paths in /etc/slurm/slurm.conf:" + for folder_path in ${paths[@]}; do + ewarn " ${folder_path}" + done +} |