Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install cp2k from conda #170

Merged
merged 9 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .docker/cp2k-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ label: cp2k
computer: localhost
description:
default_calc_job_plugin: cp2k
filepath_executable: /usr/bin/cp2k
filepath_executable: /opt/conda/envs/cp2k/bin/cp2k.psmp
append_text:
prepend_text:
prepend_text: |
eval "$(command conda shell.bash hook 2> /dev/null)"
conda activate cp2k
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@

FROM aiidateam/aiida-core-with-services:2.5.0


# To prevent the container to exit prematurely.
ENV KILL_ALL_RPOCESSES_TIMEOUT=50


USER root
# Install statically linked CP2K which is a considerably newer release than Debian builtin.
# The statically linked CP2K is a non-MPI binary, but we're running all tests with 1 MPI proc.
RUN set -ex ; \
apt-get update ; \
apt-get install -y --no-install-recommends openmpi-bin locate; \
wget --no-verbose -O /usr/bin/cp2k https://github.com/cp2k/cp2k/releases/download/v8.2.0/cp2k-8.2-Linux-x86_64.ssmp ; \
echo "1e6fccf901873ebe9c827f45fb29331f599772f6e6281e988d8956c7a3aa143c /usr/bin/cp2k" | sha256sum -c ; \
chmod +x /usr/bin/cp2k
apt-get install -y --no-install-recommends libsymspg1

USER aiida

RUN mamba create --yes -c conda-forge -n cp2k cp2k=9.1 && mamba clean --all -f -y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you install the latest version of CP2K?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next step would be to test against multiple versions of cp2k, to make sure the plugin is compatible with all of them.

I am sure the new ones will have issues, so to not blow up the PR I decided to make the change as small as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, would it be possible to also put ARM builds there?

Copy link
Collaborator

@oschuett oschuett Mar 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, would it be possible to also put ARM builds there?

CP2K supports ARM with Linux and macOS. This is also tested on the Dashboard. However, those tests sill use the old Makefile build system. So, adding ARM to the Conda package should be doable, but might require ironing out some CMake issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CP2K supports ARM with Linux and macOS. This is also tested on the Dashboard. However, those tests sill use the old Makefile build system. So, adding ARM to the Conda package should be doable, but might require ironing out some CMake issues.

It is not urgent, but if it could be done at some point - this would be great.


# Install aiida-cp2k plugin.
COPY --chown="${SYSTEM_UID}:${SYSTEM_GID}" . /home/aiida/aiida-cp2k
RUN pip install ./aiida-cp2k[dev,docs]
Expand Down
6 changes: 5 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

@pytest.fixture(scope="function")
def cp2k_code(aiida_local_code_factory):
return aiida_local_code_factory("cp2k", "cp2k")
return aiida_local_code_factory(
entry_point="cp2k",
executable="/opt/conda/envs/cp2k/bin/cp2k.psmp",
prepend_text='eval "$(command conda shell.bash hook 2> /dev/null)"\nconda activate cp2k\n',
)


@pytest.fixture(scope="function", autouse=True)
Expand Down
Loading