Skip to content

Commit 6732045

Browse files
committed
Merge branch '24.05.ug' into 24.11.ug
2 parents ff205f7 + 2d77c7d commit 6732045

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+208
-47
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
pyslurm is the Python client library for the [Slurm Workload Manager](https://slurm.schedmd.com)
44

5+
## Fork from VUB-HPC
6+
This fork adds specific tooling and patches to PySlurm that are needed to build
7+
and install this software in our HPC clusters.
8+
9+
Command to build the RPM of PySlurm from our build servers:
10+
```
11+
clusterbuildrpm -d -r pub -f vub-hpc -p pyslurm -b vub-hpc
12+
```
13+
514
## Requirements
615

716
* [Slurm](https://slurm.schedmd.com) - Slurm shared library and header files

bdist_rpm.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
VERSION=$(grep "Version:.*[0-9]" pyslurm.spec | tr -s " " | awk '{print $2;}')
4+
RELEASE=$(grep "%global.*rel.*[-1-9]" pyslurm.spec | tr -s " " | awk '{print $3}')
5+
6+
echo $VERSION
7+
echo $RELEASE
8+
9+
if [ "${RELEASE}" -gt 1 ]; then
10+
SUFFIX=${VERSION}-${RELEASE}
11+
else
12+
SUFFIX=${VERSION}
13+
fi
14+
15+
GITTAG=$(git log --format=%ct.%h -1)
16+
17+
mkdir -p BUILD SOURCES SPECS RPMS BUILDROOT
18+
git archive --format=tar.gz -o "SOURCES/pyslurm-${SUFFIX}.tar.gz" --prefix="pyslurm-${SUFFIX}/" HEAD
19+
cp pyslurm.spec "SPECS"
20+
rpmbuild --define "gittag ${GITTAG}" --define "_topdir $PWD" -ba SPECS/pyslurm.spec

buildrpmfromspec.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
if [[ -z "$1" || -d "$1" ]]; then
4+
echo "You didn't specify anything to build";
5+
if [ -d "$1" ]
6+
then
7+
cd "$1" || exit
8+
fi
9+
spec=$(ls ./*.spec | head -1)
10+
if [ -z "$spec" ]
11+
then
12+
echo "No spec file found. Exiting."
13+
exit 1;
14+
else
15+
reg='Name: '
16+
name=$(grep "$reg" "$spec" | sed -e "s/$reg//" -e "s/ //g")
17+
reg='Version: '
18+
echo "Found spec $spec: name $name"
19+
fi
20+
else
21+
spec=$1.spec
22+
name="$1"
23+
fi
24+
25+
if grep -qE 'Fedora|release [6-9]' /etc/redhat-release >& /dev/null
26+
then
27+
myrpmbasedir=$HOME/rpmbuild
28+
else
29+
myrpmbasedir=/usr/src/redhat
30+
fi
31+
32+
rpmbasedir=${BDISTRPMBASEDIR:-$myrpmbasedir}
33+
34+
echo "----> Building rpm for $name"
35+
src_dir=$PWD
36+
echo "----> Using $src_dir"
37+
38+
# delete older versions of the rpm since there's no point having old
39+
# versions in there when we still have the src.rpms in the SRPMS dir
40+
echo "----> Cleaning up older packages"
41+
find "$rpmbasedir/RPMS" -type f -name "${name}-[0-9]\*" -delete
42+
43+
echo "----> Installing specfile requires"
44+
sudo dnf -y builddep "$spec"
45+
46+
echo "----> Building the package"
47+
48+
# -ba: source and binary
49+
# no debuginfo
50+
# download sources from remote
51+
rpmbuild \
52+
--define "_sourcedir $src_dir" \
53+
--define "_topdir $rpmbasedir" \
54+
--undefine=_disable_source_fetch \
55+
--without debuginfo \
56+
-ba "$spec"
57+
ec=$?
58+
59+
exit $ec

pyslurm/api.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
2020
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121
#
22-
# cython: c_string_type=unicode, c_string_encoding=default
22+
# cython: c_string_type=unicode, c_string_encoding=utf8
2323
# cython: language_level=3
2424

2525
from pyslurm cimport slurm

pyslurm/api.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
2020
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121
#
22-
# cython: c_string_type=unicode, c_string_encoding=default
22+
# cython: c_string_type=unicode, c_string_encoding=utf8
2323
# cython: language_level=3
2424

2525
from pyslurm import settings

pyslurm/core/error.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
2020
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121
#
22-
# cython: c_string_type=unicode, c_string_encoding=default
22+
# cython: c_string_type=unicode, c_string_encoding=utf8
2323
# cython: language_level=3
2424

2525
from pyslurm.utils cimport cstr

pyslurm/core/job/job.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
2020
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121
#
22-
# cython: c_string_type=unicode, c_string_encoding=default
22+
# cython: c_string_type=unicode, c_string_encoding=utf8
2323
# cython: language_level=3
2424

2525
from pyslurm.utils cimport cstr, ctime

pyslurm/core/job/job.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
2626
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2727
#
28-
# cython: c_string_type=unicode, c_string_encoding=default
28+
# cython: c_string_type=unicode, c_string_encoding=utf8
2929
# cython: language_level=3
3030

3131
from os import WIFSIGNALED, WIFEXITED, WTERMSIG, WEXITSTATUS

pyslurm/core/job/sbatch_opts.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
2020
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121
#
22-
# cython: c_string_type=unicode, c_string_encoding=default
22+
# cython: c_string_type=unicode, c_string_encoding=utf8
2323
# cython: language_level=3
2424

2525
import re

pyslurm/core/job/step.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
2020
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121
#
22-
# cython: c_string_type=unicode, c_string_encoding=default
22+
# cython: c_string_type=unicode, c_string_encoding=utf8
2323
# cython: language_level=3
2424

2525
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t

0 commit comments

Comments
 (0)