diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..00718dc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,60 @@ +ARG MAMBA_VERSION=1.5.8 +FROM mambaorg/micromamba:${MAMBA_VERSION}-noble AS base + +# Prevents Python from writing pyc files. +ENV PYTHONDONTWRITEBYTECODE=1 + +# Keeps Python from buffering stdout and stderr to avoid situations where +# the application crashes without emitting any logs due to buffering. +ENV PYTHONUNBUFFERED=1 + +WORKDIR /cadet + +USER root + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get -y install build-essential cmake libhdf5-dev libsuperlu-dev intel-mkl git git-lfs libeigen3-dev && \ + apt-get clean + +RUN git clone https://github.com/cadet/CADET-core CADET + +#RUN git checkout + +RUN mkdir -p CADET/build + +WORKDIR CADET/build + +SHELL ["/bin/bash", "-c"] + +ENV MKLROOT=/opt/intel/mkl + +RUN cmake -DCMAKE_INSTALL_PREFIX="../install" -DBLA_VENDOR=Intel10_64lp_seq ../ + +RUN make -j $(lscpu | grep 'CPU(s)' | head -n 1 | cut -d ':' -f2 | tr -d ' ') install + +USER $MAMBA_USER + +WORKDIR /tmp + +RUN /cadet/CADET/install/bin/cadet-cli --version +RUN /cadet/CADET/install/bin/createLWE -o LWE.h5 +RUN /cadet/CADET/install/bin/cadet-cli LWE.h5 + +# This is the default CADET-RDM Dockerfile content +COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml + +RUN micromamba install -y -n base -f /tmp/environment.yml && \ + micromamba clean --all --yes + +RUN git config --global --add safe.directory /workingdir && \ + git config --global --add safe.directory /workingdir/output && \ + git config --global user.name "IBG_RDM_DOCKER_USER" && \ + git config --global user.email "cadet@fz-juelich.de" + +RUN git clone https://github.com/cadet/CADET-Verification.git /tmp/CADET-Verification +WORKDIR CADET-Verification +# Use filtter=blob:none to reduce the amount of data transfered. +RUN git clone --filter=blob:none https://github.com/cadet/CADET-Verification-Output.git /tmp/CADET-Verification/output +RUN git checkout feature/add_docker_support diff --git a/README.md b/README.md index 8e204fe..e810e3f 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,21 @@ The results of the verification studies can be accessed in the [CADET-Verificati CADET-Verification must be run for deployment and on demand, specifically when critical changes are made to the simulator. +To track results: clone with `rdm clone` instead of `git clone` + The tests are located in the `src` folder. The main script is called `verify_cadet-core`, please refer to the documentation therein for further instruction. The reference data used in some of the tests implemented in CADET-Core can be generated using the corresponding tests defined in CADET-Verification. +To run in a Docker container: +```bash +# 1. if necessary make changes in the Dockerfile +docker build -t cadet-verification . # build Docker container +docker run -v $(pwd):/workingdir -w /workingdir cadet-verification python src/test_cadet_core/verify_cadet-core.py +``` + + ## Contributing We welcome and appreciate all contributions! @@ -27,4 +37,4 @@ We welcome and appreciate all contributions! If you are a CADET-Core developer adding a new feature, you must also include an appropriate set of verification tests or case studies in this repository. This ensures that your contribution meets the quality standards and helps maintain the long-term reliability and maintainability of the project. -Furthermore, contributions aimed at improving or extending the evaluation functions are highly encouraged. \ No newline at end of file +Furthermore, contributions aimed at improving or extending the evaluation functions are highly encouraged. diff --git a/environment.yml b/environment.yml index 385b315..beb2481 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - python=3.12 - - cadet + - cadet==5.0.3 - pip - pip: - scipy @@ -13,5 +13,5 @@ dependencies: - pandas - h5py - joblib - - cadet-python + - cadet-python==1.0.4 - cadet-rdm diff --git a/src/test_cadet_core/verify_cadet-core.py b/src/test_cadet_core/verify_cadet-core.py index ca7a7f0..3a93eaf 100644 --- a/src/test_cadet_core/verify_cadet-core.py +++ b/src/test_cadet_core/verify_cadet-core.py @@ -37,7 +37,7 @@ rdm_debug_mode = False # Run CADET-RDM in debug mode to test if the script works -small_test = False # Defines a smaller test set (less numerical refinement steps) +small_test = True # Defines a smaller test set (less numerical refinement steps) n_jobs = -1 # For parallelization on the number of simulations @@ -45,8 +45,8 @@ exclude_files = None # ["file1", "file2"] # specify h5 files that should not be deleted run_chromatography_tests = True -run_crystallization_tests = True -run_MCT_tests = True +run_crystallization_tests = False +run_MCT_tests = False database_path = "https://jugit.fz-juelich.de/IBG-1/ModSim/cadet/cadet-database" + \ "/-/raw/core_tests/cadet_config/test_cadet-core/" @@ -66,7 +66,7 @@ if run_chromatography_tests: chromatography.chromatography_tests( n_jobs=n_jobs, database_path=database_path+"chromatography/", - small_test=small_test, sensitivities=True, + small_test=small_test, sensitivities=False, output_path=str(output_path) + "/chromatography", cadet_path=cadet_path )