Commit 785ce383 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'bugfixes' into 'v0.8.1'


See merge request !120
parents 21d41bf1 9da155e9
Pipeline #76336 passed with stages
in 27 minutes and 56 seconds
......@@ -19,10 +19,8 @@
# The dockerfile is multistaged to use a fat, more convinient build image and
# copy only necessities to a slim final image
# We use stretch instead of slim to allow compoilation of some dependencies. We
# do not bother to have an additional copy to a final slim image, because the space
# savings are minimal
FROM python:3.7-stretch as final
# We use slim for the final image
FROM python:3.7-slim as final
# First built the GUI in a gui build image
FROM node:latest as gui_build
......@@ -34,10 +32,11 @@ COPY gui/yarn.lock /app/yarn.lock
RUN yarn
COPY gui /app
RUN yarn run build
# RUN yarn run --silent react-docgen src/components --pretty > react-docgen.out
# Second, build all python stuff in a python build image
FROM final
RUN mkdir /app
FROM python:3.7-stretch as build
RUN mkdir /install
# Install linux package dependencies
RUN apt-get update
......@@ -63,6 +62,10 @@ RUN pip install matid
RUN pip install mdtraj
RUN pip install mdanalysis
# Make will be necessary to build the docs with sphynx
RUN apt-get update && apt-get install -y make
RUN apt-get update && apt-get install -y vim
# Install pymolfile (required by some parsers)
RUN git clone -b nomad-fair
WORKDIR /pymolfile/
......@@ -70,24 +73,48 @@ RUN python3 install
RUN rm -rf /pymolfile
# Copy files and install nomad@FAIRDI
COPY . /app
WORKDIR /install
COPY . /install
RUN python compile
RUN pip install .[all]
RUN python sdist
RUN cp dist/nomad-lab-*.tar.gz dist/nomad-lab.tar.gz
WORKDIR /app/docs
WORKDIR /install/docs
# COPY --from=gui_build /app/react-docgen.out /install/docs
RUN make html
# Remove unnessesary files
find /usr/local/lib/python3.7/ -name 'tests' ! -path '*/networkx/*' -exec rm -r '{}' + && \
find /usr/local/lib/python3.7/ -name 'test' -exec rm -r '{}' + && \
find /usr/local/lib/python3.7/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \;
# Setup directories, users, rights
# Third, create a slim final image
FROM final
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 && apt-get install -y libmagic-dev curl
# copy the sources for tests, coverage, qa, etc.
COPY . /app
# transfer installed packages from dependency stage
COPY --from=build /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/site-packages
RUN echo "copy 1"
# 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
RUN echo "copy 2"
# copy the documentation, its files will be served by the API
COPY --from=build /install/docs/.build /app/docs/.build
RUN echo "copy 3"
# copy the source distribution, its files will be served by the API
COPY --from=build /install/dist /app/dist
RUN echo "copy 4"
# copy the nomad command
COPY --from=build /usr/local/bin/nomad /usr/bin/nomad
RUN echo "copy 5"
# copy the gui
RUN mkdir -p /app/gui
COPY --from=gui_build /app/build /app/gui/build
RUN echo "copy 6"
RUN mkdir -p /app/.volumes/fs
RUN useradd -ms /bin/bash nomad
RUN chown -R nomad /app
......@@ -212,7 +212,7 @@
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