From 632311785688a38b351b41b5e4843ef7b13dd99e Mon Sep 17 00:00:00 2001 From: Rim Date: Mon, 14 Jan 2019 12:55:45 +0300 Subject: [PATCH] Docker: tensorflow gpu version, size reduction and documentation updates (#18) * Docker Documentation * Docker image size * Docker image size reducing * Docker size * bug in tensorflow GPU fixed * 4Gb to download --- Dockerfile | 36 ++++++++++++++++++++---------------- README.md | 8 +++----- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index d129df1..ec53672 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,14 @@ FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04 ENV DEBIAN_FRONTEND noninteractive ENV TERM linux -RUN mkdir /code -COPY . /code +RUN mkdir /moses +COPY . /moses RUN set -ex \ && apt-get update -yqq \ && apt-get upgrade -yqq \ && apt-get install -yqq --no-install-recommends \ - git wget curl libxrender1 libxext6 software-properties-common \ + git wget curl ssh libxrender1 libxext6 software-properties-common \ && wget --no-check-certificate https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ && /bin/bash Miniconda3-latest-Linux-x86_64.sh -f -b -p /opt/miniconda \ && add-apt-repository ppa:git-core/ppa \ @@ -18,20 +18,24 @@ RUN set -ex \ && apt-get install git-lfs \ && git lfs install \ && apt-get clean \ - && rm Miniconda3-latest-Linux-x86_64.sh + && /opt/miniconda/bin/conda install conda=4.5.12=py36_0 \ + && /opt/miniconda/bin/conda clean -yq -a \ + && rm Miniconda3-latest-Linux-x86_64.sh \ + && rm -rf \ + /tmp/* \ + /var/tmp/* \ + /usr/share/man \ + /usr/share/doc \ + /usr/share/doc-base ENV PATH /opt/miniconda/bin:$PATH -RUN conda update conda - -RUN conda install -y -q numpy=1.15.0 scipy=1.1.0 matplotlib=3.0.1 pandas=0.23.3 scikit-learn=0.19.1 tqdm -RUN conda install -c anaconda tensorflow-gpu=1.12 -RUN conda install -y -q keras-gpu=2.2.4 -RUN conda install -y -q -c rdkit rdkit=2018.09.1.0 -RUN conda install -y -q -c pytorch pytorch=0.4.1 -RUN conda install -y -q -c pytorch torchvision=0.2.1 - -RUN cd /code && python setup.py install && git lfs pull - -RUN conda clean -yq -a +RUN conda install -yq numpy=1.15.0 scipy=1.1.0 matplotlib=3.0.1 pandas=0.23.3 scikit-learn=0.19.1 tqdm \ + && pip install tensorflow-gpu==1.12 keras==2.2.4 \ + && conda install -yq -c rdkit rdkit=2018.09.1.0 \ + && conda install -yq -c pytorch pytorch=0.4.1 torchvision=0.2.1 \ + && conda clean -yq -a + +WORKDIR /moses +RUN python setup.py install && git lfs pull && conda clean -yq -a && rm -rf .git/lfs CMD [ "/bin/bash" ] diff --git a/README.md b/README.md index 7e64c9f..b4f5c7b 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ For comparison of molecular properties, we computed the Frèchet distance betwee 1. Install [docker](https://docs.docker.com/install/) and [nvidia-docker](https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0)). -2. Pull an existing image from DockerHub: +2. Pull an existing image (4.1Gb to download) from DockerHub: ``` docker pull molecularsets/moses @@ -158,19 +158,17 @@ docker pull molecularsets/moses or clone the repository and build it manually: - ``` -git lfs install git clone https://github.com/molecularsets/moses.git nvidia-docker image build --tag molecularsets/moses moses/ ``` 3. Create a container: ``` -nvidia-docker run -it moses --network="host" --shm-size 1G molecularsets/moses +nvidia-docker run -it --name moses --network="host" --shm-size 1G molecularsets/moses ``` -4. The dataset and source code is available inside the docker container: +4. The dataset and source code are available inside the docker container at /moses: ``` docker exec -it molecularsets/moses bash ```