diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 08175c1..5513846 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -134,3 +134,4 @@ runs: sudo swapoff /swapfile || true sudo rm -f /swapfile || true fi + \ No newline at end of file diff --git a/.github/workflows/debuntu_docker_images.yml b/.github/workflows/debuntu_docker_images.yml index 1725881..e35e268 100644 --- a/.github/workflows/debuntu_docker_images.yml +++ b/.github/workflows/debuntu_docker_images.yml @@ -14,6 +14,11 @@ jobs: base: ['ubuntu/jammy', 'ubuntu/rolling', 'debian/bookworm', 'debian/unstable'] mpi: ['openmpi', 'mpich'] variant: ['mini', 'all', 'pdi'] + # exclude debian/unstable + mpich as debian/unstable mpich package + # does not allow building with shared mem support needed by VeloC + exclude: + - { base: 'debian/unstable', mpi: mpich, variant : all} + - { base: 'debian/unstable', mpi: mpich, variant : mini} runs-on: ubuntu-latest steps: - name: Compute tags, distro & version @@ -28,7 +33,7 @@ jobs: echo "distro_version=${BASE##*/}" >> "${GITHUB_OUTPUT}" - uses: actions/checkout@v6 with: { submodules: 'recursive' } - - name: "Build and push" + - name: "Build and no push" uses: pdidev/test_env/.github/actions/build@v4 with: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -36,6 +41,8 @@ jobs: path: debuntu/${{ matrix.variant }} image-name: ${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }} test: "${{ matrix.variant != 'pdi' }}" # should be true, except for "pdi" variant + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" build-args: | MPI=${{ matrix.mpi }} DISTRO=${{ steps.info.outputs.distro }} diff --git a/.github/workflows/run_clang_format.yml b/.github/workflows/run_clang_format.yml index c667e80..784f4ef 100644 --- a/.github/workflows/run_clang_format.yml +++ b/.github/workflows/run_clang_format.yml @@ -27,4 +27,4 @@ jobs: context: ./ path: run_clang_format image-name: run-clang-format - tags: ${{ steps.info.outputs.tags }} + tags: ${{ steps.info.outputs.tags }} \ No newline at end of file diff --git a/.github/workflows/spack_docker_images.yml b/.github/workflows/spack_docker_images.yml index a5683ce..2890192 100644 --- a/.github/workflows/spack_docker_images.yml +++ b/.github/workflows/spack_docker_images.yml @@ -27,6 +27,8 @@ jobs: context: "./" path: spack/1-base image-name: base + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" cache: ${{ github.event_name != 'schedule' && ( github.event_name != 'workflow_dispatch' || inputs.cache ) }} # cache for every run but scheduled ones - name: "Build and push 2- spackbase" uses: pdidev/test_env/.github/actions/build@v4 @@ -35,6 +37,8 @@ jobs: context: "./" path: spack/2-spackbase image-name: spackbase + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" step_3_baselibs: strategy: fail-fast: false @@ -53,6 +57,8 @@ jobs: context: "./" path: spack/3-baselibs image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-baselibs + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" build-args: | VERSION=${{ matrix.version }} COMPILER=${{ matrix.compiler }} @@ -75,6 +81,8 @@ jobs: context: "./" path: spack/4-mini image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-${{ matrix.mpi }}-mini + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" build-args: | VERSION=${{ matrix.version }} COMPILER=${{ matrix.compiler }} @@ -86,6 +94,8 @@ jobs: context: "./" path: spack/5-all image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-${{ matrix.mpi }}-all + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" build-args: | VERSION=${{ matrix.version }} COMPILER=${{ matrix.compiler }} @@ -111,7 +121,7 @@ jobs: echo "tags=ghcr.io/pdidev/spack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}:${{github.ref_name}}" >> "${GITHUB_OUTPUT}" echo "fullspack=ghcr.io/pdidev/fullspack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}:${{github.ref_name}}" >> "${GITHUB_OUTPUT}" fi - - name: "Build and push" + - name: "Build and no push" uses: pdidev/test_env/.github/actions/build@v4 with: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -119,6 +129,8 @@ jobs: path: spack/6-finalize image-name: spack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }} test: true + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" build-args: | VERSION=${{ matrix.version }} COMPILER=${{ matrix.compiler }} @@ -134,10 +146,12 @@ jobs: path: spack/6-finalize image-name: fullspack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }} target: fullspack + push : "false" + cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max" build-args: | VERSION=${{ matrix.version }} COMPILER=${{ matrix.compiler }} MPI=${{ matrix.mpi }} LIBS=${{ matrix.level }} tags: | - ${{ steps.info.outputs.fullspack }} + ${{ steps.info.outputs.fullspack }} \ No newline at end of file diff --git a/README.md b/README.md index 03ca901..3e2547c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ With the following parameters: * `variant`: - `mini`: dependencies "vendored" in PDI are not included in the image, - `all`: dependencies "vendored" in PDI are included in the image, - - `pdi`: PDI is included in the image. + - `pdi`: PDI is included in the image. The VeloC plugin is not present in this image for the time being. ## Full Spack images diff --git a/debuntu/all/Dockerfile b/debuntu/all/Dockerfile index 9590a33..3274c4a 100644 --- a/debuntu/all/Dockerfile +++ b/debuntu/all/Dockerfile @@ -70,10 +70,47 @@ RUN set -ex \ && rm -rf /root/* \ && [ -f ~/.profile ] && ( sed -i 's/mesg n/( tty -s \&\& mesg n || true )/g' ~/.profile || true ) +# stage : veloc download + +FROM main AS velocdl + +# install tools needed by VeloC install script +RUN set -ex \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + git \ + python3-wget \ + python3-bs4 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt/src + +# Clone VeloC repository +RUN git clone -b 'veloc-1.8' --single-branch --depth 1 \ + https://github.com/ECP-VeloC/veloc.git veloc + +WORKDIR /opt/src/veloc + +# Run VeloC install script +RUN mkdir -p /opt/veloc \ + && ./auto-install.py /opt/veloc + + +# stage : complete image + +FROM main AS complete-main +ARG DISTRO +ARG DISTRO_VERSION +ARG MPI + +COPY --from=velocdl /opt/veloc /opt/veloc + +ENV CMAKE_PREFIX_PATH=/opt/veloc:${CMAKE_PREFIX_PATH} ENV PDI_SYSTEM=${DISTRO}-${DISTRO_VERSION} ENV PDI_COMPILER=gcc ENV PDI_MPI=${MPI} ENV PDI_LIBS=provided +ENV LD_LIBRARY_PATH="/opt/veloc/lib" # only required for openmpi but... ENV OMPI_MCA_rmaps_base_oversubscribe=1 ENV PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe @@ -82,21 +119,19 @@ ENV HOME=/home/ci USER ci:ci WORKDIR ${HOME} - +# stage : pdi download FROM alpine/git AS pdidl -RUN git -C /root clone --recurse-submodules https://github.com/pdidev/pdi.git /root/pdi - +RUN git -C /root clone --recurse-submodules https://github.com/iole-bolognesi/pdi.git /root/pdi +# stage : test -FROM main AS test +FROM complete-main AS test COPY --from=pdidl --chown=ci:ci /root/pdi /home/ci/pdi RUN export VERBOSE=1 \ && bash pdi/bin/build_and_run_all_tests - - -FROM main +FROM complete-main diff --git a/debuntu/mini/Dockerfile b/debuntu/mini/Dockerfile index 46f53af..6b0533a 100644 --- a/debuntu/mini/Dockerfile +++ b/debuntu/mini/Dockerfile @@ -34,6 +34,7 @@ RUN set -ex \ build-essential \ cmake \ doxygen \ + libssl-dev \ gfortran \ libcurl4-openssl-dev \ lib${MPI}-dev \ @@ -61,9 +62,45 @@ RUN set -ex \ && rm -rf /root/* \ && [ -f ~/.profile ] && ( sed -i 's/mesg n/( tty -s \&\& mesg n || true )/g' ~/.profile || true ) +# stage : veloc download + +FROM main AS velocdl + +# install tools needed by VeloC install script +RUN set -ex \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + git \ + python3-wget \ + python3-bs4 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt/src + +# Clone VeloC repository +RUN git clone -b 'veloc-1.8' --single-branch --depth 1 \ + https://github.com/ECP-VeloC/veloc.git veloc + +WORKDIR /opt/src/veloc + +# Run VeloC install script +RUN mkdir -p /opt/veloc \ + && ./auto-install.py /opt/veloc + +# stage : complete image + +FROM main AS complete-main +ARG DISTRO +ARG DISTRO_VERSION +ARG MPI + +COPY --from=velocdl /opt/veloc /opt/veloc + +ENV CMAKE_PREFIX_PATH=/opt/veloc:${CMAKE_PREFIX_PATH} ENV PDI_SYSTEM=${DISTRO}-${DISTRO_VERSION} ENV PDI_COMPILER=gcc ENV PDI_MPI=${MPI} +ENV LD_LIBRARY_PATH="/opt/veloc/lib" # only required for openmpi but... ENV OMPI_MCA_rmaps_base_oversubscribe=1 ENV PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe @@ -72,21 +109,19 @@ ENV HOME=/home/ci USER ci:ci WORKDIR ${HOME} - +# stage : pdi download FROM alpine/git AS pdidl -RUN git -C /root clone --recurse-submodules https://github.com/pdidev/pdi.git /root/pdi - +RUN git -C /root clone --recurse-submodules https://github.com/iole-bolognesi/pdi.git /root/pdi +# stage : test -FROM main AS test +FROM complete-main AS test COPY --from=pdidl --chown=ci:ci /root/pdi /home/ci/pdi RUN export VERBOSE=1 \ && bash pdi/bin/build_and_run_all_tests - - -FROM main +FROM complete-main diff --git a/spack/2-spackbase/Dockerfile b/spack/2-spackbase/Dockerfile index 14138cb..f7060f5 100644 --- a/spack/2-spackbase/Dockerfile +++ b/spack/2-spackbase/Dockerfile @@ -1,6 +1,7 @@ ARG IMAGE_TAG +ARG REGISTRY=ghcr.io/pdidev/test_env -FROM ghcr.io/pdidev/test_env/base:${IMAGE_TAG} +FROM ${REGISTRY}/base:${IMAGE_TAG} LABEL "org.opencontainers.image.source"="https://github.com/pdidev/test_env" diff --git a/spack/3-baselibs/Dockerfile b/spack/3-baselibs/Dockerfile index 11af49c..d788d6a 100644 --- a/spack/3-baselibs/Dockerfile +++ b/spack/3-baselibs/Dockerfile @@ -1,12 +1,12 @@ ARG VERSION ARG COMPILER ARG IMAGE_TAG +ARG REGISTRY=ghcr.io/pdidev/test_env -FROM ghcr.io/pdidev/test_env/spackbase:${IMAGE_TAG} +FROM ${REGISTRY}/spackbase:${IMAGE_TAG} LABEL "org.opencontainers.image.source"="https://github.com/pdidev/test_env" - ARG VERSION # Download spack @@ -36,18 +36,24 @@ ARG COMPILER ARG SPACK_INSTALL_ARGS="--show-log-on-error --fail-fast" # Install the spack compiler with our latest system compiler -COPY ${COMPILER}.lst compilerpkg.lst -RUN spack solve -I -U \ - "$(cat compilerpkg.lst)%$(spack compilers | tr ' ' '\n' | grep @)" \ - && spack install ${SPACK_INSTALL_ARGS} -U \ - "$(cat compilerpkg.lst)%$(spack compilers | tr ' ' '\n' | grep @)" - - +COPY ${COMPILER}.lst compilerpkg.lst +RUN <