Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/slurm/
Date: Thu, 14 May 2020 14:22:02
Message-Id: 1589466113.37090d8bbcf9e6923340e8a629e270c94810e3b1.zlogene@gentoo
1 commit: 37090d8bbcf9e6923340e8a629e270c94810e3b1
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 14 14:20:11 2020 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Thu May 14 14:21:53 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37090d8b
7
8 sys-cluster/slurm: Version bump (v20.02.2.1)
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12
13 sys-cluster/slurm/Manifest | 1 +
14 sys-cluster/slurm/slurm-20.02.2.1.ebuild | 263 +++++++++++++++++++++++++++++++
15 2 files changed, 264 insertions(+)
16
17 diff --git a/sys-cluster/slurm/Manifest b/sys-cluster/slurm/Manifest
18 index 91e8bb4d295..7950e8cc9ae 100644
19 --- a/sys-cluster/slurm/Manifest
20 +++ b/sys-cluster/slurm/Manifest
21 @@ -2,3 +2,4 @@ DIST slurm-19-05-4-1.tar.gz 8446001 BLAKE2B d3b1524a72d7969b14788b93c7d64b03faf1
22 DIST slurm-19-05-5-1.tar.gz 8447611 BLAKE2B 052d6a9c7e196546a2a7ca0c8e324d3728177e06a6b82150d6888cf5f6aa4b0f6612e09e928b2224be412971b4e40318d3b03e27068ed7c2256036a417ebf9c5 SHA512 612ce1c476de3d08d4003c48df65883880e697652ef8b0847cd87719e91196f489409b27c67ef040ab9ffe0c9d824cdae6441608e9af9619abcf11ebf0d464be
23 DIST slurm-20-02-0-1.tar.gz 8657581 BLAKE2B 402bb9c9a87055940ca525eb5c5e37cb62ad8957ae626682109e885834e6e17e93e3964f65b66c17c5ecc611271bd19709290f7ab79398c8c6b5aa762e476b50 SHA512 2c27133c8598cbb4ad0e6d186732f83cfb1b12460fddd89646b41a4d7c8239afff795db22345216f76ba5b666f1d5c2642dcfcbf38285f66d748424b60f9598a
24 DIST slurm-20-02-1-1.tar.gz 8660993 BLAKE2B 8f3a6ce0177410ae25490bb995fc14696002a22a8a0ec82d97f697fe5898c8c7d07fe2ad4ab824e1056f3be59adb2cb30b3e89a50a529e786a59aacab5cc6673 SHA512 a0974f52a561dc7596a9a7aeea4f09075a97dc30c729e59aef625584264e5b4ae003466275be379bae42a2a0e0be0c910b9349d3e7c6631f18969518ac9a0910
25 +DIST slurm-20-02-2-1.tar.gz 8680227 BLAKE2B 9058c5161a3e087201b17484fbb8430d2af392b4abec4cfea3b6a882609bb978987a8e6aeda512b08def8010403c9f0893827632358225c15c374d15a583432f SHA512 6ed8628be442138c90f0f497846679eb2a4ea8e2c612d31c1276cc451333663bf310719a8f823dc873536343065186dc5f26871ce80340c0bdb71ab564620513
26
27 diff --git a/sys-cluster/slurm/slurm-20.02.2.1.ebuild b/sys-cluster/slurm/slurm-20.02.2.1.ebuild
28 new file mode 100644
29 index 00000000000..a2a4e4bd829
30 --- /dev/null
31 +++ b/sys-cluster/slurm/slurm-20.02.2.1.ebuild
32 @@ -0,0 +1,263 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +if [[ ${PV} == *9999* ]]; then
39 + EGIT_REPO_URI="https://github.com/SchedMD/slurm.git"
40 + INHERIT_GIT="git-r3"
41 + MY_P="${P}"
42 +else
43 + if [[ ${PV} == *pre* || ${PV} == *rc* ]]; then
44 + MY_PV=$(ver_rs '-0.') # pre-releases or release-candidate
45 + else
46 + MY_PV=$(ver_rs 1-3 '-') # stable releases
47 + fi
48 + MY_P="${PN}-${MY_PV}"
49 + INHERIT_GIT=""
50 + SRC_URI="https://github.com/SchedMD/slurm/archive/${MY_P}.tar.gz"
51 + KEYWORDS="~amd64 ~x86"
52 +fi
53 +
54 +inherit autotools bash-completion-r1 pam perl-module prefix toolchain-funcs systemd ${INHERIT_GIT}
55 +
56 +DESCRIPTION="A Highly Scalable Resource Manager"
57 +HOMEPAGE="https://www.schedmd.com https://github.com/SchedMD/slurm"
58 +
59 +LICENSE="GPL-2"
60 +SLOT="0"
61 +IUSE="debug hdf5 html ipmi json lua multiple-slurmd +munge mysql netloc numa ofed pam perl slurmdbd static-libs ucx torque X"
62 +
63 +COMMON_DEPEND="
64 + !sys-cluster/torque
65 + !net-analyzer/slurm
66 + !net-analyzer/sinfo
67 + || ( sys-cluster/pmix[-pmi] >=sys-cluster/openmpi-2.0.0 )
68 + mysql? (
69 + || ( dev-db/mariadb-connector-c dev-db/mysql-connector-c )
70 + slurmdbd? ( || ( dev-db/mariadb dev-db/mysql ) )
71 + )
72 + munge? ( sys-auth/munge )
73 + pam? ( sys-libs/pam )
74 + lua? ( dev-lang/lua:0= )
75 + !lua? ( !dev-lang/lua )
76 + ipmi? ( sys-libs/freeipmi )
77 + json? ( dev-libs/json-c:= )
78 + amd64? ( netloc? ( sys-apps/netloc ) )
79 + hdf5? ( sci-libs/hdf5:= )
80 + numa? ( sys-process/numactl )
81 + ofed? ( sys-fabric/ofed )
82 + ucx? ( sys-cluster/ucx )
83 + X? ( net-libs/libssh2 )
84 + >=sys-apps/hwloc-1.1.1-r1
85 + sys-libs/ncurses:0=
86 + app-arch/lz4:0=
87 + sys-libs/readline:0="
88 +DEPEND="${COMMON_DEPEND}
89 + html? ( sys-apps/man2html )"
90 +RDEPEND="${OMMON_DEPEND}
91 + acct-user/slurm
92 + acct-group/slurm
93 + dev-libs/libcgroup"
94 +
95 +REQUIRED_USE="torque? ( perl )"
96 +
97 +S="${WORKDIR}/${PN}-${MY_P}"
98 +
99 +LIBSLURM_PERL_S="${S}/contribs/perlapi/libslurm/perl"
100 +LIBSLURMDB_PERL_S="${S}/contribs/perlapi/libslurmdb/perl"
101 +
102 +RESTRICT="test"
103 +
104 +src_unpack() {
105 + if [[ ${PV} == *9999* ]]; then
106 + git-r3_src_unpack
107 + else
108 + default
109 + fi
110 +}
111 +
112 +src_prepare() {
113 + tc-ld-disable-gold
114 + default
115 +
116 + # pids should go to /var/run/slurm
117 + sed \
118 + -e 's:/tmp:/var/tmp:g' \
119 + -e "s:/var/run/slurmctld.pid:${EPREFIX}/run/slurm/slurmctld.pid:g" \
120 + -e "s:/var/run/slurmd.pid:${EPREFIX}/run/slurm/slurmd.pid:g" \
121 + -e "s:StateSaveLocation=.*:StateSaveLocation=${EPREFIX}/var/spool/slurm:g" \
122 + -e "s:SlurmdSpoolDir=.*:SlurmdSpoolDir=${EPREFIX}/var/spool/slurm/slurmd:g" \
123 + -i "${S}/etc/slurm.conf.example" \
124 + || die "Can't sed for /var/run/slurmctld.pid"
125 + sed \
126 + -e "s:/var/run/slurmdbd.pid:${EPREFIX}/run/slurm/slurmdbd.pid:g" \
127 + -i "${S}/etc/slurmdbd.conf.example" \
128 + || die "Can't sed for /var/run/slurmdbd.pid"
129 + # gentooify systemd services
130 + sed \
131 + -e 's:sysconfig/.*:conf.d/slurm:g' \
132 + -e 's:var/run/:run/slurm/:g' \
133 + -e '/^EnvironmentFile=.*/d' \
134 + -i "${S}/etc"/*.service.in \
135 + || die "Can't sed systemd services for sysconfig or var/run/"
136 +
137 + sed -e '/AM_PATH_GTK_2_0/d' -i configure.ac || die
138 +
139 + hprefixify auxdir/{ax_check_zlib,x_ac_{lz4,ofed,munge}}.m4
140 + eautoreconf
141 +}
142 +
143 +src_configure() {
144 + local myconf=(
145 + --sysconfdir="${EPREFIX}/etc/${PN}"
146 + --with-hwloc="${EPREFIX}/usr"
147 + --htmldir="${EPREFIX}/usr/share/doc/${PF}"
148 + )
149 + use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) )
150 + use mysql || myconf+=( --without-mysql_config )
151 + use amd64 && myconf+=( $(use_with netloc) )
152 + econf "${myconf[@]}" \
153 + $(use_enable debug) \
154 + $(use_enable pam) \
155 + $(use_enable X x11) \
156 + $(use_with munge) \
157 + $(use_with json) \
158 + $(use_with hdf5) \
159 + $(use_with ofed) \
160 + $(use_with ucx) \
161 + $(use_enable static-libs static) \
162 + $(use_enable multiple-slurmd)
163 +
164 + # --htmldir does not seems to propagate... Documentations are installed
165 + # in /usr/share/doc/slurm-2.3.0/html
166 + # instead of /usr/share/doc/slurm-2.3.0.2/html
167 + sed \
168 + -e "s|htmldir = .*/html|htmldir = \${prefix}/share/doc/slurm-${PVR}/html|g" \
169 + -i doc/html/Makefile || die
170 + if use perl ; then
171 + # small hack to make it compile
172 + mkdir -p "${S}/src/api/.libs" || die
173 + mkdir -p "${S}/src/db_api/.libs" || die
174 + touch "${S}/src/api/.libs/libslurm.so" || die
175 + touch "${S}/src/db_api/.libs/libslurmdb.so" || die
176 + cd "${LIBSLURM_PERL_S}" || die
177 + S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure
178 + cd "${LIBSLURMDB_PERL_S}" || die
179 + S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure
180 + cd "${S}" || die
181 + rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs" || die
182 + fi
183 +}
184 +
185 +src_compile() {
186 + default
187 + use pam && emake -C contribs/pam
188 + if use perl ; then
189 + cd "${LIBSLURM_PERL_S}" || die
190 + S="${LIBSLURM_PERL_S}" perl-module_src_compile
191 + cd "${LIBSLURMDB_PERL_S}" || die
192 + S="${LIBSLURMDB_PERL_S}" perl-module_src_compile
193 + cd "${S}" || die
194 + fi
195 + use torque && emake -C contribs/torque
196 +}
197 +
198 +src_install() {
199 + default
200 + use pam && emake DESTDIR="${D}" -C contribs/pam install
201 + if use perl; then
202 + cd "${LIBSLURM_PERL_S}" || die
203 + S="${LIBSLURM_PERL_S}" perl-module_src_install
204 + cd "${LIBSLURMDB_PERL_S}" || die
205 + S="${LIBSLURMDB_PERL_S}" perl-module_src_install
206 + cd "${S}" || die
207 + fi
208 + if use torque; then
209 + emake DESTDIR="${D}" -C contribs/torque
210 + rm -f "${D}"/usr/bin/mpiexec || die
211 + fi
212 + use static-libs || find "${ED}" -name '*.la' -exec rm {} +
213 + # install sample configs
214 + keepdir /etc/slurm
215 + insinto /etc/slurm
216 + doins \
217 + etc/prolog.example \
218 + etc/cgroup.conf.example \
219 + etc/slurm.conf.example \
220 + etc/slurmdbd.conf.example
221 + exeinto /etc/slurm
222 + keepdir /etc/slurm/layouts.d
223 + insinto /etc/slurm/layouts.d
224 + newins etc/layouts.d.power.conf.example power.conf.example
225 + newins etc/layouts.d.power_cpufreq.conf.example power_cpufreq.conf.example
226 + newins etc/layouts.d.unit.conf.example unit.conf.example
227 + # install init.d files
228 + newinitd "$(prefixify_ro "${FILESDIR}/slurmd.initd")" slurmd
229 + newinitd "$(prefixify_ro "${FILESDIR}/slurmctld.initd")" slurmctld
230 + newinitd "$(prefixify_ro "${FILESDIR}/slurmdbd.initd")" slurmdbd
231 + # install conf.d files
232 + newconfd "${FILESDIR}/slurm.confd" slurm
233 + # install logrotate file
234 + insinto /etc/logrotate.d
235 + newins "${FILESDIR}/logrotate" slurm
236 + # install bashcomp
237 + newbashcomp contribs/slurm_completion_help/slurm_completion.sh scontrol
238 + bashcomp_alias scontrol \
239 + sreport sacctmgr squeue scancel sshare sbcast sinfo \
240 + sprio sacct salloc sbatch srun sattach sdiag sstat
241 + # install systemd files
242 + systemd_newtmpfilesd "${FILESDIR}/slurm.tmpfiles" slurm.conf
243 + systemd_dounit etc/slurmd.service etc/slurmctld.service etc/slurmdbd.service
244 +}
245 +
246 +pkg_preinst() {
247 + if use munge; then
248 + sed -i 's,\(SLURM_USE_MUNGE=\).*,\11,' "${D}"/etc/conf.d/slurm || die
249 + fi
250 +}
251 +
252 +create_folders_and_fix_permissions() {
253 + einfo "Fixing permissions in ${@}"
254 + mkdir -p ${@} || die
255 + chown -R ${PN}:${PN} ${@} || die
256 +}
257 +
258 +pkg_postinst() {
259 + paths=(
260 + "${EROOT}"/var/${PN}/checkpoint
261 + "${EROOT}"/var/${PN}
262 + "${EROOT}"/var/spool/${PN}/slurmd
263 + "${EROOT}"/var/spool/${PN}
264 + "${EROOT}"/var/log/${PN}
265 + /var/tmp/${PN}/${PN}d
266 + /var/tmp/${PN}
267 + /run/${PN}
268 + )
269 + local folder_path
270 + for folder_path in ${paths[@]}; do
271 + create_folders_and_fix_permissions $folder_path
272 + done
273 + echo
274 +
275 + elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html"
276 + elog "through a (javascript enabled) browser to create a configureation file."
277 + elog "Copy that file to /etc/slurm/slurm.conf on all nodes (including the headnode) of your cluster."
278 + echo
279 + elog "For cgroup support, please see https://www.schedmd.com/slurmdocs/cgroup.conf.html"
280 + elog "Your kernel must be compiled with the wanted cgroup feature:"
281 + elog " For the proctrack plugin:"
282 + elog " freezer"
283 + elog " For the task plugin:"
284 + elog " cpuset, memory, devices"
285 + elog " For the accounting plugin:"
286 + elog " cpuacct, memory, blkio"
287 + elog "Then, set these options in /etc/slurm/slurm.conf:"
288 + elog " ProctrackType=proctrack/cgroup"
289 + elog " TaskPlugin=task/cgroup"
290 + einfo
291 + ewarn "Paths were created for slurm. Please use these paths in /etc/slurm/slurm.conf:"
292 + for folder_path in ${paths[@]}; do
293 + ewarn " ${folder_path}"
294 + done
295 +}