Skip to content

Commit

Permalink
♻️ refactor install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nissy-dev committed Aug 1, 2020
1 parent 995e0e0 commit 453abc9
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 61 deletions.
2 changes: 1 addition & 1 deletion docker/master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN conda update -n base conda && \
git clone --depth 1 https://github.com/deepchem/deepchem.git && \
cd deepchem && \
. /miniconda/etc/profile.d/conda.sh && \
bash scripts/install_deepchem_conda.sh deepchem && \
bash scripts/install_deepchem_conda.sh deepchem gpu && \
conda activate deepchem && \
python setup.py install && \
conda clean -afy && \
Expand Down
7 changes: 7 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ Then, execute the shell script.
bash scripts/install_deepchem_conda.sh deepchem
If you want GPU support:

.. code-block:: bash
bash scripts/install_deepchem_conda.sh deepchem gpu
If you are using the Windows and the PowerShell:

.. code-block:: ps1
Expand Down
26 changes: 13 additions & 13 deletions docs/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DeepChem has a number of "soft" requirements.
| Package name | Version | Location where this package is imported |
| | | (dc: deepchem) |
+================================+===============+===================================================+
| `BioPython`_ | 1.77 | :code:`dc.utlis.genomics_utils` |
| `BioPython`_ | latest | :code:`dc.utlis.genomics_utils` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
Expand All @@ -38,35 +38,35 @@ DeepChem has a number of "soft" requirements.
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `matminer`_ | 0.6.3 | :code:`dc.feat.materials_featurizers` |
| `matminer`_ | latest | :code:`dc.feat.materials_featurizers` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `MDTraj`_ | 1.9.4 | :code:`dc.utils.pdbqt_utils` |
| `MDTraj`_ | latest | :code:`dc.utils.pdbqt_utils` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `NetworkX`_ | 2.4 | :code:`dc.utils.rdkit_utils` |
| `NetworkX`_ | latest | :code:`dc.utils.rdkit_utils` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `OpenMM`_ | 7.4.2 | :code:`dc.utils.rdkit_utils` |
| `OpenMM`_ | latest | :code:`dc.utils.rdkit_utils` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `PDBFixer`_ | 1.6 | :code:`dc.utils.rdkit_utils` |
| `PDBFixer`_ | latest | :code:`dc.utils.rdkit_utils` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `Pillow`_ | 7.1.2 | :code:`dc.data.data_loader`, |
| `Pillow`_ | latest | :code:`dc.data.data_loader`, |
| | | :code:`dc.trans.transformers` |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `pyGPGO`_ | 0.4.0.dev1 | :code:`dc.hyper.gaussian_process` |
| `pyGPGO`_ | latest | :code:`dc.hyper.gaussian_process` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `Pymatgen`_ | 2020.7.18 | :code:`dc.feat.materials_featurizers` |
| `Pymatgen`_ | latest | :code:`dc.feat.materials_featurizers` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
Expand All @@ -78,19 +78,19 @@ DeepChem has a number of "soft" requirements.
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `RDKit`_ | 2020.03.4 | Many modules |
| `RDKit`_ | latest | Many modules |
| | | (we recommend you to instal) |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `simdna`_ | 0.4.3.2 | :code:`dc.metrics.genomic_metrics`, |
| `simdna`_ | latest | :code:`dc.metrics.genomic_metrics`, |
| | | :code:`dc.molnet.dnasim` |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `Tensorflow Probability`_ | 0.10 | :code:`dc.rl` |
| `Tensorflow Probability`_ | 0.10.1 | :code:`dc.rl` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
| `XGBoost`_ | 1.1.1 | :code:`dc.models.xgboost_models` |
| `XGBoost`_ | latest | :code:`dc.models.xgboost_models` |
| | | |
| | | |
+--------------------------------+---------------+---------------------------------------------------+
Expand Down
5 changes: 0 additions & 5 deletions requirements-pyg.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements-torch.txt

This file was deleted.

11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

17 changes: 13 additions & 4 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ channels:
- conda-forge
- defaults
dependencies:
- openmm==7.4.2
- pdbfixer==1.6
- rdkit==2020.03.4
- simdna==0.4.3.2
- openmm
- pdbfixer
- rdkit
- simdna
- pip
- pip:
biopython
matminer
mdtraj
networkx
pillow
pyGPGO
pymatgen
xgboost
44 changes: 41 additions & 3 deletions scripts/install_deepchem_conda.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,48 @@ else
echo "Installing DeepChem in current env"
}

# Install dependencies except PyTorch Geometric
if($args[1] -eq "gpu")
{
$cuda="cu101"
dgl_pkg="dgl-cu101"
echo "Installing DeepChem in the GPU envirionment"
}
else
{
$cuda="cpu"
$dgl_pkg="dgl"
echo "Installing DeepChem in the CPU envirionment"
}

# Install dependencies except PyTorch and TensorFlow
$path = Join-Path $Pwd "requirements.yml"
conda env update --file $path
$path = Join-Path $Pwd "requirements.txt"
pip install -r $path
$path = Join-Path $Pwd "requirements-test.txt"
pip install -r $path

# Fixed packages
$tensorflow=2.2.0
$tensorflow_probability=0.10.1
$torch=1.5.1
$torchvision=0.6.1
$torch_scatter=2.0.5
$torch_sparse=0.6.6
$torch_cluster=1.5.6
$torch_spline_conv=1.2.0
$torch_geometric=1.6.0
$dgl=0.4.3.post2

# Install Tensorflow dependencies
pip install tensorflow==$tensorflow tensorflow-probability==$tensorflow_probability

# Install PyTorch dependencies
pip install torch==$torch+$cuda torchvision==$torchvision+$cuda -f https://download.pytorch.org/whl/torch_stable.html

# Install PyTorch Geometric and DGL dependencies
$TORCH=1.5.0
pip install torch-scatter==$torch_scatter+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-sparse==$torch_sparse+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-cluster==$torch_cluster+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-spline-conv==$torch_spline_conv+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-geometric==$torch_geometric
pip install $dgl_pkg==$dgl
61 changes: 39 additions & 22 deletions scripts/install_deepchem_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,49 @@ if [ -z "$1" ];
then
echo "Installing DeepChem in current env"
else
export envname=$1
envname=$1
conda create -y --name $envname python=$python_version
conda activate $envname
fi

# Install dependencies except PyTorch Geometric
if [ "$2" = "gpu" ];
then
cuda=cu101
dgl_pkg=dgl-cu101
echo "Installing DeepChem in the GPU envirionment"
else
cuda=cpu
dgl_pkg=dgl
echo "Installing DeepChem in the CPU envirionment"
fi

# Install dependencies except PyTorch and TensorFlow
conda env update --file $PWD/requirements.yml
pip install -r $PWD/requirements.txt
pip install -r $PWD/requirements-test.txt

# For PyTorch
list=(`cat $PWD/requirements-torch.txt | xargs`)
for pkg in "${list[@]}" ; do
pkg=`echo ${pkg} | sed -e "s/[\r\n]\+//g"`
pip install ${pkg}+cpu -f https://download.pytorch.org/whl/torch_stable.html
done

# For PyTorch Geometric
export TORCH=1.5.0
list=(`cat $PWD/requirements-pyg.txt | xargs`)
for pkg in "${list[@]}" ; do
pkg=`echo ${pkg} | sed -e "s/[\r\n]\+//g"`
if [[ $pkg =~ torch-geometric ]];
then
pip install ${pkg}
else
pip install ${pkg}+cpu -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
fi
done
# Fixed packages
tensorflow=2.2.0
tensorflow_probability=0.10.1
torch=1.5.1
torchvision=0.6.1
torch_scatter=2.0.5
torch_sparse=0.6.6
torch_cluster=1.5.6
torch_spline_conv=1.2.0
torch_geometric=1.6.0
dgl=0.4.3.post2

# Install Tensorflow dependencies
pip install tensorflow==$tensorflow tensorflow-probability==$tensorflow_probability

# Install PyTorch dependencies
pip install torch==$torch+$cuda torchvision==$torchvision+$cuda -f https://download.pytorch.org/whl/torch_stable.html

# Install PyTorch Geometric and DGL dependencies
TORCH=1.5.0
pip install torch-scatter==$torch_scatter+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-sparse==$torch_sparse+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-cluster==$torch_cluster+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-spline-conv==$torch_spline_conv+$cuda -f https://pytorch-geometric.com/whl/torch-$TORCH.html
pip install torch-geometric==$torch_geometric
pip install $dgl_pkg==$dgl

0 comments on commit 453abc9

Please sign in to comment.