Name: slurm Version: 20.02.4 %define rel 1 Release: %{rel}%{?dist}.2 Summary: Slurm Workload Manager Group: System Environment/Base License: GPLv2+ URL: https://slurm.schedmd.com/ # when the rel number is one, the directory name does not include it %if "%{rel}" == "1" %global slurm_source_dir %{name}-%{version} %else %global slurm_source_dir %{name}-%{version}-%{rel} %endif Source: %{slurm_source_dir}.tar.bz2 #-Patch1: job_container.patch BuildRequires: automake autoconf # build options .rpmmacros options change to default action # ==================== ==================== ======================== # --prefix %_prefix path install path for commands, libraries, etc. # --with cray %_with_cray 1 build for a Cray Aries system # --with cray_network %_with_cray_network 1 build for a non-Cray system with a Cray network # --with cray_shasta %_with_cray_shasta 1 build for a Cray Shasta system # --with slurmrestd %_with_slurmrestd 1 build slurmrestd # --with slurmsmwd %_with_slurmsmwd 1 build slurmsmwd # --without debug %_without_debug 1 don't compile with debugging symbols # --with hdf5 %_with_hdf5 path require hdf5 support # --with hwloc %_with_hwloc 1 require hwloc support # --with lua %_with_lua path build Slurm lua bindings # --with mysql %_with_mysql 1 require mysql/mariadb support # --with numa %_with_numa 1 require NUMA support # --without pam %_without_pam 1 don't require pam-devel RPM to be installed # --without x11 %_without_x11 1 disable internal X11 support # --with ucx %_with_ucx path require ucx support # --with pmix %_with_pmix path require pmix support # Options that are off by default (enable with --with ) %bcond_with cray %bcond_with cray_network %bcond_with cray_shasta %bcond_with slurmrestd %bcond_with slurmsmwd %bcond_with multiple_slurmd %bcond_with ucx # These options are only here to force there to be these on the build. # If they are not set they will still be compiled if the packages exist. %bcond_with hwloc %bcond_with mysql %bcond_with hdf5 %bcond_with lua %bcond_with numa %bcond_with pmix # Use debug by default on all systems %bcond_without debug # Options enabled by default %bcond_without pam %bcond_without x11 # PU change from defaults %bcond_without hwloc %bcond_without mysql %bcond_without hdf5 %bcond_without lua %bcond_without numa %bcond_without pmix %bcond_without slurmrestd # Nvidia related %bcond_without nvidia # Disable hardened builds. -z,now or -z,relro breaks the plugin stack %undefine _hardened_build %global _hardened_cflags "-Wl,-z,lazy" %global _hardened_ldflags "-Wl,-z,lazy" Requires: munge %{?systemd_requires} BuildRequires: systemd BuildRequires: munge-devel munge-libs BuildRequires: python3 BuildRequires: readline-devel Obsoletes: slurm-lua slurm-munge slurm-plugins # fake systemd support when building rpms on other platforms %{!?_unitdir: %global _unitdir /lib/systemd/systemd} %define use_mysql_devel %(perl -e '`rpm -q mariadb-devel`; print $?;') %if %{with mysql} %if %{use_mysql_devel} BuildRequires: mysql-devel >= 5.0.0 %else BuildRequires: mariadb-devel >= 5.0.0 %endif %endif %if %{with cray} BuildRequires: cray-libalpscomm_cn-devel BuildRequires: cray-libalpscomm_sn-devel BuildRequires: libnuma-devel BuildRequires: libhwloc-devel BuildRequires: cray-libjob-devel BuildRequires: gtk2-devel BuildRequires: glib2-devel BuildRequires: pkg-config %endif %if %{with cray_network} %if %{use_mysql_devel} BuildRequires: mysql-devel %else BuildRequires: mariadb-devel %endif BuildRequires: cray-libalpscomm_cn-devel BuildRequires: cray-libalpscomm_sn-devel BuildRequires: hwloc-devel BuildRequires: gtk2-devel BuildRequires: glib2-devel BuildRequires: pkgconfig %endif BuildRequires: perl(ExtUtils::MakeMaker) %if %{with lua} BuildRequires: pkgconfig(lua) >= 5.1.0 %endif %if %{with hwloc} BuildRequires: hwloc-devel %endif %if %{with numa} %if %{defined suse_version} BuildRequires: libnuma-devel %else BuildRequires: numactl-devel %endif %endif %if %{with pmix} BuildRequires: pmix-devel %global pmix_version %(rpm -q pmix --qf "%{VERSION}") %endif %if %{with ucx} BuildRequires: ucx-devel %global ucx_version %(rpm -q ucx-devel --qf "%{VERSION}") %endif # PU changes BuildRequires: rrdtool-devel lz4-devel json-c-devel libcurl-devel libyaml-devel BuildRequires: libssh2-devel gtk2-devel glib2-devel libjwt-devel BuildRequires: libibmad-devel libibverbs-devel librdmacm-devel %if %{with freeipmi} BuildRequires: freeipmi-devel %endif %if %{with hdf5} BuildRequires: hdf5-devel %endif %if %{with nvidia} BuildRequires: cudatoolkit101-devel nvidia-driver-devel Requires: nvidia-driver-NVML %endif # Allow override of sysconfdir via _slurm_sysconfdir. # Note 'global' instead of 'define' needed here to work around apparent # bug in rpm macro scoping (or something...) %{!?_slurm_sysconfdir: %global _slurm_sysconfdir /etc/slurm} %define _sysconfdir %_slurm_sysconfdir # Allow override of datadir via _slurm_datadir. %{!?_slurm_datadir: %global _slurm_datadir %{_prefix}/share} %define _datadir %{_slurm_datadir} # Allow override of mandir via _slurm_mandir. %{!?_slurm_mandir: %global _slurm_mandir %{_datadir}/man} %define _mandir %{_slurm_mandir} # # Never allow rpm to strip binaries as this will break # parallel debugging capability # Note that brp-compress does not compress man pages installed # into non-standard locations (e.g. /usr/local) # %define __os_install_post /usr/lib/rpm/brp-compress %define debug_package %{nil} # # Should unpackaged files in a build root terminate a build? # Uncomment if needed again. #%define _unpackaged_files_terminate_build 0 # Slurm may intentionally include empty manifest files, which will # cause errors with rpm 4.13 and on. Turn that check off. %define _empty_manifest_terminate_build 0 # First we remove $prefix/local and then just prefix to make # sure we get the correct installdir %define _perlarch %(perl -e 'use Config; $T=$Config{installsitearch}; $P=$Config{installprefix}; $P1="$P/local"; $T =~ s/$P1//; $T =~ s/$P//; print $T;') %define _perlman3 %(perl -e 'use Config; $T=$Config{installsiteman3dir}; $P=$Config{siteprefix}; $P1="$P/local"; $T =~ s/$P1//; $T =~ s/$P//; print $T;') %define _perlarchlib %(perl -e 'use Config; $T=$Config{installarchlib}; $P=$Config{installprefix}; $P1="$P/local"; $T =~ s/$P1//; $T =~ s/$P//; print $T;') %define _perldir %{_prefix}%{_perlarch} %define _perlman3dir %{_prefix}%{_perlman3} %define _perlarchlibdir %{_prefix}%{_perlarchlib} %description Slurm is an open source, fault-tolerant, and highly scalable cluster management and job scheduling system for Linux clusters. Components include machine status, partition management, job management, scheduling and accounting modules %package perlapi Summary: Perl API to Slurm Group: Development/System Requires: %{name}%{?_isa} = %{version}-%{release} %description perlapi Perl API package for Slurm. This package includes the perl API to provide a helpful interface to Slurm through Perl %package devel Summary: Development package for Slurm Group: Development/System Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development package for Slurm. This package includes the header files and static libraries for the Slurm API %package example-configs Summary: Example config files for Slurm Group: Development/System %description example-configs Example configuration files for Slurm. %package slurmctld Summary: Slurm controller daemon Group: System Environment/Base Requires: %{name}%{?_isa} = %{version}-%{release} %description slurmctld Slurm controller daemon. Used to manage the job queue, schedule jobs, and dispatch RPC messages to the slurmd processon the compute nodes to launch jobs. %package slurmd Summary: Slurm compute node daemon Group: System Environment/Base Requires: %{name}%{?_isa} = %{version}-%{release} %if %{with pmix} Requires: pmix = %{pmix_version} %endif %if %{with ucx} Requires: ucx = %{ucx_version} %endif %description slurmd Slurm compute node daemon. Used to launch jobs on compute nodes %package slurmdbd Summary: Slurm database daemon Group: System Environment/Base Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: slurm-sql %description slurmdbd Slurm database daemon. Used to accept and process database RPCs and upload database changes to slurmctld daemons on each cluster %package libpmi Summary: Slurm\'s implementation of the pmi libraries Group: System Environment/Base Requires: %{name}%{?_isa} = %{version}-%{release} Conflicts: pmix-libpmi %description libpmi Slurm\'s version of libpmi. For systems using Slurm, this version is preferred over the compatibility libraries shipped by the PMIx project. %package torque Summary: Torque/PBS wrappers for transition from Torque/PBS to Slurm Group: Development/System Requires: slurm-perlapi %description torque Torque wrapper scripts used for helping migrate from Torque/PBS to Slurm %package openlava Summary: openlava/LSF wrappers for transition from OpenLava/LSF to Slurm Group: Development/System Requires: slurm-perlapi %description openlava OpenLava wrapper scripts used for helping migrate from OpenLava/LSF to Slurm %package contribs Summary: Perl tool to print Slurm job state information Group: Development/System Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: slurm-sjobexit slurm-sjstat slurm-seff %description contribs seff is a mail program used directly by the Slurm daemons. On completion of a job, wait for it's accounting information to be available and include that information in the email body. sjobexit is a slurm job exit code management tool. It enables users to alter job exit code information for completed jobs sjstat is a Perl tool to print Slurm job state information. The output is designed to give information on the resource usage and availablilty, as well as information about jobs that are currently active on the machine. This output is built using the Slurm utilities, sinfo, squeue and scontrol, the man pages for these utilities will provide more information and greater depth of understanding. %if %{with pam} %package pam_slurm Summary: PAM module for restricting access to compute nodes via Slurm Group: System Environment/Base Requires: %{name}%{?_isa} = %{version}-%{release} BuildRequires: pam-devel Obsoletes: pam_slurm %description pam_slurm This module restricts access to compute nodes in a cluster where Slurm is in use. Access is granted to root, any user with an Slurm-launched job currently running on the node, or any user who has allocated resources on the node according to the Slurm %endif %if %{with slurmrestd} %package slurmrestd Summary: Slurm REST API translator Group: System Environment/Base Requires: %{name}%{?_isa} = %{version}-%{release} BuildRequires: http-parser-devel %if %{defined suse_version} BuildRequires: libjson-c-devel %else BuildRequires: json-c-devel %endif %description slurmrestd Provides a REST interface to Slurm. %endif %if %{with slurmsmwd} %package slurmsmwd Summary: support daemons and software for the Cray SMW Group: System Environment/Base Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: craysmw %description slurmsmwd support daemons and software for the Cray SMW. Includes slurmsmwd which notifies slurm about failed nodes. %endif ############################################################################# %prep # when the rel number is one, the tarball filename does not include it %setup -n %{slurm_source_dir} #-%patch1 -p1 -b .jobcontainer %build aclocal automake autoconf %configure \ %{?_without_debug:--disable-debug} \ %{?_with_pam_dir} \ %{?_with_cpusetdir} \ %{?_with_mysql_config} \ %{?_with_ssl} \ %{?_without_cray:--enable-really-no-cray}\ %{?_with_cray_network:--enable-cray-network}\ %{?_with_multiple_slurmd:--enable-multiple-slurmd} \ %{?_with_pmix} \ %{?_with_freeipmi} \ %{?_with_hdf5} \ %{?_with_shared_libslurm} \ %{?_without_slurmrestd:--disable-slurmrestd} \ %{?_without_x11:--disable-x11} \ %{?_with_ucx} \ %{?_with_cflags} make %{?_smp_mflags} %install # Ignore redundant standard rpaths and insecure relative rpaths, # for RHEL based distros which use "check-rpaths" tool. export QA_RPATHS=0x5 # Strip out some dependencies cat > find-requires.sh <<'EOF' exec %{__find_requires} "$@" | egrep -v '^libpmix.so|libevent' EOF chmod +x find-requires.sh %global _use_internal_dependency_generator 0 %global __find_requires %{_builddir}/%{buildsubdir}/find-requires.sh rm -rf %{buildroot} make install DESTDIR=%{buildroot} make install-contrib DESTDIR=%{buildroot} install -D -m644 etc/slurmctld.service %{buildroot}/%{_unitdir}/slurmctld.service install -D -m644 etc/slurmd.service %{buildroot}/%{_unitdir}/slurmd.service install -D -m644 etc/slurmdbd.service %{buildroot}/%{_unitdir}/slurmdbd.service # Do not package Slurm's version of libpmi on Cray systems in the usual location. # Cray's version of libpmi should be used. Move it elsewhere if the site still # wants to use it with other MPI stacks. %if %{with cray} || %{with cray_shasta} mkdir %{buildroot}/%{_libdir}/slurmpmi mv %{buildroot}/%{_libdir}/libpmi* %{buildroot}/%{_libdir}/slurmpmi %endif %if %{with cray} install -D -m644 contribs/cray/plugstack.conf.template %{buildroot}/%{_sysconfdir}/plugstack.conf.template install -D -m644 contribs/cray/slurm.conf.template %{buildroot}/%{_sysconfdir}/slurm.conf.template mkdir -p %{buildroot}/opt/modulefiles/slurm test -f contribs/cray/opt_modulefiles_slurm && install -D -m644 contribs/cray/opt_modulefiles_slurm %{buildroot}/opt/modulefiles/slurm/%{version}-%{rel} echo -e '#%Module\nset ModulesVersion "%{version}-%{rel}"' > %{buildroot}/opt/modulefiles/slurm/.version %else rm -f contribs/cray/opt_modulefiles_slurm rm -f %{buildroot}/%{_sysconfdir}/plugstack.conf.template rm -f %{buildroot}/%{_sysconfdir}/slurm.conf.template rm -f %{buildroot}/%{_sbindir}/capmc_suspend rm -f %{buildroot}/%{_sbindir}/capmc_resume rm -f %{buildroot}/%{_sbindir}/slurmconfgen.py %endif %if %{with slurmsmwd} install -D -m644 contribs/cray/slurmsmwd/slurmsmwd.service %{buildroot}/%{_unitdir}/slurmsmwd.service %else rm -f %{buildroot}/%{_sbindir}/slurmsmwd rm -f contribs/cray/slurmsmwd/slurmsmwd.service %endif install -D -m644 etc/cgroup.conf.example %{buildroot}/%{_sysconfdir}/cgroup.conf.example install -D -m644 etc/layouts.d.power.conf.example %{buildroot}/%{_sysconfdir}/layouts.d/power.conf.example install -D -m644 etc/layouts.d.power_cpufreq.conf.example %{buildroot}/%{_sysconfdir}/layouts.d/power_cpufreq.conf.example install -D -m644 etc/layouts.d.unit.conf.example %{buildroot}/%{_sysconfdir}/layouts.d/unit.conf.example install -D -m644 etc/slurm.conf.example %{buildroot}/%{_sysconfdir}/slurm.conf.example install -D -m600 etc/slurmdbd.conf.example %{buildroot}/%{_sysconfdir}/slurmdbd.conf.example install -D -m755 contribs/sjstat %{buildroot}/%{_bindir}/sjstat # Delete unpackaged files: find %{buildroot} -name '*.a' -exec rm {} \; find %{buildroot} -name '*.la' -exec rm {} \; rm -f %{buildroot}/%{_libdir}/slurm/job_submit_defaults.so rm -f %{buildroot}/%{_libdir}/slurm/job_submit_logging.so rm -f %{buildroot}/%{_libdir}/slurm/job_submit_partition.so rm -f %{buildroot}/%{_libdir}/slurm/auth_none.so rm -f %{buildroot}/%{_sbindir}/sfree rm -f %{buildroot}/%{_sbindir}/slurm_epilog rm -f %{buildroot}/%{_sbindir}/slurm_prolog rm -f %{buildroot}/%{_sysconfdir}/init.d/slurm rm -f %{buildroot}/%{_sysconfdir}/init.d/slurmdbd rm -f %{buildroot}/%{_perldir}/auto/Slurm/.packlist rm -f %{buildroot}/%{_perldir}/auto/Slurm/Slurm.bs rm -f %{buildroot}/%{_perlarchlibdir}/perllocal.pod rm -f %{buildroot}/%{_perldir}/perllocal.pod rm -f %{buildroot}/%{_perldir}/auto/Slurmdb/.packlist rm -f %{buildroot}/%{_perldir}/auto/Slurmdb/Slurmdb.bs # Build man pages that are generated directly by the tools rm -f %{buildroot}/%{_mandir}/man1/sjobexitmod.1 %{buildroot}/%{_bindir}/sjobexitmod --roff > %{buildroot}/%{_mandir}/man1/sjobexitmod.1 rm -f %{buildroot}/%{_mandir}/man1/sjstat.1 %{buildroot}/%{_bindir}/sjstat --roff > %{buildroot}/%{_mandir}/man1/sjstat.1 # Build conditional file list for main package LIST=./slurm.files touch $LIST test -f %{buildroot}/%{_libexecdir}/slurm/cr_checkpoint.sh && echo %{_libexecdir}/slurm/cr_checkpoint.sh >> $LIST test -f %{buildroot}/%{_libexecdir}/slurm/cr_restart.sh && echo %{_libexecdir}/slurm/cr_restart.sh >> $LIST test -f %{buildroot}/%{_sbindir}/capmc_suspend && echo %{_sbindir}/capmc_suspend >> $LIST test -f %{buildroot}/%{_sbindir}/capmc_resume && echo %{_sbindir}/capmc_resume >> $LIST test -f %{buildroot}/%{_bindir}/netloc_to_topology && echo %{_bindir}/netloc_to_topology >> $LIST test -f %{buildroot}/opt/modulefiles/slurm/%{version}-%{rel} && echo /opt/modulefiles/slurm/%{version}-%{rel} >> $LIST test -f %{buildroot}/opt/modulefiles/slurm/.version && echo /opt/modulefiles/slurm/.version >> $LIST LIST=./example.configs touch $LIST %if %{with cray} test -f %{buildroot}/%{_sbindir}/slurmconfgen.py && echo %{_sbindir}/slurmconfgen.py >>$LIST %endif # Make pkg-config file mkdir -p %{buildroot}/%{_libdir}/pkgconfig cat >%{buildroot}/%{_libdir}/pkgconfig/slurm.pc <>$LIST test -f %{buildroot}/%{with_pam_dir}/pam_slurm_adopt.so && echo %{with_pam_dir}/pam_slurm_adopt.so >>$LIST %else test -f %{buildroot}/lib/security/pam_slurm.so && echo /lib/security/pam_slurm.so >>$LIST test -f %{buildroot}/lib32/security/pam_slurm.so && echo /lib32/security/pam_slurm.so >>$LIST test -f %{buildroot}/lib64/security/pam_slurm.so && echo /lib64/security/pam_slurm.so >>$LIST test -f %{buildroot}/lib/security/pam_slurm_adopt.so && echo /lib/security/pam_slurm_adopt.so >>$LIST test -f %{buildroot}/lib32/security/pam_slurm_adopt.so && echo /lib32/security/pam_slurm_adopt.so >>$LIST test -f %{buildroot}/lib64/security/pam_slurm_adopt.so && echo /lib64/security/pam_slurm_adopt.so >>$LIST %endif ############################################################################# mkdir -p $RPM_BUILD_ROOT/var/spool/{slurmd,slurmctld} mkdir -p $RPM_BUILD_ROOT/var/log/slurm mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d for s in slurmd slurmctld slurmdbd; do cat > $RPM_BUILD_ROOT/etc/logrotate.d/$s < /dev/null 2>&1 || : /usr/sbin/useradd -M -o -u 123 -g slurm -d /var/spool/slurm -s /sbin/nologin -c "SLURM User" slurm > /dev/null 2>&1 || : %post /sbin/ldconfig %preun %postun /sbin/ldconfig %post slurmctld %systemd_post slurmctld.service %preun slurmctld %systemd_preun slurmctld.service %postun slurmctld %systemd_postun_with_restart slurmctld.service %post slurmd %systemd_post slurmd.service %preun slurmd %systemd_preun slurmd.service %postun slurmd %systemd_postun_with_restart slurmd.service %post slurmdbd %systemd_post slurmdbd.service %preun slurmdbd %systemd_preun slurmdbd.service %postun slurmdbd %systemd_postun_with_restart slurmdbd.service