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

merge devel #13

Merged
merged 15 commits into from
Mar 26, 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
9 changes: 2 additions & 7 deletions .github/workflows/docker-publish-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,8 @@ jobs:

- name: Test minimal image
run: |
bash test/run_tests.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test pm_fast_tests
bash test/run_tests.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test sm_fast_tests
bash test/run_vcs.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test pm_fast_vcs
bash test/run_vcs.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test sm_fast_vcs
bash test/run_tests.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test equilibriumcrystalstructure
bash test/run_tests.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test sp_sm_test

bash test/run_all.sh ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test all

# Re-run the previous buildx action, except this time push the image if needed. Because of caching, this
# does not rebuild the image.
#
Expand Down
40 changes: 39 additions & 1 deletion docker/config/excerpts/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import time
from contextlib import contextmanager

import kim_edn
import kim_property

import pty
import select
import errno
Expand Down Expand Up @@ -188,6 +191,7 @@ def __init__(
subject=None,
result_code="",
verbose=False,
verify=True,
):
"""
A pipeline computation object that utilizes all of the pipeline
Expand All @@ -198,13 +202,17 @@ def __init__(
* subject : A Model
* result_code : if provided, the result will be moved
to the appropriate location
* verify : If True, the contents of results.edn will be verified to contain
valid KIM property instances when the output of the computation is
processed.
"""
self.runner = runner
self.subject = subject
self.runner_temp = runner
self.runtime = -1
self.result_code = result_code
self.verbose = verbose
self.verify = verify
self.info_dict = None
self.uuid = None
self.retcode = None
Expand Down Expand Up @@ -373,11 +381,21 @@ def process_output(self):
properties_reported.sort()
self.info_dict = {"properties": properties_reported}
except Exception:
raise cf.PipelineRuntimeError(
raise cf.PipelineResultsError(
"The results file produced by "
"the Test or Verification Check ({}) is not valid "
"EDN".format(_result_file_path)
)

if self.verify:
# Check whether the entries in results file are valid
# property instances
valid, msg = test_result_valid(_result_file_path)
if not valid:
raise cf.PipelineResultsError(
"Test Result or Verification Result did not conform "
"to property definition\n{}".format(msg)
)

with self.runner_temp.in_dir(), open(
_result_file_path, "w", encoding="utf-8"
Expand Down Expand Up @@ -641,3 +659,23 @@ def append_newline(string):
if len(string) > 0 and string[-1] != "\n":
string += "\n"
return string


def test_result_valid(flname):
"""
Uses the kim_property module to check whether all property instances
contained in file are valid w.r.t. the current KIM property
definitions. See

https://github.com/openkim/kim-property
"""
try:
kim_property.check_property_instances(fi=flname, fp_path=kim_property.get_properties())
except (kim_property.KIMPropertyError, kim_edn.KIMEDNDecodeError):
valid = False
msg = traceback.format_exc()
else:
valid = True
msg = None

return valid, msg
4 changes: 2 additions & 2 deletions docker/git/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ RUN git clone -q https://github.com/openkim/kim-python-utils -b master ${PACKAGE
&& git checkout e4e21b202264373a9f33dfc47b6e05c0af625950
RUN git clone -q https://github.com/openkim/crystal-genome-util -b main ${PACKAGE_DIR}/crystal-genome-util \
&& cd ${PACKAGE_DIR}/crystal-genome-util \
&& git checkout ee3b739636eb7e2562b8baa6799d213caea68019
&& git checkout e18a2d62fc3e391acbf9c98a28efaebca914b007
RUN git clone -q https://github.com/lammps/lammps -b stable_2Aug2023_update1 ${PACKAGE_DIR}/lammps
RUN git clone -q https://gitlab.com/openkim/ase -b user-species ${PACKAGE_DIR}/ase \
&& cd ${PACKAGE_DIR}/ase \
&& git checkout e00c8da0f84fb3a726c411f7ef2792241434c9a3
&& git checkout abe2d6c6e265f7ba6e79cc9b437ef1940731eccc
RUN git clone -q https://gitlab.com/micronano_public/MDpp -b release ${PACKAGE_DIR}/MD++ \
&& cd ${PACKAGE_DIR}/MD++ \
&& git checkout f7d64a7720a4bc1602371a128c8db7779fcf8dcb
4 changes: 2 additions & 2 deletions docker/install/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN ${PIP} install markupsafe==2.0.1
RUN ${PIP} install Jinja2==2.11.3
RUN ${PIP} install edn_format==0.7.5
RUN ${PIP} install kim-edn==1.3.1
RUN ${PIP} install kim-property==2.5.7
RUN ${PIP} install kim-property==2.6.0
RUN ${PIP} install kim-query==3.0.0
RUN ${PIP} install simplejson==3.17.2
RUN ${PIP} install numpy==1.19.5
Expand Down Expand Up @@ -160,7 +160,7 @@ RUN cd ${PACKAGE_DIR}/ase/ \
#########################################
RUN cd ${PACKAGE_DIR}/kim-python-utils \
&& ${PIP} install .

#########################################
## crystal-genome-util
#########################################
Expand Down
4 changes: 2 additions & 2 deletions test/run_vcs.sh → test/run_all.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DOCKER_COMMAND="cd /home/openkim/test_scripts_and_data && bash set_up_and_run_$2.sh && bash compare_vcs.sh $2"
docker run --rm --mount type=bind,src=$PWD/test/test_scripts_and_data,target=/home/openkim/test_scripts_and_data --env LD_LIBRARY_PATH=:/usr/local/lib $1 /bin/bash -c "$DOCKER_COMMAND"
DOCKER_COMMAND="cd /home/openkim/test_scripts_and_data && bash set_up_and_run_$2.sh && python compare_dbs.py $2 && bash compare_vcs.sh $2"
docker run --rm --mount type=bind,src=$PWD/test/test_scripts_and_data,target=/home/openkim/test_scripts_and_data --env LD_LIBRARY_PATH=:/usr/local/lib $1 /bin/bash -c "$DOCKER_COMMAND"
3 changes: 1 addition & 2 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
DOCKER_COMMAND="cd /home/openkim/test_scripts_and_data && bash set_up_and_run_$2.sh && python compare_dbs.py $2"
docker run --rm --mount type=bind,src=$PWD/test/test_scripts_and_data,target=/home/openkim/test_scripts_and_data --env LD_LIBRARY_PATH=:/usr/local/lib $1 /bin/bash -c "$DOCKER_COMMAND"

docker run --rm --mount type=bind,src=$PWD/test/test_scripts_and_data,target=/home/openkim/test_scripts_and_data --env LD_LIBRARY_PATH=:/usr/local/lib $1 /bin/bash -c "$DOCKER_COMMAND"
13 changes: 13 additions & 0 deletions test/test_scripts_and_data/all.grades
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
P
P
P
P
P
P
P
P
N/A
P
P
P
P
Loading
Loading