From a3113019bbf8dcc5124169390b6877b6a11ec9f2 Mon Sep 17 00:00:00 2001 From: Arthur Zalevsky Date: Fri, 22 Dec 2023 15:46:22 -0800 Subject: [PATCH] Hack is no longer needed, fixed in https://github.com/cctbx/cctbx_project/issues/937 --- docker/Dockerfile | 52 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 68932cd2..bffcd6c1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,23 +1,43 @@ -FROM centos:7 -MAINTAINER Ben Webb +FROM ubuntu:22.04 +MAINTAINER Arthur Zalevsky -# Install ATSAS and its dependencies -COPY ATSAS-3.0.5-2.el7.x86_64.rpm / -RUN yum -y localinstall /ATSAS-3.0.5-2.el7.x86_64.rpm && yum -y install libgfortran5 git && rm -f /ATSAS*.rpm +ARG ATSAS +ARG TZ=America/Los_Angeles +ENV TZ=${TZ} +ENV DEBIAN_FRONTEND=noninteractive -# Set up basic conda environment using conda-forge packages -RUN curl -L https://github.com/conda-forge/miniforge/releases/download/4.11.0-0/Miniforge3-4.11.0-0-Linux-x86_64.sh -o miniforge.sh && echo "4c24b38969ac413efa3a984290296f72578340d06004f2c7ba5efcbf828ec86b miniforge.sh" sha256sum -c --status && bash ./miniforge.sh -b -p /root/miniforge && rm -f miniforge.sh && /root/miniforge/bin/conda init -q bash +# Install common dependencies +RUN apt-get update -y && apt-get install -y curl git subversion build-essential -# Install Python packages needed by IHMValidation and install extra RPMs -# needed to run firefox -RUN source /root/.bashrc && eval "$(conda shell.bash hook)" && conda install -y pandas flask ihm scikit-learn selenium bokeh requests firefox geckodriver && pip install python-decouple pdfkit && yum -y install gtk3 alsa-lib +# Set up basic conda environment using conda-forge packages +RUN curl -L https://github.com/conda-forge/miniforge/releases/download/23.3.1-1/Mambaforge-23.3.1-1-Linux-x86_64.sh -o miniforge.sh && echo "dbe92c011a1315b9626e2f93a165892f4b89177145bc350b3859a483a3642a24 miniforge.sh" sha256sum -c --status && bash ./miniforge.sh -b -p /opt/conda && rm -f miniforge.sh && /opt/conda/bin/conda init -q bash -# Get wkhtmltopdf directly from web site (there is a conda package, but it -# does not handle https: links) -RUN curl -LO https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm && yum -y localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm && rm -f wkhtmltox-0.12.6-1.centos7.x86_64.rpm +# Ensure that we always use a shell with conda +ENV PATH /opt/conda/bin:${PATH} +RUN echo "conda activate" >> ~/.bashrc +SHELL ["/bin/bash", "--login", "-c"] # Build molprobity from source code and put the binaries we need in /usr/bin/ -RUN source /root/.bashrc && eval "$(conda shell.bash hook)" && yum -y install mesa-libGL-devel subversion ca-certificates git gcc-c++ && mkdir molprobity && cd molprobity && curl -O https://raw.githubusercontent.com/rlabduke/MolProbity/master/install_via_bootstrap.sh && bash install_via_bootstrap.sh 12 && ln -sf /molprobity/build/bin/molprobity.clashscore /usr/bin/ && ln -sf /molprobity/build/bin/molprobity.ramalyze /usr/bin/ && ln -sf /molprobity/build/bin/molprobity.rotalyze /usr/bin/ && ln -sf /molprobity/build/bin/molprobity.molprobity /usr/bin/ +ADD "https://api.github.com/repos/rlabduke/MolProbity/commits?per_page=1" latest_commit +RUN mkdir /opt/molprobity && cd /opt/molprobity && curl -O https://raw.githubusercontent.com/rlabduke/MolProbity/master/install_via_bootstrap.sh && bash ./install_via_bootstrap.sh 4 +ENV PATH ${PATH}:/opt/molprobity/build/bin + +# Install SAS tools: ATSAS and SASCIFTOOLS +COPY ${ATSAS} /. +RUN apt-get update -y && apt-get install -y /${ATSAS} && rm -f /${ATSAS} +RUN pip install git+https://git.embl.de/grp-svergun/sasciftools3.git@master#egg=sasciftools +# Install additional certificate for SASBDB +RUN curl https://cacerts.digicert.com/ThawteEVRSACAG2.crt.pem -o ThawteEVRSACAG2.crt --output-dir /usr/local/share/ca-certificates/ && update-ca-certificates +ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt + +# Install Python packages and other dependencies needed by IHMValidation +RUN apt-get update -y && apt-get install -y xvfb libasound2 libdbus-glib-1-2 libgtk-3-0 && mamba install -y pip requests numpy pandas scikit-learn matplotlib "bokeh<3.0" selenium pyvirtualdisplay firefox geckodriver jinja2 && pip install -U iqplot pdfkit ihm && curl -L -O https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb && apt install -y ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb && rm -rf wkhtmltox_0.12.6.1-2.jammy_amd64.deb +# Hardcode selenium path +ENV SE_MANAGER_PATH=/opt/conda/bin/selenium-manager + +# Get IHMValidation +ADD "https://api.github.com/repos/salilab/IHMValidation/commits?per_page=1" latest_commit +RUN git clone --depth 1 https://github.com/salilab/IHMValidation.git /opt/IHMValidation -# Get IHMValidation and configure -RUN git clone https://github.com/salilab/IHMValidation.git && source /root/.bashrc && eval "$(conda shell.bash hook)" && yum -y install which && echo "ATSAS=\"`which datcmp`\"" > IHMValidation/.env && echo "Molprobity_ramalyze=\"`which molprobity.ramalyze`\"" >> IHMValidation/.env && echo "Molprobity_molprobity=\"`which molprobity.molprobity`\"" >> IHMValidation/.env && echo "Molprobity_clashscore=\"`which molprobity.clashscore`\"" >> IHMValidation/.env && echo "Molprobity_rotalyze=\"`which molprobity.rotalyze`\"" >> IHMValidation/.env && echo "wkhtmltopdf=\"`which wkhtmltopdf`\"" >> IHMValidation/.env +# Create input and output dirs +RUN mkdir -p /ihmv/input /ihmv/output /ihmv/cache /ihmv/databases