-
Notifications
You must be signed in to change notification settings - Fork 0
/
gromacs_2024.2-GPU.def
79 lines (70 loc) · 2.98 KB
/
gromacs_2024.2-GPU.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
Bootstrap: library
From: ubuntu:22.04
Stage: build
%labels
APPLICATION GROMACS_2024.2-GPU
AUTHOR Analabha Roy
EMAIL [email protected]
YEAR 2024
%help
This container can do MD with GROMACS on nVidia GPU (cuda-11.8+).
1. Can also view molecular structures with nglview.
2. Post processing with mdanalysis is also possible.
3. To start interactive jupyter session, run:
'singularity run --nv -B${PWD}:/host_pwd --pwd /host_pwd <path-to-sif-image>'
Miniforge3 python packages installed:
1. python-3.10
2. acpype
3. ambertools
2. biopython
3. cudatoolkit=11.8
4. gromacs=2024.2=nompi_cuda_h5cb645a_4
5. gromacs_py
6. h5py
7. nbconvert
8. mdanalysis
9. nglview
10. openbabel
11. pdb2pqr
12. seaborn
%environment
export MPLCONFIGDIR=$HOME/.matplotlib
%runscript
#!/bin/bash
# Define the custom path for the Jupyter configuration file
CONFIG_FILE_PATH="$HOME/.jupyter/singularity/jupyter_notebook_config.py"
# Generate Jupyter configuration file at the custom path
jupyter notebook --generate-config -y --config="$CONFIG_FILE_PATH"
# Update the configuration file
echo "c.NotebookApp.ip = '0.0.0.0'" >> "$CONFIG_FILE_PATH"
echo "c.NotebookApp.port = 8888" >> "$CONFIG_FILE_PATH"
echo "c.NotebookApp.open_browser = False" >> "$CONFIG_FILE_PATH"
echo "c.NotebookApp.token = ''" >> "$CONFIG_FILE_PATH"
echo "c.NotebookApp.allow_origin = '*'" >> "$CONFIG_FILE_PATH"
echo "c.NotebookApp.disable_check_xsrf = True " >> "$CONFIG_FILE_PATH"
echo "Notebook configuration updated successfully at $CONFIG_FILE_PATH."
echo "==========================================================================================="
echo "Starting Notebook server on $HOSTNAME. To connect to it thru an HPC, SSH tunnel as follows:"
echo "$ ssh -v -N $USER@$HOSTNAME -J $USER@<login-node> -L 8888:$HOSTNAME:8888"
echo "For direct connection, SSH tunnel as follows:"
echo "$ ssh -v -N $USER@$HOSTNAME -L 8888:$HOSTNAME:8888"
echo "If running locally, just fire up a browser and follow the instructions below"
echo "==========================================================================================="
#Run notebook
jupyter notebook -y --config="$CONFIG_FILE_PATH"
%post
export MPLCONFIGDIR=$HOME/.matplotlib
mkdir -p $MPLCONFIGDIR
# Update, install and cleanup of system packages needed at run-time
apt-get update -y
apt-get upgrade -y
apt-get -y install build-essential wget ca-certificates git
rm -rf /var/lib/apt/lists/*
apt-get clean
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"
/bin/bash ./Miniforge3-Linux-x86_64.sh -bfp /usr/local
conda config --file /.condarc --add channels defaults
conda config --file /.condarc --add channels conda-forge
conda config --file /.condarc --add channels bioconda
conda update conda -y
conda install -c bioconda -c conda-forge nglview mdanalysis gromacs_py gromacs==2024.2=nompi_cuda_h5cb645a_4 -y