From ef943f0d9be58303ccdc88f7019e05e671ae4f6c Mon Sep 17 00:00:00 2001 From: ilia Nikiforov Date: Tue, 30 Jul 2024 17:34:00 -0500 Subject: [PATCH 1/2] minimal changes to allow changing database path --- docker/config/excerpts/default-environment | 1 + docker/config/excerpts/mongodb.py | 3 ++- docker/config/instructions/README.txt | 10 +++++----- docker/config/tools/pipeline-database | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docker/config/excerpts/default-environment b/docker/config/excerpts/default-environment index 65c53a7..fd011ea 100644 --- a/docker/config/excerpts/default-environment +++ b/docker/config/excerpts/default-environment @@ -18,6 +18,7 @@ PIPELINE_VM_MODE=True LOG_DIR=/pipeline/logs LOCAL_REPOSITORY_PATH=/home/openkim/ +LOCAL_DATABASE_PATH=/pipeline/db USE_FULL_ITEM_NAMES_IN_REPO=True # parent directory where things are run by default diff --git a/docker/config/excerpts/mongodb.py b/docker/config/excerpts/mongodb.py index f683dcb..fc69947 100644 --- a/docker/config/excerpts/mongodb.py +++ b/docker/config/excerpts/mongodb.py @@ -15,8 +15,9 @@ from . import kimobjects from .kimcodes import parse_kim_code, isextendedkimid, isuuid +PIPELINE_LOCAL_DB_PATH = cf.LOCAL_DATABASE_PATH -client = MontyClient("/pipeline/db", cache_modified=0) +client = MontyClient(PIPELINE_LOCAL_DB_PATH, cache_modified=0) db = client.db PATH_RESULT = cf.LOCAL_REPOSITORY_PATH diff --git a/docker/config/instructions/README.txt b/docker/config/instructions/README.txt index f74e97a..cc80250 100644 --- a/docker/config/instructions/README.txt +++ b/docker/config/instructions/README.txt @@ -258,9 +258,9 @@ Section IV. Running your content Whereas by default all of the queries in the pipeline.stdin.tpl files of the Tests are directed to query.openkim.org, if you issue `pipeline-database set local`, they will all be directed to a local - database that is stored on disk at /pipeline/db/. Assuming this has been - done (the selection persists between starts/stops of the container), you - can then proceed to run all of the Tests in a dependency hierarchy in + database that is stored on disk at /pipeline/db/ by default. Assuming this + has been done (the selection persists between starts/stops of the container), + you can then proceed to run all of the Tests in a dependency hierarchy in order. In the example above, you would use `pipeline-run-pair` to run your Model or Simulator Model against the fcc Al lattice constant Test and then use it to run against the fcc Al elastic constants Test.^ @@ -575,7 +575,7 @@ Section VI. Command-line utilities (2) import/export a local database using the mongdo db extended json format (3) restore/dump a local database using the bson (binary json) format - The local mongo database is stored at /pipeline/db/ + The local mongo database is stored at /pipeline/db/ by default NOTE: The `kimitems` and `kimgenie` utilities will always perform their queries to the remote OpenKIM database, even if you are using a local database. @@ -599,7 +599,7 @@ Section VI. Command-line utilities pipeline-database delete [-f] - Deletes the local mongo database, which is stored at /pipeline/db/ + Deletes the local mongo database, which is stored at /pipeline/db/ by default Options ------- diff --git a/docker/config/tools/pipeline-database b/docker/config/tools/pipeline-database index 4f41913..69bd133 100755 --- a/docker/config/tools/pipeline-database +++ b/docker/config/tools/pipeline-database @@ -18,7 +18,7 @@ from bson.errors import InvalidBSON import excerpts.config as cf -PIPELINE_LOCAL_DB_PATH = "/pipeline/db/" +PIPELINE_LOCAL_DB_PATH = cf.LOCAL_DATABASE_PATH PIPELINE_ENV_HEADER = """#!/bin/bash #============================================== @@ -145,7 +145,7 @@ it. This utility also allows you to: (2) import/export a local database using the mongdo db extended json format (3) restore/dump a local database using the bson (binary json) format -The local mongo database is stored at /pipeline/db/ +The local mongo database is stored at cf.LOCAL_DATABASE_PATH (/pipeline/db/ by default) NOTE: The `kimitems` and `kimgenie` utilities will always perform their queries to the remote OpenKIM database, even if you are using a local database.""", From f72ea22dca2f2a17e163cf0846ec85d6302aada0 Mon Sep 17 00:00:00 2001 From: ilia Nikiforov Date: Wed, 31 Jul 2024 11:33:16 -0500 Subject: [PATCH 2/2] delete environment variable that doesn't do anything --- docker/config/excerpts/default-environment | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker/config/excerpts/default-environment b/docker/config/excerpts/default-environment index fd011ea..e588710 100644 --- a/docker/config/excerpts/default-environment +++ b/docker/config/excerpts/default-environment @@ -24,9 +24,6 @@ USE_FULL_ITEM_NAMES_IN_REPO=True # parent directory where things are run by default WORKER_RUNNING_PATH=/tmp -# We install MD/MO/SM to the KIM API user collection -KIM_API_USER_COLLECTION=/home/openkim/.kim-api/ - # types of files that are expected at any one time, should be global OUTPUT_DIR=output TEST_EXECUTABLE=runner