Skip to content

Commit

Permalink
Included critic2 python codes and lammps, tensorflow, pytorch and spm…
Browse files Browse the repository at this point in the history
… tools
  • Loading branch information
Daniele Passerone committed Feb 12, 2025
1 parent 09244a9 commit 030413c
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 30 deletions.
53 changes: 49 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,64 @@ FROM aiidalab/full-stack:2025.1025

USER root


#RUN apt-get update -y && apt-get install -y cp2k && apt-get clean -y
# Install required system dependencies, including MPI development libraries
RUN apt-get update -y && apt-get install -y cp2k libmpich-dev libopenmpi-dev build-essential && apt-get clean -y

USER ${NB_USER}




RUN mkdir /home/${NB_USER}/opt

RUN cd /home/${NB_USER}/opt && git clone https://github.com/lammps/lammps && cd lammps/src && make lib-pace args="-b" && make yes-molecule && make yes-reaxff && make yes-rigid && make yes-ml-pace && make yes-manybody && make lib-voronoi args="-b" && make yes-voronoi && make mpi
RUN pip install virtualenv

ENV deepmd_root=/home/${NB_USER}/opt/deepmd-kit
ENV deepmd_source_dir=/home/${NB_USER}/opt/deepmd-kit
ENV tensorflow_venv=/home/${NB_USER}/opt/tensorflow_venv
ENV deepmd_root=/home/${NB_USER}/opt/deepmd-kit

RUN cd /home/${NB_USER}/opt && git clone https://github.com/deepmodeling/deepmd-kit.git deepmd-kit



RUN virtualenv -p python3 $tensorflow_venv

RUN source $tensorflow_venv/bin/activate


RUN pip install --upgrade tensorflow

RUN cd $deepmd_source_dir && pip install .

RUN cd $deepmd_source_dir/source && mkdir build && cd build

RUN cd $deepmd_source_dir/source/build && pwd && pip install -U cmake && cmake -DUSE_TF_PYTHON_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=$deepmd_source_dir .. && make && make install

RUN cd $deepmd_source_dir/source/build && make lammps


RUN cd /home/${NB_USER}/opt && git clone https://github.com/lammps/lammps && cd lammps/src && cp -r $deepmd_source_dir/source/build/USER-DEEPMD . && make lib-pace args="-b" && make yes-molecule && make yes-reaxff && make yes-rigid && make yes-ml-pace && make yes-manybody && make lib-voronoi args="-b" && make yes-voronoi && make lib-plumed args="-b" CC=gcc CXX=g++ && make yes-plumed && make yes-kspace && make yes-extra-fix && make yes-user-deepmd && make serial

RUN deactivate

USER root

RUN cp /home/${NB_USER}/opt/lammps/src/lmp_mpi /usr/bin/lmp_mpi
RUN cp /home/${NB_USER}/opt/lammps/src/lmp_serial /usr/bin/lmp_serial

USER ${NB_USER}

ENV JUPYTER_TERMINAL_IDLE_TIMEOUT=3600
ENV ASE_LAMMPSRUN_COMMAND="/opt/conda/bin/mpirun --np 2 /usr/bin/lmp_mpi"
ENV ASE_LAMMPSRUN_COMMAND="/usr/bin/lmp_serial"

RUN rm -rf /home/${NB_USER}/opt/lammps/

RUN pip install nglview

RUN pip install mdtraj

RUN pip install --user skmatter

RUN cd opt && git clone https://github.com/lab-cosmo/librascal.git && cd librascal && pip install --user .
Expand All @@ -35,7 +72,8 @@ RUN pip install --user spglib

RUN pip install pythtb

RUN conda install -c conda-forge mpi4py
#RUN conda install -c conda-forge mpi4py
RUN pip install cp2k-spm-tools

COPY configs /home/${NB_USER}/configs

Expand All @@ -44,3 +82,10 @@ COPY before-notebook.d/* /usr/local/bin/before-notebook.d/
RUN pip install scikit-learn optuna xgboost lightgbm sympy pandas

RUN pip install torch torchmetrics torchvision


RUN cd /home/${NB_USER}/opt && git clone https://github.com/aoterodelaroza/critic2.git

RUN cd /home/${NB_USER}/opt/critic2 && mkdir build && cd build && cmake .. && make

RUN pip install pymatgen scikit-image
2 changes: 1 addition & 1 deletion before-notebook.d/70_setup_cp2k.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ if verdi code list | grep -q 'cp2k@localhost'; then
echo "CP2K code found"
else
echo "CP2K code not found, creating"
verdi code create core.code.installed --config /home/${NB_USER}/configs/cp2k.yaml
verdi code create core.code.installed --config /home/${NB_USER}/configs/cp2k.yml
fi
2 changes: 1 addition & 1 deletion before-notebook.d/71_setup_stm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ if verdi code list | grep -q 'stm@localhost'; then
echo "STM code found"
else
echo "STM code not found, creating"
verdi code create core.code.installed --config /home/${NB_USER}/configs/stm.yaml
verdi code create core.code.installed --config /home/${NB_USER}/configs/stm.yml
fi
12 changes: 12 additions & 0 deletions before-notebook.d/72_setup_critic2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

#!/bin/bash -e

# Debugging.
set -x

if verdi code list | grep -q 'critic2@localhost'; then
echo "critic2 code found"
else
echo "critic2 code not found, creating"
verdi code create core.code.installed --config /home/${NB_USER}/configs/critic2.yml
fi
23 changes: 0 additions & 23 deletions before-notebook.d/72_setup_stm_tools.sh

This file was deleted.

12 changes: 12 additions & 0 deletions before-notebook.d/73_setup_python-py39.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

#!/bin/bash -e

# Debugging.
set -x

if verdi code list | grep -q 'python-py39@localhost'; then
echo "python-py39 code found"
else
echo "python-py39 code not found, creating"
verdi code create core.code.installed --config /home/${NB_USER}/configs/python.yml
fi
File renamed without changes.
8 changes: 8 additions & 0 deletions configs/critic2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
append_text: ' '
computer: localhost
default_calc_job_plugin: critic2
description: critic2 at daint alps
filepath_executable: /home/jovyan/opt/critic2/build/src/critic2
label: critic2
prepend_text: ''
use_double_quotes: 'False'
8 changes: 8 additions & 0 deletions configs/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
append_text: ' '
computer: localhost
default_calc_job_plugin: pythonjob.pythonjob
description: python at daint alps
filepath_executable: /opt/conda/bin/python
label: python-py39
prepend_text: ' '
use_double_quotes: 'False'
2 changes: 1 addition & 1 deletion configs/stm.yaml → configs/stm.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
label: "stm"
description: "stm code from https://github.com/nanotech-empa/cp2k-spm-tools.git"
default_calc_job_plugin: "nanotech_empa.stm"
filepath_executable: "/home/jovyan/soft/cp2k-spm-tools/stm_sts_from_wfn.py"
filepath_executable: "/home/jovyan/.local/bin/cp2k-stm-sts-wfn"
computer: "localhost"
prepend_text: " "
append_text: " "
Expand Down

0 comments on commit 030413c

Please sign in to comment.