Skip to content

Commit

Permalink
Merge pull request #549 from DeepRank/534_conda_dssp_gcroci2
Browse files Browse the repository at this point in the history
build: switch to conda dssp installation
  • Loading branch information
gcroci2 authored Jan 24, 2024
2 parents fb46161 + f1519d2 commit 8718308
Show file tree
Hide file tree
Showing 16 changed files with 349 additions and 122 deletions.
43 changes: 13 additions & 30 deletions .github/actions/install-python-and-package/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Install Python and deeprank2"
name: "Install Python and DeepRank2"

description: "Installs Python, updates pip and installs deeprank2 together with its dependencies."
description: "Installs Python, updates pip and installs DeepRank2 together with its dependencies."

inputs:
python-version:
Expand All @@ -27,8 +27,10 @@ runs:
with:
update-conda: true
python-version: ${{ inputs.python-version }}
conda-channels: anaconda
- run: conda --version
conda-channels: pytorch, pyg, bioconda, defaults, sbl, conda-forge
- run: |
conda --version
conda env list
shell: bash {0}
- name: Python info
shell: bash -e {0}
Expand All @@ -41,16 +43,16 @@ runs:
CMAKE_INSTALL_PREFIX: .local
if: runner.os == 'Linux'
run: |
# Install dependencies not handled by setuptools
# Install deeprank2 conda dependencies
## DSSP
sudo apt-get install -y dssp
conda install -c sbl dssp>=4.2.2.1
## MSMS
conda install -c bioconda msms
conda install -c bioconda msms>=2.6.1
## PyTorch, PyG, PyG adds
### Installing for CPU only on the CI
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 -c pytorch
pip install torch_geometric==2.3.1
pip install torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-$(python3 -c "import torch; print(torch.__version__)")+cpu.html
conda install pytorch=2.1.1 torchvision=0.16.1 torchaudio=2.1.1 cpuonly=2.0.* -c pytorch
conda install pyg=2.4.0 -c pyg
pip install torch_scatter==2.1.2 torch_sparse==0.6.18 torch_cluster==1.6.3 torch_spline_conv==1.2.2 -f https://data.pyg.org/whl/torch-2.1.0+cpu.html
- name: Install dependencies on MacOS
shell: bash {0}
env:
Expand All @@ -59,26 +61,7 @@ runs:
run: |
# Install dependencies not handled by setuptools
## DSSP
git clone https://github.com/PDB-REDO/libcifpp.git --recurse-submodules
cd libcifpp
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
#######
git clone https://github.com/mhekkel/libmcfp.git
cd libmcfp
mkdir build
cd build
cmake ..
cmake --build .
cmake --install .
#######
git clone https://github.com/PDB-REDO/dssp.git
cd dssp
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
conda install -c sbl dssp>=4.2.2.1
## MSMS
cd /tmp/
wget http://mgltools.scripps.edu/downloads/tars/releases/MSMSRELEASE/REL2.6.1/msms_i86Linux2_2.6.1.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11"]
python-version: ["3.10"] # ["3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
python-version: ${{ matrix.python-version }}
extras-require: test
- name: Run unit tests with coverage
run: pytest --cov --cov-append --cov-report xml --cov-report term --cov-report html
run: pytest --cov --cov-append --cov-report xml --cov-fail-under=80 --cov-report term --cov-report html
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
Expand Down
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Pull base image
FROM --platform=linux/x86_64 condaforge/miniforge3:23.3.1-1

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

# Install
RUN \
apt update -y &&
apt install unzip -y &&
## GCC
apt install -y gcc &&
## Conda and pip deps
mamba env create -f /home/deeprank2/environment.yml &&
## Get the data for running the tutorials
if [ -d "/home/deeprank2/tutorials/data_raw" ]; then rm -Rf /home/deeprank2/tutorials/data_raw; fi &&
if [ -d "/home/deeprank2/tutorials/data_processed" ]; then rm -Rf /home/deeprank2/tutorials/data_processed; fi &&
wget https://zenodo.org/records/8349335/files/data_raw.zip &&
unzip data_raw.zip -d data_raw &&
mv data_raw /home/deeprank2/tutorials

# Activate the environment
RUN echo "source activate deeprank2" >~/.bashrc
ENV PATH /opt/conda/envs/deeprank2/bin:$PATH

# Define working directory
WORKDIR /home/deeprank2

# Define default command
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--NotebookApp.token=''","--NotebookApp.password=''", "--allow-root"]
Loading

0 comments on commit 8718308

Please sign in to comment.