Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/spack_docker_images.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Spack images
on:
schedule: [ { cron: "50 23 * * 0" } ] # run every Sunday 23h50
push: { branches: [ main, 'v*' ] }
push: { branches: [ main, 'v*'] }
pull_request:
workflow_dispatch:
inputs:
Expand Down
3 changes: 2 additions & 1 deletion spack/2-spackbase/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}

@jmorice91 jmorice91 Jun 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this registry? It is relevant for example if we want to test in our fork.
@jbigot @benoitmartin88


LABEL "org.opencontainers.image.source"="https://github.com/pdidev/test_env"

Expand Down
65 changes: 37 additions & 28 deletions spack/3-baselibs/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 <<EORUN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May quote all EORUN of this PR (also relevant for files not modified by this PR)

Suggested change
RUN <<EORUN
RUN <<'EORUN'

@jmorice91 jmorice91 Jun 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use quote, the ${expression}, inside the here document, will not be evaluated.

@JAuriac JAuriac Jun 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the quotes, Docker does not expand the expressions, but the shell still does
This is why we also have COPY <<'EOCOPY' spack.yaml in this file
From what i understand, we can quote all EORUN/EOCOPY here (as it would be more practical to identify a potential issue in the future with a unified syntax)

set -e
COMPILER_PKG="$(cat compilerpkg.lst)"
Comment thread
JAuriac marked this conversation as resolved.
SPACK_VERSION="$(spack compilers | tr ' ' '\n' | grep @)"
Comment thread
JAuriac marked this conversation as resolved.
Comment thread
JAuriac marked this conversation as resolved.
# Select the ~bootstrap gcc variant as the 3-stage bootstrap fails on latest spack
if [[ "$COMPILER_PKG" == gcc* ]]
then
BOOT="~bootstrap"
Comment thread
iole-bolognesi marked this conversation as resolved.
Outdated
else
BOOT=""
fi
spack install ${SPACK_INSTALL_ARGS} -U "${COMPILER_PKG}${BOOT}%${SPACK_VERSION}"
EORUN
# Prevent building any new compiler
RUN spack config --scope site add 'packages:llvm:buildable: false'
RUN spack config --scope site add 'packages:gcc:buildable: false'


# Generate a compiler ref
# * before 1.0, rely on the compilers section and generate a mixed compiler for llvm
# * from spack 1.0 on, define a toolchain
Expand Down Expand Up @@ -86,39 +92,42 @@ else
fi
EORUN


# Install an environment with our base libraries using the compiler ref we just generated
# Create an environment with our base libraries using the compiler ref we just generated
COPY <<'EOCOPY' spack.yaml
spack:
view: false
definitions:
- buildeps: []
- compiler: []
- libs: []
- mpi: []
- mpilibs: []
specs:
- '$buildeps'
- matrix:
- ['$%compiler']
- - '$libs'
- '$mpi'
- matrix:
- ['$%compiler']
- ['$^mpi']
- ['$mpilibs']
- $buildeps
- $libs
- $mpi
- $mpilibs
EOCOPY
RUN spack env create pdienv spack.yaml
COPY deps.sh deps.sh
RUN . deps.sh && spack -e pdienv add -l buildeps ${BASE_BUILDDEPS}
RUN . deps.sh && spack -e pdienv add -l libs ${BASE_LIBS}
RUN <<EORUN

# The toolchain is attached directly to each lib spec (string-parsed), which
# avoids the matrix that crashes in expand_toolchains on latest spack
RUN <<'EORUN'
set -e
if ( spack --version | grep -qs '^1\.' )
then spack -e pdienv add -l compiler pditoolchain
else spack -e pdienv add -l compiler "$(spack compilers | tr ' ' '\n' | grep @)"
. deps.sh
if spack --version | grep -qs '^1\.'
then COMPILER_REF="%pditoolchain"
else COMPILER_REF="%$(spack compilers | tr ' ' '\n' | grep @)"
Comment thread
JAuriac marked this conversation as resolved.
fi
for p in ${BASE_BUILDDEPS}; do
spack -e pdienv add -l buildeps "$p ${COMPILER_REF}"
Comment thread
JAuriac marked this conversation as resolved.
Outdated
done
for p in ${BASE_LIBS}; do
spack -e pdienv add -l libs "$p ${COMPILER_REF}"
done
EORUN

# Concretize, fetch, install
RUN spack -e pdienv concretize --reuse
RUN spack -e pdienv fetch \
|| spack -e pdienv fetch \
Expand Down
2 changes: 1 addition & 1 deletion spack/3-baselibs/clang.lst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
llvm+llvm_dylib+link_llvm_dylib~lldb
llvm+llvm_dylib+link_llvm_dylib~lldb+gold

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, is it Gold itself that is deprecated, and not its Spack.
Why is this variant needed here ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See failure

Doxygen is built with link time optimization (LTO). Building with link time optimization requires cooperation from the system linker. LTO support on Linux systems is available via the gold linker which has a plugin interface. The LLVM gold plugin is an implementation of this interface.

To avoid using the deprecated approach, it seems that the alternative is to use LLVM native linker (LLD). I am currently testing this approach but I still did not manage to make it work.

5 changes: 3 additions & 2 deletions spack/4-mini/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ ARG VERSION
ARG COMPILER
ARG MPI
ARG IMAGE_TAG
ARG REGISTRY=ghcr.io/pdidev/test_env

FROM ghcr.io/pdidev/test_env/builder:${VERSION}-${COMPILER}-baselibs-${IMAGE_TAG}
FROM ${REGISTRY}/builder:${VERSION}-${COMPILER}-baselibs-${IMAGE_TAG}

LABEL "org.opencontainers.image.source"="https://github.com/pdidev/test_env"

Expand All @@ -12,7 +13,7 @@ ARG MPI
ARG SPACK_INSTALL_ARGS="--show-log-on-error --fail-fast"

# Add our MPI of choice and base MPI-dependant libs to the environment and install it
RUN spack -e pdienv add -l mpi "${MPI}"
RUN spack -e pdienv add -l mpi "${MPI}"
RUN . deps.sh && spack -e pdienv add -l mpilibs ${BASE_MPILIBS}
RUN spack -e pdienv concretize -f --reuse
RUN spack -e pdienv install ${SPACK_INSTALL_ARGS}
5 changes: 2 additions & 3 deletions spack/5-all/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ ARG VERSION
ARG COMPILER
ARG MPI
ARG IMAGE_TAG
ARG REGISTRY=ghcr.io/pdidev/test_env

FROM ghcr.io/pdidev/test_env/builder:${VERSION}-${COMPILER}-${MPI}-mini-${IMAGE_TAG}
FROM ${REGISTRY}/builder:${VERSION}-${COMPILER}-${MPI}-mini-${IMAGE_TAG}

LABEL "org.opencontainers.image.source"="https://github.com/pdidev/test_env"


# before 1.0, add the external repo for paraconf
RUN <<EORUN
set -e
Expand All @@ -19,7 +19,6 @@ then
fi
EORUN


ARG SPACK_INSTALL_ARGS="--show-log-on-error --fail-fast"

# Add the optional libraries to our environment and install it
Expand Down
15 changes: 4 additions & 11 deletions spack/6-finalize/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ ARG COMPILER
ARG MPI
ARG LIBS
ARG IMAGE_TAG
ARG REGISTRY=ghcr.io/pdidev/test_env

FROM ghcr.io/pdidev/test_env/builder:${VERSION}-${COMPILER}-${MPI}-${LIBS}-${IMAGE_TAG} AS builder
FROM ${REGISTRY}/builder:${VERSION}-${COMPILER}-${MPI}-${LIBS}-${IMAGE_TAG} AS builder

LABEL "org.opencontainers.image.source"="https://github.com/pdidev/test_env"

Expand Down Expand Up @@ -94,7 +95,7 @@ RUN spack clean -a



FROM ghcr.io/pdidev/test_env/base:${IMAGE_TAG} AS main
FROM ${REGISTRY}/base:${IMAGE_TAG} AS main

COPY --from=builder ${SPACK_INSTALL} ${SPACK_INSTALL}
COPY --from=builder ${SPACK_MODULES} ${SPACK_MODULES}
Expand Down Expand Up @@ -133,7 +134,7 @@ CMD ["bash", "-i"]



FROM ghcr.io/pdidev/test_env/spackbase:${IMAGE_TAG} AS fullspack
FROM ${REGISTRY}/spackbase:${IMAGE_TAG} AS fullspack


COPY --from=builder --chown=ci:ci ${SPACK_INSTALL} ${SPACK_INSTALL}
Expand All @@ -158,19 +159,11 @@ FROM alpine/git AS pdidl

RUN git -C /root clone --recurse-submodules https://github.com/pdidev/pdi.git /root/pdi





FROM 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