Skip to content

Commit 9af1110

Browse files
Release RPMs for multiple slurm versions (#20)
- add `Require: slurm = SLURM_VERSION` to rpm spec - makefile takes an option `RPM_SLURM_VERSION` (used only in rpm spec) - add a script to make create and extract the binary rpm from the container - Release rpm artifacts for multiple slurm versions
1 parent 5227eeb commit 9af1110

File tree

6 files changed

+48
-16
lines changed

6 files changed

+48
-16
lines changed

.github/workflows/artifacts.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
matrix:
1414
version:
1515
- 20.11.9
16-
- 21.08.8-2
17-
- 22.05.5
16+
- 22.05.2
1817

1918
container:
2019
image: ghcr.io/eth-cscs/cache_docker/slurm-uenv-mount-tester-${{ matrix.version }}:latest
@@ -23,35 +22,34 @@ jobs:
2322
password: ${{ secrets.GITHUB_TOKEN }}
2423
env:
2524
NODE_HW: CPUS=2
25+
SLURM_VER: ${{ matrix.version }}
2626
options: --cpus 2 --privileged
2727

2828
steps:
2929
- uses: actions/checkout@v3
3030
- run: |
31-
make rpm
31+
make RPM_SLURM_VERSION=${SLURM_VER} rpm
3232
sudo rpmbuild --rebuild "$(find rpm/SRPMS -name '*.rpm' -type f -print -quit)" --define "_topdir $(pwd)/rpm"
33-
sudo rpm --install "$(find rpm/RPMS -name '*.rpm' -type f -print -quit)"
33+
# --nodeps is required since the ci container has handbuilt slurm (not installed via rpm)
34+
sudo rpm --install --nodeps "$(find rpm/RPMS -name '*.rpm' -type f -print -quit)"
3435
find rpm -name '*.rpm' -type f -exec cp {} . \;
36+
fname=$(ls *x86_64.rpm)
37+
dstname=$(echo $fname | sed "s/x86_64/x86_64-slurm-${SLURM_VER}/")
38+
mv $fname $dstname
3539
- name: upload-rpm
3640
uses: actions/upload-artifact@v3
3741
with:
38-
name: rpm-${{ matrix.version }}
42+
name: rpm
3943
path: '*.rpm'
4044

4145
tag-release:
4246
runs-on: ubuntu-20.04
43-
strategy:
44-
matrix:
45-
version:
46-
- 20.11.9
47-
# - 21.08.8-2
48-
# - 22.05.5
4947
needs: rpm
5048
steps:
5149
- name: download-artifacts
5250
uses: actions/download-artifact@v3
5351
with:
54-
name: rpm-${{ matrix.version }}
52+
name: rpm
5553
- name: release
5654
uses: softprops/action-gh-release@v1
5755
if: startsWith(github.ref, 'refs/tags/')

.github/workflows/build-test-image.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ jobs:
1414
matrix:
1515
version:
1616
- 20.11.9
17-
- 21.08.8-2
18-
- 22.05.5
17+
- 22.05.2
1918

2019
env:
2120
base_tag: ghcr.io/eth-cscs/slurm-container-${{ matrix.version }}:latest
@@ -51,8 +50,7 @@ jobs:
5150
matrix:
5251
version:
5352
- 20.11.9
54-
- 21.08.8-2
55-
- 22.05.5
53+
- 22.05.2
5654

5755
container:
5856
image: ghcr.io/eth-cscs/cache_docker/slurm-uenv-mount-tester-${{ matrix.version }}:latest

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
prefix ?= /usr
44
exec_prefix ?= $(prefix)
55
libdir ?= $(exec_prefix)/lib64
6+
RPM_SLURM_VERSION ?= 20.11
67

78
CXXFLAGS ?= -Os -Wall -Wpedantic -fPIC -std=c++17 -shared
89
LDFLAGS ?= -Wl,--allow-shlib-undefined -shared -fPIC
@@ -39,6 +40,7 @@ install: libslurm-uenv-mount.so
3940
rpm: $(FILES) $(SRCDIR)slurm-uenv-mount.spec
4041
$(SRCDIR)./generate-rpm.sh --build $(RPMBUILDDIR) --src "$(SRCDIR)" --pkgname $(RPMPKG) --spec "$(SRCDIR)slurm-uenv-mount.spec" --files "$(FILES)"
4142
sed -i "s|UENVMNT_VERSION|$(SLURM_UENV_MOUNT_VERSION)|g" "$(RPMBUILDDIR)/SPECS/slurm-uenv-mount.spec"
43+
sed -i "s|SLURM_VERSION|$(RPM_SLURM_VERSION)|g" "$(RPMBUILDDIR)/SPECS/slurm-uenv-mount.spec"
4244
$(RPMBUILD) -bs --define "_topdir $(RPMBUILDDIR)" "$(RPMBUILDDIR)/SPECS/slurm-uenv-mount.spec"
4345

4446
clean:

docker/Readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@ When making changes in the local source tree, the plugin can be rebuilt/resintal
4343
```bash
4444
./rebuild.sh
4545
```
46+
47+
Build the binary rpm, e.g. for installation on production system:
48+
```bash
49+
docker compose exec -T slurm bash < make-binary-rpm.sh
50+
```

docker/make-binary-rpm.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
mkdir -p /tmp/build-rpm
6+
cd /tmp/build-rpm
7+
8+
_SLURM_VER=$(srun --version | sed 's/slurm //')
9+
make -f /slurm-uenv-mount/Makefile RPM_SLURM_VERSION="${_SLURM_VER}" rpm
10+
rpmbuild --rebuild "$(find rpm/SRPMS -name '*.rpm' -type f -print -quit)" --define "_topdir $(pwd)/rpm"
11+
12+
rm ./*.rpm
13+
find rpm -name '*.rpm' -type f -exec cp {} . \;
14+
15+
fname=$(ls *x86_64.rpm)
16+
dstname=$(echo $fname | sed "s/x86_64/x86_64-slurm-${_SLURM_VER}/")
17+
mv $fname $dstname
18+
19+
20+
echo
21+
echo "RPM built. "
22+
echo
23+
24+
echo "Copy from container:"
25+
echo
26+
printf "\tdocker compose cp slurm:$(realpath $dstname) ."
27+
echo
28+
echo

slurm-uenv-mount.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Version: UENVMNT_VERSION
33
Release: 1%{?dist}
44
Summary: SLURM spank plugin to mount squashfs images.
55
Prefix: /usr
6+
Requires: slurm = SLURM_VERSION
67

78
License: BSD3
89
URL: https://github.com/eth-cscs/slurm-uenv-mount

0 commit comments

Comments
 (0)