Skip to content

Commit

Permalink
Update Dockerfile (#367)
Browse files Browse the repository at this point in the history
* Update Dockerfile

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update Dockerfile

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update Dockerfile

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
PythonFZ and pre-commit-ci[bot] authored Dec 4, 2024
1 parent e280c03 commit 4217bd1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ jobs:
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
35 changes: 21 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
ARG MAKE_JOBS="4"
# Base image
ARG PYTHON_VERSION="3.11"
FROM python:${PYTHON_VERSION}

FROM python:3.11
# Build arguments for dynamic version configuration
ARG MAKE_JOBS="4"
ARG CP2K_VERSION="v2024.3"
ARG PACKMOL_VERSION="20.15.3"
ARG GROMACS_VERSION="2024.4"

# Set environment variables for non-interactive installs
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="/opt/tools/cp2k/exe/local:/opt/tools/packmol-20.15.3:/opt/tools/gromacs-2024.4/build/bin:$PATH"
ENV PATH="/opt/tools/cp2k/exe/local:/opt/tools/packmol-${PACKMOL_VERSION}:/opt/tools/gromacs-${GROMACS_VERSION}/build/bin:$PATH"


# Update and install essential packages
RUN apt-get update -y && apt-get install -y --no-install-recommends \
Expand All @@ -13,7 +20,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \

# Install CP2K
WORKDIR /opt/tools
RUN git clone -b v2024.1 --recursive https://github.com/cp2k/cp2k.git cp2k && \
RUN git clone -b ${CP2K_VERSION} --recursive https://github.com/cp2k/cp2k.git cp2k && \
cd cp2k/tools/toolchain && ./install_cp2k_toolchain.sh --with-openmpi && \
cp /opt/tools/cp2k/tools/toolchain/install/arch/* /opt/tools/cp2k/arch/ && \
cd /opt/tools/cp2k && \
Expand All @@ -22,33 +29,33 @@ RUN git clone -b v2024.1 --recursive https://github.com/cp2k/cp2k.git cp2k && \

# Install PACKMOL
WORKDIR /opt/tools
RUN wget https://github.com/m3g/packmol/archive/refs/tags/v20.15.3.tar.gz && \
tar -xzvf v20.15.3.tar.gz && \
cd packmol-20.15.3 && make && \
rm /opt/tools/v20.15.3.tar.gz
RUN wget https://github.com/m3g/packmol/archive/refs/tags/v${PACKMOL_VERSION}.tar.gz && \
tar -xzvf v${PACKMOL_VERSION}.tar.gz && \
cd packmol-${PACKMOL_VERSION} && make && \
rm /opt/tools/v${PACKMOL_VERSION}.tar.gz

# Install GROMACS
WORKDIR /opt/tools
RUN wget https://ftp.gromacs.org/gromacs/gromacs-2024.4.tar.gz && \
tar xfz gromacs-2024.4.tar.gz && \
cd gromacs-2024.4 && \
RUN wget https://ftp.gromacs.org/gromacs/gromacs-${GROMACS_VERSION}.tar.gz && \
tar xfz gromacs-${GROMACS_VERSION}.tar.gz && \
cd gromacs-${GROMACS_VERSION} && \
mkdir build && cd build && \
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON && \
make -j ${MAKE_JOBS} && make check && make install && \
rm /opt/tools/gromacs-2024.4.tar.gz

rm /opt/tools/gromacs-${GROMACS_VERSION}.tar.gz

# Install additional Python packages
RUN pip install dvc-s3 jax[cuda12] MDAnalysis pyedr apax


# Install IPSuite
WORKDIR /opt/tools/ipsuite
COPY ./ ./
RUN pip install .

# Create a working directory
RUN mkdir -m 1777 /work
RUN git config --global --add safe.directory /work

WORKDIR /work

ENTRYPOINT [ "/bin/bash" ]

0 comments on commit 4217bd1

Please sign in to comment.