Commit 1ff318e1 authored by Hang Hu's avatar Hang Hu Committed by Andrew Wildman
Browse files

Add generation of Docker images to CI pipeline

parent d22f15ea
.git
*.*.swp
*build*
external/mxx
external/cxxblacs
external/libint2/include
external/libint2/lib
external/libint2/share
external/libint2/src
external/libint2/tmp
external/openblas/include
external/openblas/lib
external/openblas/src
external/openblas/tmp
external/openblas/bin
external/libxc/include
external/libxc/bin
external/libxc/lib
external/libxc/share
external/libxc/src
external/libxc/tmp
doc
stages:
- build
build_docker_images:
stage: build
only:
- master
- docker
before_script:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
script:
- export CQ_VERSION=$(grep "project(ChronusQ" -A 7 CMakeLists.txt | grep "VERSION" | sed 's/ \+VERSION //')
- docker build -t uwligroup/chronusq:$CQ_VERSION .
- docker push uwligroup/chronusq:$CQ_VERSION
- docker tag uwligroup/chronusq:$CQ_VERSION uwligroup/chronusq:latest
- docker push uwligroup/chronusq:latest
after_script:
- docker logout
build_intel:
stage: build
artifacts:
......
FROM centos:7 AS compile_stage
# Container system setting
RUN yum -y update && \
yum -y install centos-release-scl scl-utils epel-release wget make git patch && \
yum-config-manager --enable epel
# Install CQ dependency
## install gcc, g++ and gfortran
RUN yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-gcc-gfortran
SHELL ["/bin/scl", "enable", "devtoolset-8"]
## install cmake,
RUN wget -qO- "https://cmake.org/files/v3.18/cmake-3.18.2-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
## install eigen3 thru epel
RUN yum -y install eigen3
ARG PACKAGE_INSTALL_PATH="/usr/local"
### install hdf5
WORKDIR /opt/
RUN wget -q "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/CMake-hdf5-1.12.0.tar.gz" && \
tar -xzf CMake-hdf5-1.12.0.tar.gz && \
rm CMake-hdf5-1.12.0.tar.gz && \
cd CMake-hdf5-1.12.0 && \
tar -xzf SZip.tar.gz && \
tar -xzf ZLib.tar.gz && \
cd /opt/CMake-hdf5-1.12.0/SZip && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=$PACKAGE_INSTALL_PATH .. && cmake --build . --target install && \
cd /opt/CMake-hdf5-1.12.0/ZLib && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=$PACKAGE_INSTALL_PATH .. && cmake --build . --target install && \
cd /opt/CMake-hdf5-1.12.0 && ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix,INSTALLDIR=$PACKAGE_INSTALL_PATH -C Release -V -O hdf5.log && \
cd build && cmake --build . --target install && \
cd /opt && rm -rf CMake-hdf5-1.12.0
# Compile libint2 seperately
WORKDIR /opt/
RUN git clone https://urania.chem.washington.edu/chronusq/libint-cq.git && \
cd /opt/libint-cq/ && \
mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=$PACKAGE_INSTALL_PATH .. && \
cmake --build . --target install -j 5 && \
cd /opt/ && rm -rf libint-cq
# Compile chronusq
COPY . /opt/chronusq_public/
WORKDIR /opt/chronusq_public/
RUN mkdir build && cd build && cmake -DOPENBLAS_DYNAMIC_ARCH=ON -DCMAKE_INSTALL_PREFIX=$PACKAGE_INSTALL_PATH .. && \
cmake --build . --target install -j 5 && \
cd /opt/chronusq_public/ && rm -rf build && rm -rf external
# Copy chornusq to a lighter container
FROM alpine:3.12
COPY --from=compile_stage /opt/chronusq_public/basis /opt/chronusq_public/basis
COPY --from=compile_stage /lib64/ /lib64/
COPY --from=compile_stage /usr/local/lib/libhdf5* /lib64/
COPY --from=compile_stage /usr/local/bin/chronusq /usr/bin/
WORKDIR /home/chronusq/
ENTRYPOINT ["chronusq"]
......@@ -102,7 +102,10 @@ if( CQ_NEED_OPENBLAS )
message( STATUS "---> Allowing OpenBLAS to determine CPU TARGET" )
set(OPENBLAS_BUILD_COMMAND make -j2)
endif()
If(OPENBLAS_DYNAMIC_ARCH)
message(" Turn On Dynamic_ARCH for OpenBlas")
set(OPENBLAS_BUILD_COMMAND ${OPENBLAS_BUILD_COMMAND} DYNAMIC_ARCH=1)
endif()
ExternalProject_Add(openblas
PREFIX ${OPENBLAS_PREFIX}
GIT_REPOSITORY "https://github.com/xianyi/OpenBLAS.git"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment