-
Notifications
You must be signed in to change notification settings - Fork 12
/
Singularity.def
99 lines (86 loc) · 3.12 KB
/
Singularity.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Bootstrap: docker
From: nvidia/cuda:11.1.1-cudnn8-runtime-ubuntu18.04
Stage: spython-base
%files
. /app/alphafold
%post
# Copyright 2023 David Chin
#
# This file is part of alphafold_singularity.
#
# alphafold_singularity is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# alphafold_singularity is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with alphafold_singularity. If not, see <https://www.gnu.org/licenses/>.
# FROM directive resets ARGS, so we specify again (the value is retained if
# previously set).
apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
build-essential \
cmake \
cuda-command-line-tools-11-1 \
git \
hmmer \
kalign \
tzdata \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoremove -y \
&& apt-get clean
# Compile HHsuite from source.
/bin/rm -rf /tmp/hh-suite \
&& git clone --branch v3.3.0 https://github.com/soedinglab/hh-suite.git /tmp/hh-suite \
&& mkdir /tmp/hh-suite/build \
&& cd /tmp/hh-suite/build \
&& cmake -DCMAKE_INSTALL_PREFIX=/opt/hhsuite .. \
&& make -j 4 && make install \
&& ln -s /opt/hhsuite/bin/* /usr/bin \
&& cd / \
&& /bin/rm -rf /tmp/hh-suite
# Install Miniconda package manager.
wget -q -P /tmp \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \
&& rm /tmp/Miniconda3-latest-Linux-x86_64.sh
# Install conda packages.
PATH="/opt/conda/bin:/usr/local/cuda-11.1/bin:$PATH"
conda install -qy conda==23.5.2 \
&& conda install -y -c conda-forge \
openmm=7.7.0 \
cudatoolkit==11.1.1 \
pdbfixer \
pip \
python=3.10 \
&& conda clean --all --force-pkgs-dirs --yes
### /bin/cp -r . /app/alphafold
wget -q -P /app/alphafold/alphafold/common/ \
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
# Install pip packages.
# N.B. The URL specifies the list of jaxlib releases.
pip3 install --upgrade pip --no-cache-dir \
&& pip3 install -r /app/alphafold/requirements.txt --no-cache-dir \
&& pip3 install --upgrade --no-cache-dir \
jax==0.3.25 \
jaxlib==0.3.25+cuda11.cudnn805 \
-f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
# Add SETUID bit to the ldconfig binary so that non-root users can run it.
chmod u+s /sbin/ldconfig.real
### SETUID bit does not matter: Apptainer does not allow suid commands
### Workaround below is to use /mnt/out/ld.so.cache for the ld cache file
%environment
export PATH="/opt/conda/bin:/usr/local/cuda-11.1/bin:$PATH"
%runscript
cd /app/alphafold
ldconfig -C /mnt/output/ld.so.cache
exec python /app/alphafold/run_alphafold.py "$@"
# %startscript
# cd /app/alphafold
# exec python /app/alphafold/run_alphafold.py "$@"