Skip to content

Commit

Permalink
Merge pull request #615 from DeepRank/docker_cleaning_gcroci2
Browse files Browse the repository at this point in the history
build: simplify docker installation and improve the manual one
  • Loading branch information
gcroci2 authored Jul 1, 2024
2 parents 0461556 + 372e615 commit c7513c6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 81 deletions.
4 changes: 0 additions & 4 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@ replace = version = "{new_version}"
[bumpversion:file:CITATION.cff]
search = version: "{current_version}"
replace = version: "{new_version}"

[bumpversion:file:env/requirements-docker.txt]
search = deeprank2=={current_version}
replace = deeprank2=={new_version}
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ FROM --platform=linux/x86_64 condaforge/miniforge3:23.3.1-1

# Add files
ADD ./tutorials /home/deeprank2/tutorials
ADD ./env/deeprank2-docker.yml /home/deeprank2
ADD ./env/requirements-docker.txt /home/deeprank2
ADD ./env/deeprank2.yml /home/deeprank2

RUN \
# Install dependencies and package
Expand All @@ -13,9 +12,9 @@ RUN \
## GCC
apt install -y gcc && \
## Create the environment and install the dependencies
mamba env create -f /home/deeprank2/deeprank2-docker.yml && \
mamba env create -f /home/deeprank2/deeprank2.yml && \
## Activate the environment and install pip packages
/opt/conda/bin/conda run -n deeprank2 pip install -r /home/deeprank2/requirements-docker.txt && \
/opt/conda/bin/conda run -n deeprank2 pip install deeprank2 && \
## Activate the environment automatically when entering the container
echo "source activate deeprank2" >~/.bashrc && \
# Get the data for running the tutorials
Expand Down
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,32 +102,24 @@ Before installing DeepRank2 please ensure you have [GCC](https://gcc.gnu.org/ins

#### YML file installation (recommended)

You can use the provided YML file for creating a [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) containing the latest stable release of DeepRank2 and all its dependencies.
You can use the provided YML file for creating a [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) via [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html), containing the latest stable release of DeepRank2 and all its dependencies.
This will install the CPU-only version of DeepRank2 on Python 3.10.
Note that this will not work for MacOS. Do the [Manual Installation](#manual-installation) instead.

```bash
# Clone the DeepRank2 repository and enter its root directory
git clone https://github.com/DeepRank/deeprank2
cd deeprank2

# Ensure you are in your base environment
conda activate
# Create the environment
conda env create -f env/deeprank2.yml
mamba env create -f https://raw.githubusercontent.com/DeepRank/deeprank2/main/env/deeprank2.yml
# Activate the environment
conda activate deeprank2
# Install the latest deeprank2 release
pip install deeprank2
```

See instructions below to [test](#testing-deeprank2-installation) that the installation was succesful.

#### Manual installation (customizable)

If you want to use the GPUs, choose a specific python version, are a MacOS user, or if the YML installation was not successful, you can install the package manually. We advise to do this inside a [conda virtual environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
If you want to use the GPUs, choose a specific python version (note that at the moment we support python 3.10 only), are a MacOS user, or if the YML installation was not successful, you can install the package manually. We advise to do this inside a [conda virtual environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).

You can first remove from `env/deeprank2.yml` the packages that cannot be installed properly, or the ones that you want to install differently (e.g., pytorch-related packages if you wish to install the CUDA version), and then proceed with the environment creation by using the edited YML file: `conda env create -f env/deeprank2.yml`. Then activate the environment, and proceed with installing the missing packages, which might fall into the following list. If you have any issues during installation of dependencies, please refer to the official documentation for each package (linked below), as our instructions may be out of date (last tested on 19 Feb 2024):
You can first create a copy of the `deeprank2.yml` file, place it in your current directory, and remove the packages that cannot be installed properly, or the ones that you want to install differently (e.g., pytorch-related packages if you wish to install the CUDA version), and then proceed with the environment creation by using the edited YML file: `conda env create -f deeprank2.yml` or `mamba env create -f deeprank2.yml`, if you have [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) installed. Then activate the environment, and proceed with installing the missing packages, which might fall into the following list. If you have any issues during installation of dependencies, please refer to the official documentation for each package (linked below), as our instructions may be out of date (last tested on 19 Feb 2024):

- [MSMS](https://anaconda.org/bioconda/msms): [Here](https://ssbio.readthedocs.io/en/latest/instructions/msms.html) for MacOS with M1 chip users.
- [PyTorch](https://pytorch.org/get-started/locally/)
Expand All @@ -151,7 +143,7 @@ The `test` extra is optional, and can be used to install test-related dependenci

#### Testing DeepRank2 installation

You can check that all components were installed correctly, using `pytest`. We especially recommend doing this in case you installed DeepRank2 and its dependencies manually (the latter option above).
If you have cloned the repository, you can check that all components were installed correctly using `pytest`. We especially recommend doing this in case you installed DeepRank2 and its dependencies manually (the latter option above).

The quick test should be sufficient to ensure that the software works, while the full test (a few minutes) will cover a much broader range of settings to ensure everything is correct.

Expand Down
24 changes: 8 additions & 16 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
- [Installation](#installation)
- [Containerized Installation](#containerized-installation)
- [Local/remote installation](#localremote-installation)
- [YML file installation (recommended)](#yml-file-installation-recommended)
- [Manual installation (customizable)](#manual-installation-customizable)
- [Testing DeepRank2 installation](#testing-deeprank2-installation)
- [YML file installation (recommended)](#yml-file-installation-recommended)
- [Manual installation (customizable)](#manual-installation-customizable)
- [Testing DeepRank2 installation](#testing-deeprank2-installation)
- [Contributing](#contributing)

# Installation
Expand Down Expand Up @@ -48,32 +48,24 @@ Before installing DeepRank2 please ensure you have [GCC](https://gcc.gnu.org/ins

#### YML file installation (recommended)

You can use the provided YML file for creating a [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) containing the latest stable release of DeepRank2 and all its dependencies.
You can use the provided YML file for creating a [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) via [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html), containing the latest stable release of DeepRank2 and all its dependencies.
This will install the CPU-only version of DeepRank2 on Python 3.10.
Note that this will not work for MacOS. Do the [Manual Installation](#manual-installation) instead.

```bash
# Clone the DeepRank2 repository and enter its root directory
git clone https://github.com/DeepRank/deeprank2
cd deeprank2

# Ensure you are in your base environment
conda activate
# Create the environment
conda env create -f env/deeprank2.yml
mamba env create -f https://raw.githubusercontent.com/DeepRank/deeprank2/main/env/deeprank2.yml
# Activate the environment
conda activate deeprank2
# Install the latest deeprank2 release
pip install deeprank2
```

See instructions below to [test](#testing-deeprank2-installation) that the installation was succesful.

#### Manual installation (customizable)

If you want to use the GPUs, choose a specific python version, are a MacOS user, or if the YML installation was not successful, you can install the package manually. We advise to do this inside a [conda virtual environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
If you want to use the GPUs, choose a specific python version (note that at the moment we support python 3.10 only), are a MacOS user, or if the YML installation was not successful, you can install the package manually. We advise to do this inside a [conda virtual environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).

You can first remove from `env/deeprank2.yml` the packages that cannot be installed properly, or the ones that you want to install differently (e.g., pytorch-related packages if you wish to install the CUDA version), and then proceed with the environment creation by using the edited YML file: `conda env create -f env/deeprank2.yml`. Then activate the environment, and proceed with installing the missing packages, which might fall into the following list. If you have any issues during installation of dependencies, please refer to the official documentation for each package (linked below), as our instructions may be out of date (last tested on 19 Feb 2024):
You can first create a copy of the `deeprank2.yml` file, place it in your current directory, and remove the packages that cannot be installed properly, or the ones that you want to install differently (e.g., pytorch-related packages if you wish to install the CUDA version), and then proceed with the environment creation by using the edited YML file: `conda env create -f deeprank2.yml` or `mamba env create -f deeprank2.yml`, if you have [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) installed. Then activate the environment, and proceed with installing the missing packages, which might fall into the following list. If you have any issues during installation of dependencies, please refer to the official documentation for each package (linked below), as our instructions may be out of date (last tested on 19 Feb 2024):

- [MSMS](https://anaconda.org/bioconda/msms): [Here](https://ssbio.readthedocs.io/en/latest/instructions/msms.html) for MacOS with M1 chip users.
- [PyTorch](https://pytorch.org/get-started/locally/)
Expand All @@ -97,7 +89,7 @@ The `test` extra is optional, and can be used to install test-related dependenci

#### Testing DeepRank2 installation

You can check that all components were installed correctly, using `pytest`. We especially recommend doing this in case you installed DeepRank2 and its dependencies manually (the latter option above).
If you have cloned the repository, you can check that all components were installed correctly using `pytest`. We especially recommend doing this in case you installed DeepRank2 and its dependencies manually (the latter option above).

The quick test should be sufficient to ensure that the software works, while the full test (a few minutes) will cover a much broader range of settings to ensure everything is correct.

Expand Down
43 changes: 0 additions & 43 deletions env/deeprank2-docker.yml

This file was deleted.

1 change: 0 additions & 1 deletion env/requirements-docker.txt

This file was deleted.

0 comments on commit c7513c6

Please sign in to comment.