Skip to content

Commit

Permalink
Docker: tensorflow gpu version, size reduction and documentation upda…
Browse files Browse the repository at this point in the history
…tes (#18)

* Docker Documentation

* Docker image size

* Docker image size reducing

* Docker size

* bug in tensorflow GPU fixed

* 4Gb to download
  • Loading branch information
shayakhmetov authored and zhebrak committed Jan 14, 2019
1 parent 49808fd commit 6323117
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
36 changes: 20 additions & 16 deletions Dockerfile
Expand Up @@ -3,35 +3,39 @@ 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 \
&& (curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash) \
&& 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" ]
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -150,27 +150,25 @@ 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
```

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
```
Expand Down

0 comments on commit 6323117

Please sign in to comment.