diff options
author | Alexey Shvetsov <alexxy@gentoo.org> | 2011-07-03 23:23:21 +0000 |
---|---|---|
committer | Alexey Shvetsov <alexxy@gentoo.org> | 2011-07-03 23:23:21 +0000 |
commit | 0f8d7638dd0028a73eca75d225fd9ecf486dd59d (patch) | |
tree | b6b5d992e93ec3aa91f9ff8a53643383610be56a /sys-cluster | |
parent | [sys-cluster/maui] Add slurm || pbs support to maui (diff) | |
download | gentoo-2-0f8d7638dd0028a73eca75d225fd9ecf486dd59d.tar.gz gentoo-2-0f8d7638dd0028a73eca75d225fd9ecf486dd59d.tar.bz2 gentoo-2-0f8d7638dd0028a73eca75d225fd9ecf486dd59d.zip |
[sys-cluster/slurm] Initial import
(Portage version: 2.2.0_alpha43/cvs/Linux x86_64)
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/slurm/ChangeLog | 11 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurm.confd | 5 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmctld.initd | 46 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmd.initd | 46 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmdbd.initd | 44 | ||||
-rw-r--r-- | sys-cluster/slurm/metadata.xml | 13 | ||||
-rw-r--r-- | sys-cluster/slurm/slurm-2.2.7.ebuild | 122 |
7 files changed, 287 insertions, 0 deletions
diff --git a/sys-cluster/slurm/ChangeLog b/sys-cluster/slurm/ChangeLog new file mode 100644 index 000000000000..7646cce3572e --- /dev/null +++ b/sys-cluster/slurm/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for sys-cluster/slurm +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/ChangeLog,v 1.1 2011/07/03 23:23:21 alexxy Exp $ + +*slurm-2.2.7 (03 Jul 2011) + + 03 Jul 2011; Alexey Shvetsov <alexxy@gentoo.org> +slurm-2.2.7.ebuild, + +files/slurm.confd, +files/slurmctld.initd, +files/slurmd.initd, + +files/slurmdbd.initd, +metadata.xml: + Initial import + diff --git a/sys-cluster/slurm/files/slurm.confd b/sys-cluster/slurm/files/slurm.confd new file mode 100644 index 000000000000..13b69146e921 --- /dev/null +++ b/sys-cluster/slurm/files/slurm.confd @@ -0,0 +1,5 @@ +# /etc/conf.d/slurm: config file for /etc/init.d/slurm* +SLURMCTLD_OPTIONS="" +SLURMDBD_OPTIONS="" +SLURMD_OPTIONS="" +SLURM_USE_MUNGE="0" diff --git a/sys-cluster/slurm/files/slurmctld.initd b/sys-cluster/slurm/files/slurmctld.initd new file mode 100644 index 000000000000..0ebba3ea8616 --- /dev/null +++ b/sys-cluster/slurm/files/slurmctld.initd @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmctld.initd,v 1.1 2011/07/03 23:23:21 alexxy Exp $ + +opts="reload" + +[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm + +depend() { + local _need="net" + [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged" + after logger + need ${_need} +} + +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 +} + +start() { + ebegin "Starting slurm control daemon" + start-stop-daemon --start --quiet --background \ + --pidfile /var/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 /var/run/slurm/slurmctld.pid + eend $? +} + +reload() { + ebegin "Reloading slurm daemon configuration" + killproc slurmctld -HUP + eend $? +} diff --git a/sys-cluster/slurm/files/slurmd.initd b/sys-cluster/slurm/files/slurmd.initd new file mode 100644 index 000000000000..1014630e633c --- /dev/null +++ b/sys-cluster/slurm/files/slurmd.initd @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmd.initd,v 1.1 2011/07/03 23:23:21 alexxy Exp $ + +opts="reload" + +[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm + +depend() { + local _need="net" + [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged" + after logger + need ${_need} +} + +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 +} + +start() { + ebegin "Starting slurm daemon" + start-stop-daemon --start --quiet --background \ + --pidfile /var/run/slurm/slurmd.pid \ + --user slurm \ + --group slurm \ + --exec /usr/sbin/slurmd -- ${SLURMD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping slurm daemon" + start-stop-daemon --stop --pidfile /var/run/slurm/slurmd.pid + eend $? +} + +reload() { + ebegin "Reloading slurm daemon configuration" + killproc slurmd -HUP + eend $? +} diff --git a/sys-cluster/slurm/files/slurmdbd.initd b/sys-cluster/slurm/files/slurmdbd.initd new file mode 100644 index 000000000000..6d3a97a54385 --- /dev/null +++ b/sys-cluster/slurm/files/slurmdbd.initd @@ -0,0 +1,44 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmdbd.initd,v 1.1 2011/07/03 23:23:21 alexxy Exp $ + +opts="reload" + +[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm + +depend() { + local _need="net" + [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged" + after logger + need ${_need} +} + +checkconfig() { + if [ ! -e "/etc/slurm/slurmdbd.conf" ]; then + eerror "Missing config /etc/slurm/slurmdbd.conf" + return 1 + fi +} + +start() { + ebegin "Starting slurmdb daemon" + start-stop-daemon --start --quiet --background \ + --pidfile /var/run/slurm/slurmddb.pid \ + --user slurm \ + --group slurm \ + --exec /usr/sbin/slurmddb -- ${SLURMD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping slurmdb daemon" + start-stop-daemon --stop --pidfile /var/run/slurm/slurmdbd.pid + eend $? +} + +reload() { + ebegin "Reloading slurmdb daemon configuration" + killproc slurmdbd -HUP + eend $? +} diff --git a/sys-cluster/slurm/metadata.xml b/sys-cluster/slurm/metadata.xml new file mode 100644 index 000000000000..56f2fa291314 --- /dev/null +++ b/sys-cluster/slurm/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>cluster</herd> + <maintainer> + <email>alexxy@gentoo.org</email> + </maintainer> + <use> + <flag name='maui'>Enable maui scheduler support</flag> + <flag name='munge'>Enable authentication via munge</flag> + <flag name='pbs-compat'>Enable pbs wrappers (qsub,qdel,qstat, etc..)</flag> + </use> +</pkgmetadata> diff --git a/sys-cluster/slurm/slurm-2.2.7.ebuild b/sys-cluster/slurm/slurm-2.2.7.ebuild new file mode 100644 index 000000000000..0e679f7af269 --- /dev/null +++ b/sys-cluster/slurm/slurm-2.2.7.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/slurm-2.2.7.ebuild,v 1.1 2011/07/03 23:23:21 alexxy Exp $ + +EAPI=4 + +inherit eutils pam + +DESCRIPTION="SLURM: A Highly Scalable Resource Manager" +HOMEPAGE="https://computing.llnl.gov/linux/slurm/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="maui +munge mysql pam postgres ssl static-libs" + +DEPEND=" + !sys-cluster/torque + !net-analyzer/slurm + mysql? ( dev-db/mysql ) + munge? ( sys-auth/munge ) + pam? ( virtual/pam ) + postgres? ( dev-db/postgresql-base ) + ssl? ( dev-libs/openssl ) + >=sys-apps/hwloc-1.1.1-r1" +RDEPEND="${DEPEND} + maui? ( sys-cluster/maui[slurm] )" + +pkg_setup() { + enewgroup slurm + enewuser slurm -1 -1 /var/spool/slurm slurm +} + +src_prepare() { + # gentoo uses /sys/fs/cgroup instead of /dev/cgroup + sed -e 's:/dev/cgroup:/sys/fs/cgroup:g' \ + -i "${S}/doc/man/man5/cgroup.conf.5" \ + -i "${S}/etc/cgroup.conf.example" \ + -i "${S}/etc/cgroup.release_agent" \ + -i "${S}/src/plugins/proctrack/cgroup/xcgroup.h" \ + || die + # also we running slurm daemons under slurm user + sed -e '#SlurmdUser=root:SlurmdUser=slurm:g' \ + -i "${S}/etc/slurm.conf.example" + # and pids should go to /var/run/slurm + sed -e 's:/var/run/slurmctld.pid:/var/run/slurm/slurmctld.pid:g' \ + -e 's:/var/run/slurmd.pid:/var/run/slurm/slurmd.pid:g' \ + -i "${S}/etc/slurm.conf.example" + # also state dirs are in /var/spool/slurm + sed -e 's:StateSaveLocation=/tmp:StateSaveLocation=/var/spool/slurm:g' \ + -e 's:SlurmdSpoolDir=/tmp/slurmd:SlurmdSpoolDir=/var/spool/slurm/slurmd:g' \ + -i "${S}/etc/slurm.conf.example" +} + +src_configure() { + local myconf=( + --sysconfdir="${EPREFIX}/etc/${PN}" + --with-hwloc="${EPREFIX}/usr" + ) + use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) ) + use mysql && myconf+=( --with-mysql_config="${EPREFIX}/usr/bin/mysql_config" ) + use postgres && myconf+=( --with-pg_config="${EPREFIX}/usr/bin/pg_config" ) + econf "${myconf[@]}" \ + $(use_enable pam) \ + $(use_with ssl) \ + $(use_with munge) \ + $(use_enable static-libs static) +} + +src_compile() { + default + use pam && emake -C contribs/pam || die +} + +src_install() { + default + emake DESTDIR="${D}" -C contribs/torque install || die + use pam && emake DESTDIR="${D}" -C contribs/pam install || die + use static-libs || find "${ED}" -name '*.la' -exec rm {} + + # we dont need it + rm "${ED}/usr/bin/mpiexec" || die + # install sample configs + keepdir /etc/slurm + keepdir /var/log/slurm + keepdir /var/spool/slurm + keepdir /var/run/slurm + insinto /etc/slurm + doins etc/cgroup.conf.example + doins etc/federation.conf.example + doins etc/slurm.conf.example + doins etc/slurmdbd.conf.example + exeinto /etc/slurm + doexe etc/cgroup.release_agent + doexe etc/slurm.epilog.clean + # install init.d files + newinitd "${FILESDIR}/slurmd.initd" slurmd + newinitd "${FILESDIR}/slurmctld.initd" slurmctld + newinitd "${FILESDIR}/slurmdbd.initd" slurmdbd + # install conf.d files + newconfd "${FILESDIR}/slurm.confd" slurm +} + +pkg_preinst() { + if use munge; then + sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/slurm || die + fi +} + +pkg_postinst() { + einfo "Fixing permissions in /var/spool/${PN}" + chown -R ${PN}:${PN} /var/spool/${PN} + einfo "Fixing permissions in /var/run/${PN}" + chown -R ${PN}:${PN} /var/run/${PN} + einfo "Fixing permissions in /var/log/${PN}" + chown -R ${PN}:${PN} /var/log/${PN} + echo + + 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.conf on all nodes (including the headnode) of your cluster." +} |