From 3ada166ed5bcf3fbc8bd384224302a11107cc52e Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Sun, 5 Nov 2023 23:35:25 +0100 Subject: [PATCH 1/2] Redefine CI base images --- ci-scripts/dockerfiles/Lmod-base.dockerfile | 28 ----------- ci-scripts/dockerfiles/Lmod.dockerfile | 47 +++++++++++-------- ci-scripts/dockerfiles/Lmod77-base.dockerfile | 34 -------------- ci-scripts/dockerfiles/Lmod77.dockerfile | 35 +++++++++----- ci-scripts/dockerfiles/Tmod32-base.dockerfile | 10 ---- ci-scripts/dockerfiles/Tmod32.dockerfile | 23 ++------- ci-scripts/dockerfiles/Tmod4-base.dockerfile | 28 ----------- ci-scripts/dockerfiles/Tmod4.dockerfile | 36 ++++++++------ .../dockerfiles/reframe-lmod.dockerfile | 24 ++++++++++ .../dockerfiles/reframe-lmod77.dockerfile | 24 ++++++++++ .../dockerfiles/reframe-tmod32.dockerfile | 22 +++++++++ .../dockerfiles/reframe-tmod4.dockerfile | 25 ++++++++++ ci-scripts/dockerfiles/tutorials.dockerfile | 12 ++--- 13 files changed, 179 insertions(+), 169 deletions(-) delete mode 100644 ci-scripts/dockerfiles/Lmod-base.dockerfile delete mode 100644 ci-scripts/dockerfiles/Lmod77-base.dockerfile delete mode 100644 ci-scripts/dockerfiles/Tmod32-base.dockerfile delete mode 100644 ci-scripts/dockerfiles/Tmod4-base.dockerfile create mode 100644 ci-scripts/dockerfiles/reframe-lmod.dockerfile create mode 100644 ci-scripts/dockerfiles/reframe-lmod77.dockerfile create mode 100644 ci-scripts/dockerfiles/reframe-tmod32.dockerfile create mode 100644 ci-scripts/dockerfiles/reframe-tmod4.dockerfile diff --git a/ci-scripts/dockerfiles/Lmod-base.dockerfile b/ci-scripts/dockerfiles/Lmod-base.dockerfile deleted file mode 100644 index ab5d5617af..0000000000 --- a/ci-scripts/dockerfiles/Lmod-base.dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:20.04 - -ENV TZ=Europe/Zurich -ENV DEBIAN_FRONTEND=noninteractive -ENV _LMOD_VER=8.4.12 - -# ReFrame requirements -RUN \ - apt-get -y update && \ - apt-get -y install ca-certificates && \ - update-ca-certificates && \ - apt-get -y install gcc make git python3 python3-pip python3-venv - -# Required utilities -RUN apt-get -y install wget - -# Install Lmod -RUN \ - apt-get -y install lua5.3 lua-bit32:amd64 lua-posix:amd64 lua-posix-dev liblua5.3-0:amd64 liblua5.3-dev:amd64 tcl tcl-dev tcl8.6 tcl8.6-dev:amd64 libtcl8.6:amd64 && \ - wget -q https://github.com/TACC/Lmod/archive/${_LMOD_VER}.tar.gz -O lmod.tar.gz && \ - tar xzf lmod.tar.gz && \ - cd Lmod-${_LMOD_VER} && \ - ./configure && make install && \ - cd .. && rm -rf lmod.tar.gz Lmod-${_LMOD_VER} && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -ENV BASH_ENV=/usr/local/lmod/lmod/init/profile diff --git a/ci-scripts/dockerfiles/Lmod.dockerfile b/ci-scripts/dockerfiles/Lmod.dockerfile index 85be193976..b908d76022 100644 --- a/ci-scripts/dockerfiles/Lmod.dockerfile +++ b/ci-scripts/dockerfiles/Lmod.dockerfile @@ -1,20 +1,27 @@ -# -# Execute this from the top-level ReFrame source directory -# - - -FROM ghcr.io/reframe-hpc/rfm-ci-base:lmod - -# ReFrame user -RUN useradd -ms /bin/bash rfmuser - -USER rfmuser - -# Install ReFrame from the current directory -COPY --chown=rfmuser . /home/rfmuser/reframe/ - -WORKDIR /home/rfmuser/reframe - -RUN ./bootstrap.sh - -CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/lmod.py -v"] +FROM ubuntu:20.04 + +ENV TZ=Europe/Zurich +ENV DEBIAN_FRONTEND=noninteractive +ENV _LMOD_VER=8.4.12 + +# Setup apt +RUN \ + apt-get -y update && \ + apt-get -y install ca-certificates && \ + update-ca-certificates + +# Required utilities +RUN apt-get -y install wget + +# Install Lmod +RUN \ + apt-get -y install lua5.3 lua-bit32:amd64 lua-posix:amd64 lua-posix-dev liblua5.3-0:amd64 liblua5.3-dev:amd64 tcl tcl-dev tcl8.6 tcl8.6-dev:amd64 libtcl8.6:amd64 && \ + wget -q https://github.com/TACC/Lmod/archive/${_LMOD_VER}.tar.gz -O lmod.tar.gz && \ + tar xzf lmod.tar.gz && \ + cd Lmod-${_LMOD_VER} && \ + ./configure && make install && \ + cd .. && rm -rf lmod.tar.gz Lmod-${_LMOD_VER} && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV BASH_ENV=/usr/local/lmod/lmod/init/profile diff --git a/ci-scripts/dockerfiles/Lmod77-base.dockerfile b/ci-scripts/dockerfiles/Lmod77-base.dockerfile deleted file mode 100644 index 0bea9b030f..0000000000 --- a/ci-scripts/dockerfiles/Lmod77-base.dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -# -# LMod versions prior to 8.2 emitted Python commands differently, so we use this -# Dockerfile to test the bindings of older versions -# - - -FROM ubuntu:20.04 - -ENV TZ=Europe/Zurich -ENV DEBIAN_FRONTEND=noninteractive -ENV _LMOD_VER=7.7 - -# ReFrame requirements -RUN \ - apt-get -y update && \ - apt-get -y install ca-certificates && \ - update-ca-certificates && \ - apt-get -y install gcc make git python3 python3-pip python3-venv - -# Required utilities -RUN apt-get -y install wget - -# Install Lmod -RUN \ - apt-get -y install lua5.3 lua-bit32:amd64 lua-posix:amd64 lua-posix-dev liblua5.3-0:amd64 liblua5.3-dev:amd64 tcl tcl-dev tcl8.6 tcl8.6-dev:amd64 libtcl8.6:amd64 lua-filesystem:amd64 lua-filesystem-dev:amd64 && \ - wget -q https://github.com/TACC/Lmod/archive/${_LMOD_VER}.tar.gz -O lmod.tar.gz && \ - tar xzf lmod.tar.gz && \ - cd Lmod-${_LMOD_VER} && \ - ./configure && make install && \ - cd .. && rm -rf lmod.tar.gz Lmod-${_LMOD_VER} && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -ENV BASH_ENV=/usr/local/lmod/lmod/init/profile diff --git a/ci-scripts/dockerfiles/Lmod77.dockerfile b/ci-scripts/dockerfiles/Lmod77.dockerfile index e48d1745e8..93612eaf56 100644 --- a/ci-scripts/dockerfiles/Lmod77.dockerfile +++ b/ci-scripts/dockerfiles/Lmod77.dockerfile @@ -1,20 +1,33 @@ # -# Execute this from the top-level ReFrame source directory +# LMod versions prior to 8.2 emitted Python commands differently, so we use this +# Dockerfile to test the bindings of older versions # -FROM ghcr.io/reframe-hpc/rfm-ci-base:lmod77 +FROM ubuntu:20.04 -# ReFrame user -RUN useradd -ms /bin/bash rfmuser +ENV TZ=Europe/Zurich +ENV DEBIAN_FRONTEND=noninteractive +ENV _LMOD_VER=7.7 -USER rfmuser +# Setup apt +RUN \ + apt-get -y update && \ + apt-get -y install ca-certificates && \ + update-ca-certificates -# Install ReFrame from the current directory -COPY --chown=rfmuser . /home/rfmuser/reframe/ +# Required utilities +RUN apt-get -y install wget -WORKDIR /home/rfmuser/reframe +# Install Lmod +RUN \ + apt-get -y install lua5.3 lua-bit32:amd64 lua-posix:amd64 lua-posix-dev liblua5.3-0:amd64 liblua5.3-dev:amd64 tcl tcl-dev tcl8.6 tcl8.6-dev:amd64 libtcl8.6:amd64 lua-filesystem:amd64 lua-filesystem-dev:amd64 && \ + wget -q https://github.com/TACC/Lmod/archive/${_LMOD_VER}.tar.gz -O lmod.tar.gz && \ + tar xzf lmod.tar.gz && \ + cd Lmod-${_LMOD_VER} && \ + ./configure && make install && \ + cd .. && rm -rf lmod.tar.gz Lmod-${_LMOD_VER} && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -RUN ./bootstrap.sh - -CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/lmod.py -v"] +ENV BASH_ENV=/usr/local/lmod/lmod/init/profile diff --git a/ci-scripts/dockerfiles/Tmod32-base.dockerfile b/ci-scripts/dockerfiles/Tmod32-base.dockerfile deleted file mode 100644 index 2b52cd78a0..0000000000 --- a/ci-scripts/dockerfiles/Tmod32-base.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM centos:7 - -# ReFrame requirements -RUN \ - yum -y install gcc make git python3 - -# Install Tmod 3.2 -RUN yum -y install environment-modules && \ - yum clean all && \ - rm -rf /var/cache/yum diff --git a/ci-scripts/dockerfiles/Tmod32.dockerfile b/ci-scripts/dockerfiles/Tmod32.dockerfile index 6b2f4c85ea..6084dbd9e9 100644 --- a/ci-scripts/dockerfiles/Tmod32.dockerfile +++ b/ci-scripts/dockerfiles/Tmod32.dockerfile @@ -1,19 +1,6 @@ -# -# Execute this from the top-level ReFrame source directory -# +FROM centos:7 -FROM ghcr.io/reframe-hpc/rfm-ci-base:tmod32 - -# ReFrame user -RUN useradd -ms /bin/bash rfmuser - -USER rfmuser - -# Install ReFrame from the current directory -COPY --chown=rfmuser . /home/rfmuser/reframe/ - -WORKDIR /home/rfmuser/reframe - -RUN ./bootstrap.sh - -CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/tmod32.py -v"] +# Install Tmod 3.2.10 +RUN yum -y install environment-modules && \ + yum clean all && \ + rm -rf /var/cache/yum diff --git a/ci-scripts/dockerfiles/Tmod4-base.dockerfile b/ci-scripts/dockerfiles/Tmod4-base.dockerfile deleted file mode 100644 index 072b82a32a..0000000000 --- a/ci-scripts/dockerfiles/Tmod4-base.dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:20.04 - -ENV TZ=Europe/Zurich -ENV DEBIAN_FRONTEND=noninteractive -ENV _TMOD_VER=4.6.0 - -# ReFrame requirements -RUN \ - apt-get -y update && \ - apt-get -y install ca-certificates && \ - update-ca-certificates && \ - apt-get -y install gcc make git python3 python3-pip python3-venv - -# Required utilities -RUN apt-get -y install wget - -# Install Tmod4 -RUN \ - apt-get -y install autoconf tcl-dev && \ - wget -q https://github.com/cea-hpc/modules/archive/v${_TMOD_VER}.tar.gz -O tmod.tar.gz && \ - tar xzf tmod.tar.gz && \ - cd modules-${_TMOD_VER} && \ - ./configure && make install && \ - cd .. && rm -rf tmod.tar.gz modules-${_TMOD_VER} && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -ENV BASH_ENV=/usr/local/Modules/init/profile.sh diff --git a/ci-scripts/dockerfiles/Tmod4.dockerfile b/ci-scripts/dockerfiles/Tmod4.dockerfile index 7bf4d0a5e0..d8f7fb66aa 100644 --- a/ci-scripts/dockerfiles/Tmod4.dockerfile +++ b/ci-scripts/dockerfiles/Tmod4.dockerfile @@ -1,19 +1,27 @@ -# -# Execute this from the top-level ReFrame source directory -# +FROM ubuntu:20.04 -FROM ghcr.io/reframe-hpc/rfm-ci-base:tmod4 +ENV TZ=Europe/Zurich +ENV DEBIAN_FRONTEND=noninteractive +ENV _TMOD_VER=4.6.0 -# ReFrame user -RUN useradd -ms /bin/bash rfmuser +# Setup apt +RUN \ + apt-get -y update && \ + apt-get -y install ca-certificates && \ + update-ca-certificates -USER rfmuser +# Required utilities +RUN apt-get -y install wget less -# Install ReFrame from the current directory -COPY --chown=rfmuser . /home/rfmuser/reframe/ +# Install Tmod4 +RUN \ + apt-get -y install autoconf tcl-dev && \ + wget -q https://github.com/cea-hpc/modules/archive/v${_TMOD_VER}.tar.gz -O tmod.tar.gz && \ + tar xzf tmod.tar.gz && \ + cd modules-${_TMOD_VER} && \ + ./configure && make install && \ + cd .. && rm -rf tmod.tar.gz modules-${_TMOD_VER} && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -WORKDIR /home/rfmuser/reframe - -RUN ./bootstrap.sh - -CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/tmod4.py -v"] +ENV BASH_ENV=/usr/local/Modules/init/profile.sh diff --git a/ci-scripts/dockerfiles/reframe-lmod.dockerfile b/ci-scripts/dockerfiles/reframe-lmod.dockerfile new file mode 100644 index 0000000000..185f540380 --- /dev/null +++ b/ci-scripts/dockerfiles/reframe-lmod.dockerfile @@ -0,0 +1,24 @@ +# +# Execute this from the top-level ReFrame source directory +# + + +FROM ghcr.io/reframe-hpc/lmod:8.4.12 + +# Install ReFrame unit test requirements +RUN apt-get -y update && \ + apt-get -y install gcc git make python3 python3-pip python3-venv + +# ReFrame user +RUN useradd -ms /bin/bash rfmuser + +USER rfmuser + +# Install ReFrame from the current directory +COPY --chown=rfmuser . /home/rfmuser/reframe/ + +WORKDIR /home/rfmuser/reframe + +RUN ./bootstrap.sh + +CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/lmod.py -v"] diff --git a/ci-scripts/dockerfiles/reframe-lmod77.dockerfile b/ci-scripts/dockerfiles/reframe-lmod77.dockerfile new file mode 100644 index 0000000000..4d07ccdcb6 --- /dev/null +++ b/ci-scripts/dockerfiles/reframe-lmod77.dockerfile @@ -0,0 +1,24 @@ +# +# Execute this from the top-level ReFrame source directory +# + + +FROM ghcr.io/reframe-hpc/lmod:7.7 + +# Install ReFrame unit test requirements +RUN apt-get -y update && \ + apt-get -y install gcc make python3 python3-pip python3-venv + +# ReFrame user +RUN useradd -ms /bin/bash rfmuser + +USER rfmuser + +# Install ReFrame from the current directory +COPY --chown=rfmuser . /home/rfmuser/reframe/ + +WORKDIR /home/rfmuser/reframe + +RUN ./bootstrap.sh + +CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/lmod.py -v"] diff --git a/ci-scripts/dockerfiles/reframe-tmod32.dockerfile b/ci-scripts/dockerfiles/reframe-tmod32.dockerfile new file mode 100644 index 0000000000..ccc1eb357e --- /dev/null +++ b/ci-scripts/dockerfiles/reframe-tmod32.dockerfile @@ -0,0 +1,22 @@ +# +# Execute this from the top-level ReFrame source directory +# + +FROM ghcr.io/reframe-hpc/tmod:3.2.10 + +# ReFrame requirements +RUN yum -y install gcc make git python3 + +# ReFrame user +RUN useradd -ms /bin/bash rfmuser + +USER rfmuser + +# Install ReFrame from the current directory +COPY --chown=rfmuser . /home/rfmuser/reframe/ + +WORKDIR /home/rfmuser/reframe + +RUN ./bootstrap.sh + +CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/tmod32.py -v"] diff --git a/ci-scripts/dockerfiles/reframe-tmod4.dockerfile b/ci-scripts/dockerfiles/reframe-tmod4.dockerfile new file mode 100644 index 0000000000..57f49f706c --- /dev/null +++ b/ci-scripts/dockerfiles/reframe-tmod4.dockerfile @@ -0,0 +1,25 @@ +# +# Execute this from the top-level ReFrame source directory +# + +FROM ghcr.io/reframe-hpc/tmod:4.6.0 + + +# ReFrame requirements +RUN \ + apt-get -y update && \ + apt-get -y install gcc make git python3 python3-pip python3-venv + +# ReFrame user +RUN useradd -ms /bin/bash rfmuser + +USER rfmuser + +# Install ReFrame from the current directory +COPY --chown=rfmuser . /home/rfmuser/reframe/ + +WORKDIR /home/rfmuser/reframe + +RUN ./bootstrap.sh + +CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/tmod4.py -v"] diff --git a/ci-scripts/dockerfiles/tutorials.dockerfile b/ci-scripts/dockerfiles/tutorials.dockerfile index 34c7560ac3..8e09852d37 100644 --- a/ci-scripts/dockerfiles/tutorials.dockerfile +++ b/ci-scripts/dockerfiles/tutorials.dockerfile @@ -3,14 +3,15 @@ # -FROM ghcr.io/reframe-hpc/rfm-ci-base:lmod +FROM ghcr.io/reframe-hpc/lmod:8.4.12 ENV _SPACK_VER=0.16 ENV _EB_VER=4.4.1 -# Required utilities + +# Install ReFrame unit test requirements RUN apt-get -y update && \ - apt-get -y install curl + apt-get -y install gcc git make python3 python3-pip python3-venv curl # ReFrame user RUN useradd -ms /bin/bash rfmuser @@ -18,9 +19,8 @@ RUN useradd -ms /bin/bash rfmuser USER rfmuser # Install Spack -RUN git clone https://github.com/spack/spack ~/spack && \ - cd ~/spack && \ - git checkout releases/v${_SPACK_VER} +RUN git clone --branch releases/v${_SPACK_VER} https://github.com/spack/spack ~/spack && \ + cd ~/spack RUN pip3 install easybuild==${_EB_VER} From 773bdc5b370d25cd1b0bc229b5367c52c8f38f90 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Sun, 5 Nov 2023 23:47:45 +0100 Subject: [PATCH 2/2] Update Github workflows --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6748b056b4..a5e512c2f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - modules-version: [Lmod, Lmod77, Tmod32, Tmod4] + modules-version: [lmod, lmod77, tmod32, tmod4] steps: - uses: actions/checkout@v3 - name: Login to GitHub Container Registry @@ -81,10 +81,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build Image for ${{ matrix.modules-version }} run: | - docker build -f ci-scripts/dockerfiles/${{ matrix.modules-version }}.dockerfile -t reframe:${{ matrix.modules-version }} . + docker build -f ci-scripts/dockerfiles/reframe-${{ matrix.modules-version }}.dockerfile -t reframe-${{ matrix.modules-version }}:latest . - name: Run Unittests run: | - docker run reframe:${{ matrix.modules-version }} + docker run reframe-${{ matrix.modules-version }}:latest tutorialtest: runs-on: ubuntu-latest @@ -99,11 +99,11 @@ jobs: - name: Build Image for Tutorial Tests run: | echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin - docker build -f ci-scripts/dockerfiles/tutorials.dockerfile -t reframe:tutorials . + docker build -f ci-scripts/dockerfiles/tutorials.dockerfile -t reframe-tutorials:latest . docker logout - name: Run Tutorial Tests run: | - docker run reframe:tutorials + docker run reframe-tutorials:latest unusedimports: runs-on: ubuntu-latest