diff --git a/.github/workflows/feelpp-env.yml b/.github/workflows/feelpp-env.yml index e21866ede..424606e41 100644 --- a/.github/workflows/feelpp-env.yml +++ b/.github/workflows/feelpp-env.yml @@ -12,7 +12,7 @@ on: dist: description: 'Distribution codename' required: true - default: 'jammy' + default: 'noble' type: string flavor: description: 'Flavor of the distribution' @@ -22,7 +22,7 @@ on: version: description: 'Version of the distribution' required: true - default: '22.04' + default: '24.04' type: string dockerfile: description: 'Dockerfile to use' @@ -35,8 +35,6 @@ on: default: 'linux/amd64,linux/arm64' type: string - - jobs: activate: @@ -48,7 +46,6 @@ jobs: steps: - run: echo ok go - all_images: if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, 'all skip') }} strategy: @@ -56,58 +53,53 @@ jobs: max-parallel: 4 matrix: include: - - {service: feelpp-env, dist: focal, flavor: ubuntu, version: "20.04", tag: ubuntu-20.04, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } - - {service: feelpp-env, dist: mantic, flavor: ubuntu, version: "23.10", tag: ubuntu-23.10, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } - - {service: feelpp-env, dist: jammy, flavor: ubuntu, version: "22.04", tag: ubuntu-22.04, experimental: false, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } - - {service: feelpp-env, dist: noble, flavor: ubuntu, version: "24.04", tag: ubuntu-24.04, experimental: true, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } -# - {service: feelpp-env, dist: buster, flavor: debian, version: 10, tag: debian-10, experimental: false, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } -# - {service: feelpp-env, dist: bullseye, flavor: debian, version: "11", tag: debian-11, experimental: false, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } - - {service: feelpp-env, dist: bookworm, flavor: debian, version: "12", tag: debian-12, experimental: false, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } - - {service: feelpp-env, dist: debian-testing, flavor: debian, version: "testing", tag: debian-testing, experimental: true, platforms: "linux/amd64", dockerfile: Dockerfile } - - {service: feelpp-env, dist: debian-sid, flavor: debian, version: "sid", tag: debian-sid, experimental: true, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } - - {service: feelpp-env, dist: fedora-39, flavor: fedora, version: "39", tag: fedora-39, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } +# - {service: feelpp-env, dist: focal, flavor: ubuntu, version: "20.04", tag: ubuntu-20.04, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } +# - {service: feelpp-env, dist: mantic, flavor: ubuntu, version: "23.10", tag: ubuntu-23.10, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } + - {service: feelpp-env, dist: jammy, flavor: ubuntu, version: "22.04", tag: ubuntu-22.04, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } + - {service: feelpp-env, dist: noble, flavor: ubuntu, version: "24.04", tag: ubuntu-24.04, experimental: true, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } +# - {service: feelpp-env, dist: buster, flavor: debian, version: "10", tag: debian-10, experimental: false, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } +# - {service: feelpp-env, dist: bullseye, flavor: debian, version: "11", tag: debian-11, experimental: false, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } + - {service: feelpp-env, dist: bookworm, flavor: debian, version: "12", tag: debian-12, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } + - {service: feelpp-env, dist: trixie, flavor: debian, version: "13", tag: debian-13, experimental: false, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } + - {service: feelpp-env, dist: debian-testing, flavor: debian, version: "testing", tag: debian-testing, experimental: true, platforms: "linux/amd64", dockerfile: Dockerfile } + - {service: feelpp-env, dist: debian-sid, flavor: debian, version: "sid", tag: debian-sid, experimental: true, platforms: "linux/amd64,linux/arm64", dockerfile: Dockerfile } + - {service: feelpp-env, dist: fedora-42, flavor: fedora, version: "42", tag: fedora-42, experimental: false, platforms: "linux/amd64", dockerfile: Dockerfile } runs-on: self-docker needs: activate name: ${{ matrix.flavor }}-${{ matrix.version }} continue-on-error: ${{ matrix.experimental }} steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v5 with: -# lfs: true token: ${{ secrets.CR_PAT }} submodules: recursive - name: generate run: | - bash mkimg.sh -f ${{ matrix.flavor }}:${{ matrix.version }} -t feelpp/${{ matrix.service }}:${{ matrix.tag }} -- - echo "context=feelpp-env/$(bash mkimg.sh -f ${{ matrix.flavor }}:${{ matrix.version }} -t feelpp/${{ matrix.service }}:${{ matrix.tag }} --)" >> $GITHUB_OUTPUT - ls -lrt + dir="$(bash mkimg.sh -f ${{ matrix.flavor }}:${{ matrix.version }} -t feelpp/${{ matrix.service }}:${{ matrix.tag }})" + echo "context=feelpp-env/${dir}" >> "$GITHUB_OUTPUT" + ls -lrt id: generate working-directory: feelpp-env - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - - - name: Build ${{ matrix.service }}:${{ matrix.tag }} - uses: docker/build-push-action@v3 + - name: Build ${{ matrix.service }}:${{ matrix.tag }} + uses: docker/build-push-action@v6 with: context: ./${{ steps.generate.outputs.context }} tags: ghcr.io/feelpp/${{ matrix.service }}:${{ matrix.tag }} file: ./${{ steps.generate.outputs.context }}/${{ matrix.dockerfile }} push: ${{ github.event_name != 'pull_request' }} platforms: ${{ matrix.platforms }} - - - name: Trigger build runner:${{ matrix.tag }} + - name: Trigger build runner:${{ matrix.tag }} uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.CR_PAT }} @@ -115,7 +107,6 @@ jobs: event-type: runner-update-baseimage client-payload: '{"flavor":"${{ matrix.flavor }}","version":"${{ matrix.version }}"}' - one_image: if: ${{ github.event_name == 'workflow_dispatch' }} runs-on: self-docker @@ -125,42 +116,36 @@ jobs: tag: ${{ inputs.flavor }}-${{ inputs.version }} service: feelpp-env steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v5 with: -# lfs: true token: ${{ secrets.CR_PAT }} submodules: recursive - name: generate run: | - bash mkimg.sh -f ${{ inputs.flavor }}:${{ inputs.version }} -t feelpp/${{ env.service }}:${{ env.tag }} -- - echo "context=feelpp-env/$(bash mkimg.sh -f ${{ inputs.flavor }}:${{ inputs.version }} -t feelpp/${{ env.service }}:${{ env.tag }} --)" >> $GITHUB_OUTPUT - ls -lrt + dir="$(bash mkimg.sh -f ${{ inputs.flavor }}:${{ inputs.version }} -t feelpp/${{ env.service }}:${{ env.tag }})" + echo "context=feelpp-env/${dir}" >> "$GITHUB_OUTPUT" + ls -lrt id: generate working-directory: feelpp-env - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - - - name: Build ${{ env.service }}:${{ env.tag }} - uses: docker/build-push-action@v3 + - name: Build ${{ env.service }}:${{ env.tag }} + uses: docker/build-push-action@v6 with: context: ./${{ steps.generate.outputs.context }} tags: ghcr.io/feelpp/${{ env.service }}:${{ env.tag }} file: ./${{ steps.generate.outputs.context }}/${{ inputs.dockerfile }} push: ${{ github.event_name != 'pull_request' }} platforms: ${{ inputs.platforms }} - - - name: Trigger build runner:${{ env.tag }} + - name: Trigger build runner:${{ env.tag }} uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.CR_PAT }} diff --git a/feelpp-env/Dockerfile-debian b/feelpp-env/Dockerfile-debian index 38904b172..b7c7b4a80 100644 --- a/feelpp-env/Dockerfile-debian +++ b/feelpp-env/Dockerfile-debian @@ -1,12 +1,21 @@ -RUN if test -f /etc/apt/sources.list; then sed -i 's/http:\/\/deb.debian.org\/debian\//http:\/\/miroir.univ-lorraine.fr\/debian\//' /etc/apt/sources.list; fi -RUN if test -f /etc/apt/sources.list; then sed -i 's/http:\/\/security.debian.org\/debian-security\//http:\/\/miroir.univ-lorraine.fr\/debian-security\//' /etc/apt/sources.list; fi - - +ARG DEBIAN_MAIN_MIRROR=ftp.fr.debian.org # override with --build-arg if needed +#ARG DEBIAN_MAIN_MIRROR=miroir.univ-lorraine.fr +RUN set -e; \ + . /etc/os-release || true; \ + case "${ID}:${VERSION_CODENAME}" in \ + debian:bookworm|debian:trixie|debian:sid|debian:testing) \ + f=/etc/apt/sources.list.d/debian.sources; \ + echo "Switching main archive to http://${DEBIAN_MAIN_MIRROR}/debian (keeping security) in ${f}"; \ + sed -i "0,/^URIs:\s*http:\/\/deb\.debian\.org\/debian/s//URIs: http:\/\/${DEBIAN_MAIN_MIRROR}\/debian/" "$f"; \ + apt-get -qq update; \ + ;; \ + *) echo "Leaving APT sources untouched (ID=${ID} CODENAME=${VERSION_CODENAME}).";; \ + esac RUN apt-get -qq update && \ - apt-get -y --force-yes install \ - software-properties-common gnupg \ + apt-get -y install \ + gnupg \ ca-certificates-java default-jre-headless \ quilt debhelper dh-python @@ -19,7 +28,7 @@ ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris RUN apt-get -y install tzdata RUN apt-get -qq update && \ - apt-get -y --force-yes install \ + apt-get -y install \ quilt debhelper \ tree ne \ cmake \ @@ -33,7 +42,7 @@ RUN apt-get -qq update && \ libmetis-dev libscotch-dev \ libeigen3-dev \ petsc-dev \ - slepc-dev \ + slepc-dev \ libhdf5-openmpi-dev \ libnlopt-dev \ libgsl-dev \ @@ -42,28 +51,35 @@ RUN apt-get -qq update && \ libxml2-dev libpugixml-dev \ libgmsh-dev gmsh \ bison flex \ - doxygen doxygen-latex \ + doxygen \ transfig imagemagick \ libtbb-dev \ libann-dev libglpk-dev \ libbz2-dev libzip-dev \ libbson-dev \ libmongoc-dev \ - libmongoclient-dev \ + libmongo-client-dev \ python3-pymongo \ - ruby-progressbar \ - ruby-tilt \ - asciidoctor ruby-asciidoctor-pdf \ libglew-dev \ python3-h5py python3-sympy python3-mpi4py python3-numpy python3-petsc4py-real python3-slepc4py-real python3-venv \ rsync \ + gdb\ + && apt-get autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN apt-get -qq update && \ + apt-get -y --no-install-recommends -o APT::Install-Suggests=false install \ + ruby-progressbar \ + ruby-tilt \ + asciidoctor ruby-asciidoctor-pdf \ docker.io jsonlint \ man jq curl ruby ruby-dev \ - gdb\ && apt-get autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + ENV FEELPP_DEP_INSTALL_PREFIX /usr/local diff --git a/feelpp-env/Dockerfile-debian-13 b/feelpp-env/Dockerfile-debian-13 new file mode 100644 index 000000000..e69de29bb diff --git a/feelpp-env/Dockerfile-fedora b/feelpp-env/Dockerfile-fedora index cbcf7d578..0f2d90d10 100644 --- a/feelpp-env/Dockerfile-fedora +++ b/feelpp-env/Dockerfile-fedora @@ -1,23 +1,122 @@ +# --- BuildKit auto platform args (injected by buildx) --- +ARG TARGETPLATFORM +ARG TARGETARCH +ARG TARGETOS +# --- Useful env defaults (baked per-arch) --- +ENV FEELPP_DEP_INSTALL_PREFIX=/usr/local \ + DNF_YUM_BACKEND=dnf5 -RUN dnf install -y redhat-lsb-core sudo emacs-nox clang cmake git ruby libcurl-devel jq\ - cln-devel \ - openmpi-devel \ - python3-devel \ - boost-devel boost-openmpi-devel \ - MUMPS-openmpi-devel metis-devel \ - petsc-devel petsc-openmpi-devel python3-petsc-openmpi \ - gmsh gmsh-devel hdf5-openmpi-devel \ - libzip-devel openssl-devel\ - python3-mpi4py-openmpi python3-sympy \ - curl jq openssl-devel libffi-devel python3 python3-virtualenv python3-devel python3-pip nodejs \ - sudo \ - && dnf clean all \ - && echo ". /etc/profile.d/modules.sh" >> /etc/profile \ - && echo "module load mpi/openmpi-x86_64" >> /etc/profile +# -------- System setup -------- +# Use bash -l for subsequent RUNs so /etc/profile.d gets sourced when needed +SHELL ["/bin/bash", "-l", "-c"] +RUN set -eux; \ + dnf -y update; \ + dnf -y install \ + sudo which tree ninja-build \ + clang cmake git ruby rubygem-bundler jq curl rsync \ + environment-modules openmpi openmpi-devel \ + python3 python3-devel python3-pip python3-virtualenv python3-sympy \ + python3-mpi4py-openmpi \ + boost-devel boost-openmpi-devel \ + MUMPS-openmpi-devel metis-devel \ + petsc-devel petsc-openmpi-devel python3-petsc-openmpi \ + gmsh gmsh-devel hdf5-openmpi-devel libzip-devel pugixml-devel \ + libcurl-devel cln-devel \ + openssl-devel libffi-devel \ + lsof procps-ng findutils file \ + nodejs \ + --setopt=install_weak_deps=False \ + --best --allowerasing; \ + dnf -y install redhat-lsb-core || dnf -y install redhat-lsb || true; \ + dnf clean all; \ + rm -rf /var/cache/dnf +# ---------------------------------------------------------------------------------- +# Open MPI Configuration +# +# The following environment variables configure how Open MPI operates within the container: +# +# 1. OMPI_MCA_pml: +# - Defines the point-to-point messaging layer. +# - Setting to "ob1" selects the basic, yet versatile, messaging layer. +# +# 2. OMPI_MCA_btl: +# - Specifies the Byte Transfer Layers (BTLs) for data movement. +# - "self,vader" enables both the self and vader BTLs. The "self" BTL handles +# loopback communication while "vader" is optimized for intranode communication. +# +# 3. OMPI_MCA_mtl: +# - Controls the Message Transfer Layers (MTLs). +# - The value "^ofi,psm2" disables the "ofi" and "psm2" modules to avoid conflicts +# and potentially enforce the use of the selected PML/BTL configuration. +# +# 4. OMPI_MCA_btl_vader_single_copy_mechanism: +# - Determines the mechanism used by the vader BTL for single-copy operations. +# - The "cma" value enforces the use of Cross Memory Attach (CMA) for efficient memory copying. +# +# These settings are chosen to optimize performance and ensure compatibility +# within the containerized environment based on Fedora. +# ---------------------------------------------------------------------------------- +ENV OMPI_MCA_pml=ob1 \ + OMPI_MCA_btl=self,vader \ + OMPI_MCA_mtl=^ofi,psm2 \ + OMPI_MCA_btl_vader_single_copy_mechanism=cma +# allow mpi as root +ENV OMPI_ALLOW_RUN_AS_ROOT=1 \ + OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 +# --- Make OpenMPI globally visible in ALL contexts (non-interactive builds, CI, etc.) +ENV PATH="/usr/lib64/openmpi/bin:${PATH}" +ENV LD_LIBRARY_PATH="/usr/lib64/openmpi/lib:${LD_LIBRARY_PATH}" +# -------- Shell environment helper: /etc/profile.d -------- +# - Source environment-modules if present +# - Load OpenMPI module whenever 'module' exists (not only interactive shells) +# - Leave PATH/LD_LIBRARY_PATH as-is (already set above); keep fallback just in case +RUN set -eux; \ + cat >/etc/profile.d/00-feelpp-env.sh <<'EOF' +# Feel++ base environment +# Source environment-modules (Modules or Lmod) if present +if [ -f /etc/profile.d/modules.sh ]; then + . /etc/profile.d/modules.sh +elif [ -f /usr/share/Modules/init/bash ]; then + . /usr/share/Modules/init/bash +fi + +# Load OpenMPI module whenever modules are available (non-fatal) +if type module >/dev/null 2>&1; then + module load mpi/openmpi-x86_64 2>/dev/null || true +fi + +# Fallback: ensure OpenMPI tools are visible even if modules weren't sourced +if ! command -v mpicc >/dev/null 2>&1; then + if [ -d /usr/lib64/openmpi/bin ]; then + export PATH="/usr/lib64/openmpi/bin:${PATH}" + fi + if [ -d /usr/lib64/openmpi/lib ]; then + export LD_LIBRARY_PATH="/usr/lib64/openmpi/lib:${LD_LIBRARY_PATH:-}" + fi +fi +EOF + +# -------- Optional: enable environment-modules in interactive bash -------- +RUN set -eux; \ + if ! grep -q '/etc/profile.d/modules.sh' /etc/bashrc 2>/dev/null; then \ + printf '\n# Enable environment-modules for interactive bash\n' >> /etc/bashrc; \ + printf '[ -f /etc/profile.d/modules.sh ] && . /etc/profile.d/modules.sh || true\n' >> /etc/bashrc; \ + fi + +# -------- Quick sanity checks (non-fatal) -------- +RUN set -eux; \ + echo; echo "=== OpenMPI sanity (non-fatal) ==="; \ + command -v mpicc && mpicc --version | head -n1 || true; \ + command -v mpirun && mpirun --version | head -n1 || true; \ + type module >/dev/null 2>&1 && module avail 2>/dev/null | head -n20 || true; \ + echo "==================================="; echo + +# Keep PATH nice +ENV PATH=/usr/local/bin:${PATH} \ No newline at end of file diff --git a/feelpp-env/Dockerfile-fedora-42 b/feelpp-env/Dockerfile-fedora-42 new file mode 100644 index 000000000..04c0ae430 --- /dev/null +++ b/feelpp-env/Dockerfile-fedora-42 @@ -0,0 +1,3 @@ +# create docker group to avoid failure later +# docker is not yet supported in fedora-37 +RUN groupadd docker diff --git a/feelpp-env/mkimg.sh b/feelpp-env/mkimg.sh index 564797c5f..ca6b2259d 100755 --- a/feelpp-env/mkimg.sh +++ b/feelpp-env/mkimg.sh @@ -1,53 +1,53 @@ -#!/bin/bash -set -e +#!/usr/bin/env bash +set -euo pipefail mkimg="$(basename "$0")" -from=debian:10 -cxx=clang++ -cc=clang -token= +from="debian:10" +cxx="clang++" +cc="clang" +token="" +install_altair="" +tag="" usage() { - echo >&2 "usage: $mkimg [-f fromos:fromtag] [-t tag] [-c c++ compiler] [-cc c compiler]" - echo >&2 " ie: $mkimg -f $from -t feelpp-env:19.10 -c clang++ -cc clang " - exit 1 + echo >&2 "usage: $mkimg [-f fromos:fromtag] [-t tag] [-c c++ compiler] [-cc c compiler] [-o token] [-a 0|1]" + echo >&2 " ex: $mkimg -f debian:13 -t feelpp-env:debian-13 -c clang++ -cc clang" + exit 1 } -fromos= -fromtag= -install_altair= - -tag= -while true; do - case "$1" in - -a|--altair) install_altair="$2" ; shift 2 ;; - -f|--from) from="$2" ; shift 2 ;; - -t|--tag) tag="$2" ; shift 2 ;; - -c|--cxx) cxx="$2" ; shift 2 ;; - -o|--token) token="$2" ; shift 2 ;; - -cc) cc="$2" ; shift 2 ;; - -h|--help) usage ;; - --) shift ; break ;; - esac +# ---- Parse args (no need for trailing --) ---- +while (($#)); do + case "$1" in + -a|--altair) install_altair="${2:-}"; shift 2 ;; + -f|--from) from="${2:-}"; shift 2 ;; + -t|--tag) tag="${2:-}"; shift 2 ;; + -c|--cxx) cxx="${2:-}"; shift 2 ;; + -cc) cc="${2:-}"; shift 2 ;; + -o|--token) token="${2:-}"; shift 2 ;; + -h|--help) usage ;; + --) shift; break ;; + *) echo "Unknown option: $1" >&2; usage ;; + esac done -splitfrom=(`echo "$from" | tr ":" "\n"`) -fromos=${splitfrom[0]} -fromtag=${splitfrom[1]} - -#echo >&2 "directory $fromos-$fromtag" -dir=$fromos-$fromtag-$cxx -if [ ! -d "$dir" ]; then - #(set -x; mkdir "$dir") - mkdir "$dir" +# ---- Split FROM into os:tag safely ---- +if [[ "$from" != *:* ]]; then + echo "ERROR: --from/-f must be of the form os:tag (got '$from')" >&2 + exit 1 fi - -#echo >&2 "+ cat > '$dir/Dockerfile'" -cat > "$dir/Dockerfile" < - +fromos="${from%%:*}" +fromtag="${from#*:}" + +# ---- Build directory ---- +dir="${fromos}-${fromtag}-${cxx}" +mkdir -p "$dir" + +# ---- Start Dockerfile ---- +{ + echo "FROM $from" + echo 'LABEL maintainer="Feel++ Support "' + cat < "$dir/Dockerfile" + +# ---- Concatenate optional fragments if present ---- +append_if_exists() { + local f="$1" + if [[ -f "$f" ]]; then + { cat "$f"; echo; } >> "$dir/Dockerfile" + fi +} -if test -f Dockerfile-$fromos; then - ( cat "Dockerfile-$fromos"; echo ) >> "$dir/Dockerfile" -fi -if test -f Dockerfile-$fromos-$fromtag; then - ( cat "Dockerfile-$fromos-$fromtag"; echo ) >> "$dir/Dockerfile" -fi +append_if_exists "Dockerfile-${fromos}" +append_if_exists "Dockerfile-${fromos}-${fromtag}" -if test $fromos != "fedora" -a $fromtag != "24.04"; then - if test -f Dockerfile-deb-om-$fromos-$fromtag; then - ( cat "Dockerfile-deb-om-$fromos-$fromtag"; echo ) >> "$dir/Dockerfile" - else - ( cat Dockerfile-deb-om; echo ) >> "$dir/Dockerfile" - fi +# Include OpenMPI / deb-om layer for all but Fedora and Ubuntu 24.04 +if [[ "$fromos" != "fedora" && "$fromtag" != "24.04" && "$fromtag" != "13" ]]; then + if [[ -f "Dockerfile-deb-om-${fromos}-${fromtag}" ]]; then + append_if_exists "Dockerfile-deb-om-${fromos}-${fromtag}" + else + append_if_exists "Dockerfile-deb-om" + fi fi -if test $fromtag = "20.04"; then - ( cat Dockerfile-cmake; echo ) >> "$dir/Dockerfile" +# CMake layer only for Ubuntu 20.04 (legacy) +if [[ "$fromtag" == "20.04" ]]; then + append_if_exists "Dockerfile-cmake" fi -#cat Dockerfile-openmpi >> "$dir/Dockerfile" - -#cat Dockerfile-boost >> "$dir/Dockerfile" - -#cat Dockerfile-petsc-slepc >> "$dir/Dockerfile" - -#if [ "x$install_altair" = "x1" ]; then -#cat Dockerfile-altair >> "$dir/Dockerfile" -#fi +append_if_exists "Dockerfile-feelpp" -#cat Dockerfile-paraview-$fromos-$fromtag >> "$dir/Dockerfile" +# Final ENV +echo 'ENV PATH=/usr/local/bin:$PATH' >> "$dir/Dockerfile" -#cat Dockerfile-deb-mongodb-$fromos-$fromtag >> "$dir/Dockerfile" - -#cat Dockerfile-openturns >> "$dir/Dockerfile" - -#cat Dockerfile-deb-sympy >> "$dir/Dockerfile" - -#cat Dockerfile-deb-mpi4py >> "$dir/Dockerfile" - -#cat Dockerfile-fmi >> "$dir/Dockerfile" - -( cat "Dockerfile-$fromos-buildkite"; echo ) >> "$dir/Dockerfile" - -( cat Dockerfile-feelpp; echo ) >> "$dir/Dockerfile" - -cat >> "$dir/Dockerfile" < Dockerfile: ${dir}/Dockerfile" >&2 +echo "$dir" \ No newline at end of file