diff --git a/.github/actions/upstream-test/action.yml b/.github/actions/upstream-test/action.yml index 26802f269..76e251b43 100644 --- a/.github/actions/upstream-test/action.yml +++ b/.github/actions/upstream-test/action.yml @@ -20,7 +20,7 @@ inputs: hdf5_version: description: Version of HDF5 required: false - default: 1.14.3 + default: hdf5_1_14_3 moab_version: description: Version of MOAB required: false diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index 2a23b7c4a..39baed063 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -23,7 +23,7 @@ jobs: clang, ] hdf5_version : [ - 1.14.3, + hdf5_1_14_3, ] moab_version : [ 5.4.1, @@ -31,8 +31,8 @@ jobs: ] geant4_version : [ off, - 10.7.4, - 11.1.2 + v10.7.4, + v11.2.1, ] double_down_version : [ off, @@ -105,7 +105,7 @@ jobs: clang, ] hdf5_version : [ - 1.14.3, + hdf5_1_14_3, ] moab_version : [ 5.4.1, @@ -113,8 +113,8 @@ jobs: ] geant4_version : [ off, - 10.7.4, - 11.1.2 + v10.7.4, + v11.2.1, ] double_down_version : [ off, diff --git a/.github/workflows/linux_upstream_test_geant4.yml b/.github/workflows/linux_upstream_test_geant4.yml index 514351067..ddc252bc9 100644 --- a/.github/workflows/linux_upstream_test_geant4.yml +++ b/.github/workflows/linux_upstream_test_geant4.yml @@ -1,4 +1,4 @@ -name: Test against newer Geant4 on PR merge +name: Test against Geant4 development branch (master) on PR merge on: # allows us to run workflows manually @@ -27,4 +27,4 @@ jobs: uses: ./.github/actions/upstream-test with: token: ${{ secrets.GITHUB_TOKEN }} - geant_version: 11.1.2 + geant_version: master diff --git a/.github/workflows/linux_upstream_test_hdf5.yml b/.github/workflows/linux_upstream_test_hdf5.yml index d31707d3d..af0a9eca4 100644 --- a/.github/workflows/linux_upstream_test_hdf5.yml +++ b/.github/workflows/linux_upstream_test_hdf5.yml @@ -1,4 +1,4 @@ -name: Test against newer hdf5 on PR merge +name: Test against HDF5 development branch on PR merge on: # allows us to run workflows manually @@ -28,4 +28,4 @@ jobs: uses: ./.github/actions/upstream-test with: token: ${{ secrets.GITHUB_TOKEN }} - hdf5_version: 1.14.3 + hdf5_version: develop diff --git a/CI/Dockerfile b/CI/Dockerfile index 2d19dd9e6..38060c260 100644 --- a/CI/Dockerfile +++ b/CI/Dockerfile @@ -5,19 +5,20 @@ # Global ARGS set before the first build stage are accessable by all build stages ARG UBUNTU_VERSION=22.04 -ARG HDF5_VERSION=1.14.3 -ARG EMBREE_VERSION=v4.0.1 -# Setting GEANT4_VERSION=off will disable GEANT4 build -ARG GEANT4_VERSION=11.1.2 +ARG HDF5_VERSION=hdf5_1_14_3 ARG MOAB_VERSION=5.5.1 +# Setting GEANT4_VERSION=off will disable GEANT4 build +ARG GEANT4_VERSION=v11.2.1 # Setting DOUBLE_DOWN_VERSION=off will disable DOUBLE_DOWN build ARG DOUBLE_DOWN_VERSION=v1.1.0 -ARG CI_JOBS=4 +# Setting DOUBLE_DOWN_VERSION=off will disable EMBREE build +ARG EMBREE_VERSION=v4.0.1 -ARG build_dir=/root/build_dir -ARG install_dir=/root/opt +ARG BUILD_DIR=/root/build +ARG INSTALL_DIR=/opt ARG COMPILER=gcc +ARG CI_JOBS=4 FROM ubuntu:${UBUNTU_VERSION} AS base @@ -30,50 +31,42 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # Install Build Dependencies RUN apt-get update --yes && \ - apt-get install --yes \ + apt-get install --yes --no-install-recommends \ git \ - wget \ + ca-certificates \ autoconf \ - clang \ + make \ cmake \ g++ \ - gcc \ + clang \ gfortran \ - libtool \ - libeigen3-dev\ python3 \ - python3-pip \ - python3-numpy \ - python3-setuptools \ - python3-dev \ libpython3-dev \ - software-properties-common && \ - apt-get clean && rm -rf /var/lib/apt/lists/* && \ - update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \ - update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 && \ - pip install "cython<3"; + zlib1g-dev \ + libeigen3-dev && \ + apt-get clean && rm -rf /var/lib/apt/lists/*; -ARG build_dir -ARG install_dir +ARG BUILD_DIR +ARG INSTALL_DIR -ENV build_dir=${build_dir} -ENV install_dir=${install_dir} +ENV BUILD_DIR=${BUILD_DIR} +ENV INSTALL_DIR=${INSTALL_DIR} -FROM base as compiler-gcc +FROM base AS compiler-gcc ENV CC=gcc ENV CXX=g++ -FROM base as compiler-clang +FROM base AS compiler-clang ENV CC=clang ENV CXX=clang++ -FROM compiler-${COMPILER} as external_deps +FROM compiler-${COMPILER} AS external_deps # accessing gloabl ARGs in build stage -ARG install_dir -ARG build_dir +ARG INSTALL_DIR +ARG BUILD_DIR ARG CI_JOBS ARG CXX ARG CC @@ -81,17 +74,17 @@ ARG DOUBLE_DOWN_VERSION ARG EMBREE_VERSION ARG GEANT4_VERSION -ENV embree_install_dir=${install_dir}/embree -ENV embree_build_dir=${build_dir}/embree +ENV EMBREE_INSTALL_DIR=${INSTALL_DIR}/Embree +ENV EMBREE_BUILD_DIR=${BUILD_DIR}/Embree # Clone and install Embree RUN if [ "${DOUBLE_DOWN_VERSION}" != "off" ]; then \ - mkdir -p ${embree_build_dir}/build && \ - cd ${embree_build_dir} && \ - git clone -b ${EMBREE_VERSION} https://github.com/embree/embree && \ + mkdir -p ${EMBREE_BUILD_DIR}/build && \ + cd ${EMBREE_BUILD_DIR} && \ + git clone -b ${EMBREE_VERSION} --depth 1 https://github.com/embree/embree.git && \ cd build && \ cmake ../embree \ - -DCMAKE_INSTALL_PREFIX=${embree_install_dir} \ + -DCMAKE_INSTALL_PREFIX=${EMBREE_INSTALL_DIR} \ -DEMBREE_TASKING_SYSTEM=INTERNAL \ -DEMBREE_ISPC_SUPPORT=OFF \ -DEMBREE_TUTORIALS=OFF \ @@ -99,24 +92,21 @@ RUN if [ "${DOUBLE_DOWN_VERSION}" != "off" ]; then \ make -j${CI_JOBS} && \ make -j${CI_JOBS} install && \ cd && \ - rm -rf ${embree_build_dir}; \ + rm -rf ${EMBREE_BUILD_DIR}; \ fi -ENV geant4_basename=geant4-v${GEANT4_VERSION} -ENV geant4_tarball=${geant4_basename}.tar.gz -ENV geant4_build_dir=${build_dir}/geant4 -ENV geant4_install_dir=${install_dir}/geant4 +ENV GEANT4_BUILD_DIR=${BUILD_DIR}/geant4 +ENV GEANT4_INSTALL_DIR=${INSTALL_DIR}/geant4 RUN if [ "${GEANT4_VERSION}" != "off" ]; then \ - mkdir -p ${geant4_build_dir}/build && \ - cd ${geant4_build_dir} && \ - wget https://gitlab.cern.ch/geant4/geant4/-/archive/v${GEANT4_VERSION}/${geant4_tarball} --no-check-certificate && \ - tar -xzf ${geant4_tarball} && \ + mkdir -p ${GEANT4_BUILD_DIR}/build && \ + cd ${GEANT4_BUILD_DIR} && \ + git clone -b ${GEANT4_VERSION} --depth 1 https://gitlab.cern.ch/geant4/geant4.git && \ cd build && \ - cmake ../${geant4_basename} \ - -DCMAKE_INSTALL_RPATH=${geant4_install_dir}/lib \ - -DCMAKE_INSTALL_PREFIX=${geant4_install_dir} \ + cmake ../geant4 \ + -DCMAKE_INSTALL_RPATH=${GEANT4_INSTALL_DIR}/lib \ + -DCMAKE_INSTALL_PREFIX=${GEANT4_INSTALL_DIR} \ -DGEANT4_USE_SYSTEM_EXPAT=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_COMPILER=${CXX} \ @@ -125,44 +115,42 @@ RUN if [ "${GEANT4_VERSION}" != "off" ]; then \ make -j${CI_JOBS} && \ make install && \ cd && \ - rm -rf ${geant4_build_dir}; \ + rm -rf ${GEANT4_BUILD_DIR}; \ fi FROM external_deps AS hdf5 # accessing gloabl ARGs in build stage -ARG install_dir -ARG build_dir +ARG INSTALL_DIR +ARG BUILD_DIR ARG CI_JOBS ARG CXX ARG CC ARG HDF5_VERSION -ENV hdf5_build_dir=${build_dir}/hdf5 -ENV hdf5_install_dir=${install_dir}/hdf5 +ENV HDF5_BUILD_DIR=${BUILD_DIR}/hdf5 +ENV HDF5_INSTALL_DIR=${INSTALL_DIR}/hdf5 -RUN mkdir -p ${hdf5_build_dir}/build && \ - cd ${hdf5_build_dir} && \ - export HDF5_VERSION_major=`python -c "print('.'.join('${HDF5_VERSION}'.split('.')[:-1]))"` && \ - wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION_major}/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz && \ - tar -xzf hdf5-${HDF5_VERSION}.tar.gz && \ +RUN mkdir -p ${HDF5_BUILD_DIR}/build && \ + cd ${HDF5_BUILD_DIR} && \ + git clone -b ${HDF5_VERSION} --depth 1 https://github.com/HDFGroup/hdf5.git && \ cd build && \ - ../hdf5-${HDF5_VERSION}/configure --enable-shared \ - --prefix=${hdf5_install_dir} \ + ../hdf5/configure --enable-shared \ + --prefix=${HDF5_INSTALL_DIR} \ CXX=${CXX} \ CC=${CC} && \ make -j${CI_JOBS} && \ make install && \ cd && \ - rm -rf ${hdf5_build_dir} + rm -rf ${HDF5_BUILD_DIR} FROM hdf5 AS moab # accessing gloabl ARGs in build stage -ARG install_dir -ARG build_dir +ARG INSTALL_DIR +ARG BUILD_DIR ARG CI_JOBS ARG CXX ARG CC @@ -171,77 +159,76 @@ ARG DOUBLE_DOWN_VERSION # Set MOAB env variable -ENV moab_build_dir=${build_dir}/moab -ENV moab_install_dir=${install_dir}/moab - +ENV MOAB_BUILD_DIR=${BUILD_DIR}/moab +ENV MOAB_INSTALL_DIR=${INSTALL_DIR}/moab -RUN mkdir -p ${moab_build_dir}/build && \ - cd ${moab_build_dir} && \ - git clone -b ${MOAB_VERSION} --depth 1 https://bitbucket.org/fathomteam/moab && \ +RUN mkdir -p ${MOAB_BUILD_DIR}/build && \ + cd ${MOAB_BUILD_DIR} && \ + git clone -b ${MOAB_VERSION} --depth 1 https://bitbucket.org/fathomteam/moab.git && \ cd build && \ cmake ../moab \ - -DCMAKE_INSTALL_RPATH=${hdf5_install_dir}/lib:${moab_install_dir}/lib \ + -DCMAKE_INSTALL_RPATH=${HDF5_INSTALL_DIR}/lib:${MOAB_INSTALL_DIR}/lib \ -DCMAKE_BUILD_TYPE=Release \ - -DENABLE_HDF5=ON -DHDF5_ROOT=${hdf5_install_dir} \ - -DCMAKE_INSTALL_PREFIX=${moab_install_dir} \ + -DENABLE_HDF5=ON \ + -DHDF5_ROOT=${HDF5_INSTALL_DIR} \ + -DCMAKE_INSTALL_PREFIX=${MOAB_INSTALL_DIR} \ -DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_C_COMPILER=${CC} \ -DENABLE_BLASLAPACK=OFF \ -DBUILD_SHARED_LIBS=ON \ -DENABLE_FORTRAN=OFF \ - -DENABLE_PYMOAB=ON && \ + -DENABLE_PYMOAB=OFF && \ make -j${CI_JOBS} && \ make install && \ cd && \ - rm -rf ${moab_build_dir} + rm -rf ${MOAB_BUILD_DIR} -ENV double_down_build_dir=${build_dir}/double-down -ENV double_down_install_dir=${install_dir}/double-down +ENV DOUBLE_DOWN_BUILD_DIR=${BUILD_DIR}/double-down +ENV DOUBLE_DOWN_INSTALL_DIR=${INSTALL_DIR}/double-down # Clone and install Double-Down # Performed after moab and embree install as double-down requires moab and embree RUN if [ "${DOUBLE_DOWN_VERSION}" != "off" ]; then \ - mkdir -p ${double_down_build_dir}/build && \ - cd ${double_down_build_dir} && \ + mkdir -p ${DOUBLE_DOWN_BUILD_DIR}/build && \ + cd ${DOUBLE_DOWN_BUILD_DIR} && \ git clone -b ${DOUBLE_DOWN_VERSION} --depth 1 https://github.com/pshriwise/double-down.git && \ cd build && \ cmake ../double-down \ - -DMOAB_DIR=${moab_install_dir} \ - -DCMAKE_INSTALL_PREFIX=${double_down_install_dir} \ - -DEMBREE_DIR=${embree_install_dir} && \ + -DMOAB_DIR=${MOAB_INSTALL_DIR} \ + -DCMAKE_INSTALL_PREFIX=${DOUBLE_DOWN_INSTALL_DIR} \ + -DEMBREE_DIR=${EMBREE_INSTALL_DIR} && \ make -j${CI_JOBS} && \ make -j${CI_JOBS} install && \ cd && \ - rm -rf ${double_down_build_dir}; \ + rm -rf ${DOUBLE_DOWN_BUILD_DIR}; \ fi -FROM moab as dagmc +FROM moab AS dagmc # accessing gloabl ARGs in build stage -ARG install_dir -ARG build_dir +ARG INSTALL_DIR +ARG BUILD_DIR ARG CXX ARG CC ARG GEANT4_VERSION ARG DOUBLE_DOWN_VERSION -ENV dagmc_build_dir=${build_dir}/dagmc -ENV dagmc_install_dir=${install_dir}/dagmc +ENV DAGMC_BUILD_DIR=${BUILD_DIR}/dagmc +ENV DAGMC_INSTALL_DIR=${INSTALL_DIR}/dagmc # copies the enitre git repo into the dockerfile to ensure the submodules can also be found -RUN mkdir -p ${dagmc_build_dir}/build -COPY . ${dagmc_build_dir} -RUN cd ${dagmc_build_dir} && git submodule update --init +COPY . ${DAGMC_BUILD_DIR} -RUN mkdir -p ${dagmc_build_dir}/build && \ - cd ${dagmc_build_dir} && \ +RUN mkdir -p ${DAGMC_BUILD_DIR}/build && \ + cd ${DAGMC_BUILD_DIR} && \ + git submodule update --init && \ cd build && \ cmake ../ \ - -DMOAB_DIR=${moab_install_dir} \ + -DMOAB_DIR=${MOAB_INSTALL_DIR} \ -DBUILD_GEANT4=$([ "${GEANT4_VERSION}" != "off" ] && echo "ON" || echo "OFF") \ - -DGEANT4_DIR=${geant4_install_dir} \ + -DGEANT4_DIR=${GEANT4_INSTALL_DIR} \ -DBUILD_CI_TESTS=ON \ # reg tests disabled see issue https://github.com/svalinn/DAGMC/issues/858 -DBUILD_MW_REG_TESTS=OFF \ @@ -250,28 +237,44 @@ RUN mkdir -p ${dagmc_build_dir}/build && \ -DCMAKE_C_COMPILER=${CC} \ -DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_Fortran_COMPILER=gfortran \ - -DCMAKE_INSTALL_PREFIX=${dagmc_install_dir} \ + -DCMAKE_INSTALL_PREFIX=${DAGMC_INSTALL_DIR} \ -DDOUBLE_DOWN=$([ "${DOUBLE_DOWN_VERSION}" != "off" ] && echo "ON" || echo "OFF") \ - -Ddd_ROOT=${double_down_install_dir} && \ + -Ddd_ROOT=${DOUBLE_DOWN_INSTALL_DIR} && \ make -j${CI_JOBS} && \ make install -FROM dagmc as dagmc_test +FROM dagmc AS dagmc_test -ENV dagmc_build_dir=${build_dir}/dagmc -ENV dagmc_install_dir=${install_dir}/dagmc +ENV DAGMC_BUILD_DIR=${BUILD_DIR}/dagmc +ENV DAGMC_INSTALL_DIR=${INSTALL_DIR}/dagmc # Test DAGMC executables -RUN cd ${dagmc_build_dir}/build && \ - PATH=${dagmc_install_dir}/bin:$PATH CTEST_OUTPUT_ON_FAILURE=1 make test +RUN cd ${DAGMC_BUILD_DIR}/build && \ + PATH=${DAGMC_INSTALL_DIR}/bin:$PATH CTEST_OUTPUT_ON_FAILURE=1 make test # clean out config test directory for next build -RUN cd ${dagmc_build_dir} && \ +RUN cd ${DAGMC_BUILD_DIR} && \ git clean -dxf . # Test DAGMC CMake configuration file -RUN cd ${dagmc_build_dir}/cmake/test_config && \ - cmake . -DDAGMC_ROOT=${dagmc_install_dir} && \ +RUN cd ${DAGMC_BUILD_DIR}/cmake/test_config && \ + cmake . -DDAGMC_ROOT=${DAGMC_INSTALL_DIR} && \ CTEST_OUTPUT_ON_FAILURE=1 make all test +FROM scratch AS binaries + +ARG INSTALL_DIR + +COPY --from=dagmc_test ${INSTALL_DIR} ${INSTALL_DIR} + +ENV PATH=${DAGMC_INSTALL_DIR}/bin:$PATH +ENV PATH=${MOAB_INSTALL_DIR}/bin:$PATH +ENV PATH=${EMBREE_INSTALL_DIR}/bin:$PATH +ENV PATH=${DOUBLE_DOWN_INSTALL_DIR}/bin:$PATH +ENV PATH=${HDF5_INSTALL_DIR}/bin:$PATH +ENV PATH=${GEANT4_INSTALL_DIR}/bin:$PATH + +WORKDIR ${INSTALL_DIR} + +ENTRYPOINT ["/bin/bash"] diff --git a/doc/CHANGELOG.rst b/doc/CHANGELOG.rst index ab2d8cf1d..d2689aaff 100644 --- a/doc/CHANGELOG.rst +++ b/doc/CHANGELOG.rst @@ -16,6 +16,7 @@ Next version * Simplify Housekeeping Process for DAGMC (#943) * Allow Double Down v1.1.0 Installation in Dockerfile (#929 #944 #949) * Inline documentation improvements (#945) + * Streamline dependencies of docker CI images (#951) v3.2.3 ====================