Skip to content

Commit f99e544

Browse files
committed
Test Spack module backend in CI
1 parent b8c7eac commit f99e544

File tree

5 files changed

+43
-11
lines changed

5 files changed

+43
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
strategy:
5353
matrix:
54-
modules-version: [lmod, envmodules]
54+
modules-version: [envmodules, lmod, spack]
5555
steps:
5656
- uses: actions/checkout@v4
5757
- name: Login to GitHub Container Registry

ci-scripts/dockerfiles/eb-spack-howto.dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ RUN useradd -ms /bin/bash rfmuser
1919
USER rfmuser
2020

2121
# Install Spack
22-
RUN git clone --branch v${_SPACK_VER} https://github.com/spack/spack ~/spack && \
23-
cd ~/spack
24-
22+
RUN git clone --branch v${_SPACK_VER} --depth 1 https://github.com/spack/spack ~/spack
2523
RUN pip3 install --break-system-packages easybuild==${_EB_VER}
2624

2725
ENV PATH="/home/rfmuser/.local/bin:${PATH}"

ci-scripts/dockerfiles/reframe-lmod.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ WORKDIR /home/rfmuser/reframe
2121

2222
RUN ./bootstrap.sh
2323
RUN pip install --break-system-packages coverage
24+
RUN echo '. /usr/local/lmod/lmod/init/profile' >> /home/rfmuser/.profile
2425
ENV BASH_ENV=/home/rfmuser/.profile
2526

26-
CMD ["/bin/bash", "-c", "coverage run --source=reframe ./test_reframe.py --rfm-user-config=ci-scripts/configs/lmod.py; coverage xml -o coverage.xml"]
27+
CMD ["/bin/bash", "-c", "coverage run --source=reframe ./test_reframe.py -v --rfm-user-config=ci-scripts/configs/lmod.py; coverage xml -o coverage.xml"]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Execute this from the top-level ReFrame source directory
3+
#
4+
5+
6+
FROM ubuntu:24.04
7+
8+
ENV _SPACK_VER=1.1.0
9+
10+
# Install ReFrame unit test requirements
11+
RUN apt-get -y update && \
12+
apt-get -y install gcc git make python3 python3-pip
13+
14+
# ReFrame user
15+
RUN useradd -ms /bin/bash rfmuser
16+
17+
USER rfmuser
18+
19+
# Install Spack
20+
RUN git clone --branch v${_SPACK_VER} https://github.com/spack/spack ~/spack
21+
22+
# Install ReFrame from the current directory
23+
COPY --chown=rfmuser . /home/rfmuser/reframe/
24+
25+
WORKDIR /home/rfmuser/reframe
26+
27+
RUN ./bootstrap.sh
28+
RUN pip install --break-system-packages coverage
29+
30+
RUN echo '. /home/rfmuser/spack/share/spack/setup-env.sh' >> /home/rfmuser/.profile
31+
ENV BASH_ENV=/home/rfmuser/.profile
32+
33+
CMD ["/bin/bash", "-c", "coverage run --source=reframe ./test_reframe.py -v --rfm-user-config=ci-scripts/configs/spack.py; coverage xml -o coverage.xml"]

examples/tutorial/dockerfiles/eb-spack.dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#
44

55

6-
FROM ghcr.io/reframe-hpc/lmod:8.4.12
6+
FROM ghcr.io/reframe-hpc/lmod:9.0.4
77

8-
ENV _SPACK_VER=0.16
9-
ENV _EB_VER=4.4.1
8+
ENV _SPACK_VER=1.1.0
9+
ENV _EB_VER=5.1.2
1010

1111
RUN apt-get -y update && \
1212
apt-get -y install curl && \
@@ -22,7 +22,7 @@ RUN git clone --depth 1 --branch $REFRAME_TAG https://github.com/reframe-hpc/ref
2222
ENV PATH=/usr/local/share/reframe/bin:$PATH
2323

2424
# Install EasyBuild
25-
RUN pip3 install easybuild==${_EB_VER}
25+
RUN pip3 install --break-system-packages easybuild==${_EB_VER}
2626

2727
# Add tutorial user
2828
RUN useradd -ms /bin/bash -G sudo user && \
@@ -33,7 +33,7 @@ WORKDIR /home/user
3333

3434
# Install Spack
3535
RUN mkdir .local && cd .local && \
36-
git clone --branch releases/v${_SPACK_VER} --depth 1 https://github.com/spack/spack
36+
git clone --branch v${_SPACK_VER} --depth 1 https://github.com/spack/spack
3737

38-
RUN echo '. /usr/local/lmod/lmod/init/profile && . /home/user/.local/spack/share/spack/setup-env.sh' > /home/user/.profile
38+
RUN echo '. /usr/local/lmod/lmod/init/profile && . /home/user/.local/spack/share/spack/setup-env.sh' >> /home/user/.profile
3939
ENV BASH_ENV=/home/user/.profile

0 commit comments

Comments
 (0)