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

minimal changes to allow changing database path #19

Merged
merged 2 commits into from
Aug 7, 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
4 changes: 1 addition & 3 deletions docker/config/excerpts/default-environment
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ 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
WORKER_RUNNING_PATH=/tmp

# We install MD/MO/SM to the KIM API user collection
KIM_API_USER_COLLECTION=/home/openkim/.kim-api/
Copy link
Contributor

@dskarls dskarls Aug 4, 2024

Choose a reason for hiding this comment

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

KIM_API_USER_COLLECTION was a special envvar that the KIM API used to inspect when figuring out where to install or load models but it may no longer use it (and it was also only one way to specify that information). As long as you've confirmed that models are installed where you need them to be and are accessible when doing things like pipeline-run-pair, this should be fine.

Copy link
Contributor Author

@ilia-nikiforov-umn ilia-nikiforov-umn Aug 7, 2024

Choose a reason for hiding this comment

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

@dskarls

Confirmed that the current version of the API doesn't know anything about this variable (both commands return nothing)

ilia@ilia-xps:~/kim-api-2.3.0$ grep KIM_API_USER_COLLECTION README.md 
ilia@ilia-xps:~/kim-api-2.3.0$ find -type f | xargs grep KIM_API_USER_COLLECTION 


# types of files that are expected at any one time, should be global
OUTPUT_DIR=output
TEST_EXECUTABLE=runner
Expand Down
3 changes: 2 additions & 1 deletion docker/config/excerpts/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions docker/config/instructions/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.^
Expand Down Expand Up @@ -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.
Expand All @@ -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
-------
Expand Down
4 changes: 2 additions & 2 deletions docker/config/tools/pipeline-database
Original file line number Diff line number Diff line change
Expand Up @@ -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
#==============================================
Expand Down Expand Up @@ -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.""",
Expand Down
Loading