1 # Provide an easy-to-reproduce environment in which to test full Python functionality.
3 # Run with default command or specify one of the scripts to be executed through the entrypoint.
5 # docker run --rm -ti gmxapi/ci-mpich:fr1 integrationtest
9 # Requires Docker 17.05 or higher.
11 # Note to maintainers:
12 # Build from the GROMACS image at the current fork point. Tag with the feature
13 # name or the current revision.
15 # FORKPOINT=$(git show -s --pretty=format:"%h" `git merge-base gerrit_master HEAD`)
16 # REF=`git show -s --pretty=format:"%h"`
19 # docker build -t gmxapi/ci-mpich:${REF} --build-arg REF=${FORKPOINT} -f ci.dockerfile ..
23 # Use gromacs installation from gmxapi/gromacs image
27 FROM gmxapi/gromacs-mpich:$REF as gromacs
28 # This intermediate is necessary because the COPY command does not support syntax like the following:
29 #COPY --from=gmxapi/gromacs:$REF /usr/local/gromacs /usr/local/gromacs
31 FROM gmxapi/gromacs-dependencies-mpich
33 RUN apt-get update && \
34 apt-get -yq --no-install-suggests --no-install-recommends install \
38 rm -rf /var/lib/apt/lists/*
40 # TODO: Use non-system Python installations for explicit version coverage.
41 # Consider pyenv for generic management of Python environment.
43 ENV CMAKE_ROOT /usr/local/cmake
44 ENV PATH $CMAKE_ROOT/bin:$PATH
46 RUN groupadd -r testing && useradd -m -s /bin/bash -g testing testing
50 ENV VENV /home/testing/venv
51 RUN python3 -m venv $VENV
52 RUN . $VENV/bin/activate && \
53 pip install --no-cache-dir --upgrade pip setuptools
55 ADD --chown=testing:testing requirements-*.txt /home/testing/gmxapi/
57 RUN . $VENV/bin/activate && \
58 pip install --no-cache-dir -r /home/testing/gmxapi/requirements-test.txt
60 COPY --from=gromacs $CMAKE_ROOT $CMAKE_ROOT
61 COPY --from=gromacs /usr/local/gromacs /usr/local/gromacs
63 ADD --chown=testing:testing src /home/testing/gmxapi/src
64 ADD --chown=testing:testing src/gmxapi /home/testing/gmxapi/src/gmxapi
66 RUN . $VENV/bin/activate && \
67 . /usr/local/gromacs/bin/GMXRC && \
68 (cd $HOME/gmxapi/src && \
69 pip install --no-cache-dir . \
72 ADD --chown=testing:testing src/test /home/testing/gmxapi/test
73 ADD scripts /docker_entry_points
74 ADD --chown=testing:testing test /home/testing/test
76 ADD --chown=testing:testing sample_restraint /home/testing/sample_restraint
78 # TODO: (#3027) Get googletest sources locally.
79 RUN . $VENV/bin/activate && \
80 . /usr/local/gromacs/bin/GMXRC && \
81 (cd $HOME/sample_restraint && \
85 -DDOWNLOAD_GOOGLETEST=ON \
86 -DGMXAPI_EXTENSION_DOWNLOAD_PYBIND=ON && \
92 # TODO: this can be in the root user section above once it is stable
93 COPY docker/entrypoint.sh /
95 ENTRYPOINT ["/entrypoint.sh"]
99 # MPI tests can be run in this container without requiring MPI on the host.
100 # (We suggest running your docker engine with multiple CPU cores allocated.)
101 # docker run --rm -t gmxapi/ci:${REF} /home/testing/scripts/run_full_mpi.sh
102 # We should also try tests with an MPI-connected set of docker containers.
104 # To be able to step through with gdb, run with something like the following, replacing
105 # 'imagename' with the name of the docker image built with this recipe.
106 # docker run --rm -ti --security-opt seccomp=unconfined imagename bash