summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2011-10-26 14:05:31 +0000
committerAlexey Shvetsov <alexxy@gentoo.org>2011-10-26 14:05:31 +0000
commit13757113482603e3deb5c03ce4b040c05d326b78 (patch)
tree883022950a33d0846840c901dd699f9e26661436 /sys-cluster
parentRemove old versions (diff)
downloadgentoo-2-13757113482603e3deb5c03ce4b040c05d326b78.tar.gz
gentoo-2-13757113482603e3deb5c03ce4b040c05d326b78.tar.bz2
gentoo-2-13757113482603e3deb5c03ce4b040c05d326b78.zip
[sys-cluster/slurm] Added torque pbs compatibility layer
(Portage version: 2.2.0_alpha71/cvs/Linux x86_64)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/slurm/ChangeLog8
-rw-r--r--sys-cluster/slurm/metadata.xml1
-rw-r--r--sys-cluster/slurm/slurm-2.2.7-r2.ebuild154
3 files changed, 162 insertions, 1 deletions
diff --git a/sys-cluster/slurm/ChangeLog b/sys-cluster/slurm/ChangeLog
index ea05d8abf0a6..ac968dc5964b 100644
--- a/sys-cluster/slurm/ChangeLog
+++ b/sys-cluster/slurm/ChangeLog
@@ -1,6 +1,12 @@
# 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.5 2011/08/31 15:32:17 alexxy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/ChangeLog,v 1.6 2011/10/26 14:05:31 alexxy Exp $
+
+*slurm-2.2.7-r2 (26 Oct 2011)
+
+ 26 Oct 2011; Alexey Shvetsov <alexxy@gentoo.org> +slurm-2.2.7-r2.ebuild,
+ metadata.xml:
+ Added torque pbs compatibility layer
*slurm-2.2.7-r1 (31 Aug 2011)
diff --git a/sys-cluster/slurm/metadata.xml b/sys-cluster/slurm/metadata.xml
index 26e21f3dee25..654f3e95a4d0 100644
--- a/sys-cluster/slurm/metadata.xml
+++ b/sys-cluster/slurm/metadata.xml
@@ -8,5 +8,6 @@
<use>
<flag name='maui'>Enable maui scheduler support</flag>
<flag name='munge'>Enable authentication via munge</flag>
+ <flag name='torque'>Enable perl scripts that emulates pbs (qstat, qsub etc.)</flag>
</use>
</pkgmetadata>
diff --git a/sys-cluster/slurm/slurm-2.2.7-r2.ebuild b/sys-cluster/slurm/slurm-2.2.7-r2.ebuild
new file mode 100644
index 000000000000..99e0b007b51b
--- /dev/null
+++ b/sys-cluster/slurm/slurm-2.2.7-r2.ebuild
@@ -0,0 +1,154 @@
+# 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-r2.ebuild,v 1.1 2011/10/26 14:05:31 alexxy Exp $
+
+EAPI=4
+
+inherit eutils pam perl-module
+
+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 +perl postgres ssl static-libs +torque"
+
+DEPEND="
+ !net-analyzer/slurm
+ mysql? ( dev-db/mysql )
+ munge? ( sys-auth/munge )
+ pam? ( virtual/pam )
+ perl? ( perl-core/Switch )
+ postgres? ( dev-db/postgresql-base )
+ ssl? ( dev-libs/openssl )
+ torque? ( !sys-cluster/torque )
+ >=sys-apps/hwloc-1.1.1-r1
+ "
+RDEPEND="${DEPEND}
+ maui? ( sys-cluster/maui[slurm] )
+ "
+
+REQUIRED_USE="torque? ( perl )"
+
+LIBSLURM_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurm/perl"
+LIBSLURMDB_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurmdb/perl"
+
+pkg_setup() {
+ enewgroup slurm 500
+ enewuser slurm 500 -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
+ # 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+=( --without-mysql_config )
+ use postgres || myconf+=( --without-pg_config )
+ econf "${myconf[@]}" \
+ $(use_enable pam) \
+ $(use_with ssl) \
+ $(use_with munge) \
+ $(use_enable static-libs static)
+ if use perl ; then
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${S}"
+ fi
+}
+
+src_compile() {
+ default
+ use pam && emake -C contribs/pam || die
+ if use perl ; then
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" perl-module_src_compile
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_compile
+ cd "${S}"
+ fi
+ if use torque ;then
+ emake -C contribs/torque || die
+ fi
+}
+
+src_install() {
+ default
+ emake DESTDIR="${D}" -C contribs/torque install || die
+ use pam && emake DESTDIR="${D}" -C contribs/pam install || die
+ if use perl; then
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" perl-module_src_install
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_install
+ cd "${S}"
+ fi
+ if use torque; then
+ emake DESTDIR="${D}" -C contribs/torque || die
+ fi
+ 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."
+}