Skip to content

Commit

Permalink
minimal changes to allow changing database path
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-nikiforov-umn committed Jul 30, 2024
1 parent 0397504 commit ef943f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions docker/config/excerpts/default-environment
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit ef943f0

Please sign in to comment.