Unverified Commit 5a442e5e authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #1917 from nd-02110114/update-docker-doc

Update docker doc
parents 5a9db481 adff427e
Loading
Loading
Loading
Loading
+33 −28
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ materials science, quantum chemistry, and biology.
  - [Install latest package with conda](#install-via-conda-recommendation)
  - [Install latest package with pip (WIP)](#install-via-pip-wip)
  - [Install from source](#install-from-source)
  - [Install using a Docker (WIP)](#install-using-a-docker-wip)
  - [Install using a Docker](#install-using-a-docker)
- [FAQ and Troubleshooting](#faq-and-troubleshooting)
- [Getting Started](#getting-started)
- [Contributing to DeepChem](/CONTRIBUTING.md)
@@ -139,53 +139,58 @@ pytest -m "not slow" deepchem # optional

Check [this link](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) for more information about the installation of conda environments.

### Install using a Docker (WIP)
### Install using a Docker

### Build the image from Dockerfile
If you want to install using a docker, you can pull two kinds of images.  
DockerHub : https://hub.docker.com/repository/docker/deepchemio/deepchem

We created [sample Dockerfiles](https://github.com/deepchem/deepchem/tree/master/docker) based on the `nvidia/cuda:10.1-cudnn7-devel` image.  
If you want to build your own deepchem environment, these files may be helpful.  
- `docker/x.x.x` : build an image by using conda package manager (x.x.x is a version of deepchem)  
- `docker/master` : build an image from master branch of deepchem source codes
- `deepchemio/deepchem:x.x.x`
  - Image built by using a conda package manager (x.x.x is a version of deepchem)
  - The x.x.x image is built when we push x.x.x. tag
  - Dockerfile is put in `docker/conda-forge` directory
- `deepchemio/deepchem:latest`
  - Image built by the master branch of deepchem source codes
  - The latest image is built every time we commit to the master branch
  - Dockerfile is put in `docker/master` directory

### Use the official deepchem image (WIP)

We couldn't check if this introduction works well or not.

First, you pull the latest stable deepchem docker image.
First, you pull the image you want to use.

```bash
docker pull deepchemio/deepchem
docker pull deepchemio/deepchem:2.3.0
```

Then, you create a container based on our latest image.
Then, you create a container based on the image.

```bash
docker run -it deepchemio/deepchem
docker run --rm -it deepchemio/deepchem:2.3.0
```

If you want GPU support:

```bash
# If nvidia-docker is installed
nvidia-docker run -it deepchemio/deepchem
docker run --runtime nvidia -it deepchemio/deepchem
nvidia-docker run --rm -it deepchemio/deepchem:2.3.0
docker run --runtime nvidia --rm -it deepchemio/deepchem:2.3.0

# If nvidia-container-toolkit is installed
docker run --gpus all -it deepchemio/deepchem
docker run --gpus all --rm -it deepchemio/deepchem:2.3.0
```

You are now in a docker container which deepchem was installed. You can start playing with it in the command line.

```
(deepchem) root@xxxxxxxxxxxxx:~/mydir# python
Python 3.6.10 |Anaconda, Inc.| (default, May  8 2020, 02:54:21)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import deepchem as dc
```

You are now in a docker container whose python has deepchem installed.
If you want to check the tox21 benchmark:

```bash
# you can start playing with it in the command line
pip install jupyter
ipython
import deepchem as dc

# you can run our tox21 benchmark
cd /deepchem/examples
python benchmark.py -d tox21
(deepchem) root@xxxxxxxxxxxxx:~/mydir# wget https://raw.githubusercontent.com/deepchem/deepchem/master/examples/benchmark.py
(deepchem) root@xxxxxxxxxxxxx:~/mydir# python benchmark.py -d tox21 -m graphconv -s random
```

## FAQ and Troubleshooting

deepchem/tests/test_init.py

deleted100644 → 0
+0 −9
Original line number Diff line number Diff line
import unittest

import deepchem as dc


class TestInit(unittest.TestCase):

  def test_version(self):
    assert dc.__version__
+1 −1
Original line number Diff line number Diff line
FROM nvidia/cuda:10.1-cudnn7-devel
FROM nvidia/cuda:10.0-cudnn7-devel

# Install some utilities
RUN apt-get update && \
+70 −4
Original line number Diff line number Diff line
@@ -33,12 +33,75 @@ Then open your python and try running.

    import deepchem

Pip and Docker Installation

Pip Installation
---------------------------
We are working on improving our pip and docker installation
We are working on improving our pip installation
capabilities. We'll update our docs once we have more information on
how to do this well.


Docker Installation
------------------

If you want to install using a docker, you can pull two kinds of images from `DockerHub`_.

- **deepchemio/deepchem:x.x.x**

  - Image built by using a conda package manager (x.x.x is a version of deepchem)
  - This image is built when we push x.x.x. tag
  - Dockerfile is put in `docker/conda-forge`_ directory

- **deepchemio/deepchem:latest**

  - Image built by the master branch of deepchem source codes
  - This image is built every time we commit to the master branch
  - Dockerfile is put in `docker/master`_ directory

First, you pull the image you want to use.

.. code-block:: bash

    docker pull deepchemio/deepchem:2.3.0


Then, you create a container based on the image.

.. code-block:: bash

    docker run --rm -it deepchemio/deepchem:2.3.0

If you want GPU support:

.. code-block:: bash

    # If nvidia-docker is installed
    nvidia-docker run --rm -it deepchemio/deepchem:2.3.0
    docker run --runtime nvidia --rm -it deepchemio/deepchem:2.3.0

    # If nvidia-container-toolkit is installed
    docker run --gpus all --rm -it deepchemio/deepchem:2.3.0

You are now in a docker container which deepchem was installed.
You can start playing with it in the command line.

.. code-block:: bash

    (deepchem) root@xxxxxxxxxxxxx:~/mydir# python
    Python 3.6.10 |Anaconda, Inc.| (default, May  8 2020, 02:54:21)
    [GCC 7.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import deepchem as dc

If you want to check the tox21 benchmark:

.. code-block:: bash

    # you can run our tox21 benchmark
    (deepchem) root@xxxxxxxxxxxxx:~/mydir# wget https://raw.githubusercontent.com/deepchem/deepchem/master/examples/benchmark.py
    (deepchem) root@xxxxxxxxxxxxx:~/mydir# python benchmark.py -d tox21 -m graphconv -s random


Installing from Source
----------------------

@@ -46,4 +109,7 @@ Check out our directions on Github for how to `install from source`_.

.. _`DeepChem Tutorials`: https://github.com/deepchem/deepchem/tree/master/examples/tutorials
.. _`forum post`: https://forum.deepchem.io/t/getting-deepchem-running-in-colab/81
.. _`install from source`: https://github.com/deepchem/deepchem/blob/master/README.md#linux-64-bit-installation-from-source
.. _`DockerHub`: https://hub.docker.com/repository/docker/deepchemio/deepchem
.. _`docker/conda-forge`: https://github.com/deepchem/deepchem/tree/master/docker/conda-forge
.. _`docker/master`: https://github.com/deepchem/deepchem/tree/master/docker/master
.. _`install from source`: https://github.com/deepchem/deepchem/blob/master/README.md#install-from-source
+1 −1
Original line number Diff line number Diff line
@@ -33,4 +33,4 @@ conda install -y -q -c deepchem -c rdkit -c conda-forge -c omnia `
    pytest-cov `
    flaky

pip install -U tensorflow tensorflow-probability
pip install -U tensorflow==2.2 tensorflow-probability==0.10
Loading