Commit 3b1e551c authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fix required tests module for networkx

parent 4bb1c0d1
Pipeline #37289 failed with stages
in 4 minutes and 1 second
......@@ -20,15 +20,16 @@
# The dockerfile is multistaged to use a fat, more convinient build image and
# copy only necessities to a slim final image
FROM alpine:3.6
RUN apk --no-cache --update-cache --virtual=.build-dependencies add g++ gfortran file binutils musl-dev python3-dev openblas-dev libstdc++ openblas make
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN python -m ensurepip
RUN ln -s /usr/bin/pip3 /usr/bin/pip
# We use slim for the final image
FROM python:3.6-slim as final
# First, build everything in a build image
FROM python:3.6-stretch as build
# Make will be necessary to build the docs with sphynx
RUN apt-get update && apt-get install -y make
RUN mkdir /install
WORKDIR /install
# We also install the -dev dependencies, to use this image for test and qa
COPY requirements-dev.txt requirements-dev.txt
RUN pip install -r requirements-dev.txt
......@@ -36,25 +37,34 @@ COPY requirements-dep.txt requirements-dep.txt
RUN pip install -r requirements-dep.txt
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
# Use docker build --build-args CACHEBUST=2 to not cache this (e.g. when you know deps have changed)
ARG CACHEBUST=1
COPY nomad/dependencies.py /install/nomad/dependencies.py
COPY nomad/config.py /install/nomad/config.py
RUN python nomad/dependencies.py
RUN ls -la .dependencies/parsers/vasp/
RUN ls -la .dependencies/parsers/vasp/vaspparser/
# do that after the dependencies to use docker's layer caching
COPY . /app
RUN pip app .
WORKDIR /app/docs
COPY . /install
RUN pip install .
WORKDIR /install/docs
RUN make html
RUN \
find /usr/lib/python3.6/ -name 'tests' -exec rm -r '{}' + && \
find /usr/lib/python3.6/ -name 'test' -exec rm -r '{}' + && \
find /usr/lib/python3.6/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \;
find /usr/local/lib/python3.6/ -name 'tests' ! -name 'networkx' -exec rm -r '{}' + && \
find /usr/local/lib/python3.6/ -name 'test' -exec rm -r '{}' + && \
find /usr/local/lib/python3.6/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \;
RUN rm /usr/include/xlocale.h && \
apk del .build-dependencies
# Second, create a slim final image
FROM final
# copy the sources for tests, coverage, qa, etc.
COPY . /app
WORKDIR /app
# transfer installed packages from dependency stage
COPY --from=build /usr/local/lib/python3.6/site-packages /usr/local/lib/python3.6/site-packages
# copy the meta-info, since it files are loaded via relative paths. TODO that should change.
COPY --from=build /install/.dependencies/nomad-meta-info /app/.dependencies/nomad-meta-info
# copy the documentation, its files will be served by the API
COPY --from=build /install/docs/.build /app/docs/.build
RUN mkdir -p /app/.volumes/fs
RUN mkdir -p /nomad
......
Supports Markdown
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