diff --git a/docs/faqs.md b/docs/faqs.md index d368bfbd84df160868b1efdcf2c0548fed6fb800..65a45a6951459a9a4faf58462329ba968f2f60a3 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -26,4 +26,19 @@ cfg.default_worker.accounts.append(None) cfg.default_worker.default_account = None cfg.to_file(get_resconfig_loc()) ``` -Then run `texts` again. Then use the [variable update](scl.md#dealing-with-failures) (using `:=`) to inforce re-evaluation of the resources. A simple `%rerun var` will not be sufficient. \ No newline at end of file +Then run `texts` again. Then use the [variable update](scl.md#dealing-with-failures) (using `:=`) to inforce re-evaluation of the resources. A simple `%rerun var` will not be sufficient. + +**Q**: How can I set a datastore configuration alternative to the default `$HOME/.fireworks/datastore_config.yaml`? + +**A**: This can be done using the [vre-middleware's](https://vre-middleware.readthedocs.io/en/latest/resconfig.html) Python API. For example, within an iPython command line session: +```python +from virtmat.middleware.resconfig import get_resconfig_loc, get_default_resconfig +cfg = get_default_resconfig() +wcfg = cfg.workers[0] # SEE NOTE +wcfg.envvars.update({'DATASTORE_CONFIG': '/alternative/path_to/my_project/datastore_config.yaml'}) +wcfg.default_envvars.append('DATASTORE_CONFIG') +cfg.default_worker = wcfg +cfg.to_file(get_resconfig_loc()) +``` + +**NOTE:** In this example `worker[0]` is assumed as the relevant worker for the datastore configuration. If available, other workers can be selected by using the corresponding index, eg `worker[n]`. \ No newline at end of file diff --git a/docs/io.md b/docs/io.md index 98248840d6afad534de5ce17d611ee7ba8067d7e..b3b5327588233a74721592491c965d2c569247f6 100644 --- a/docs/io.md +++ b/docs/io.md @@ -87,7 +87,7 @@ The default path of the datastore configuration file is `$HOME/.fireworks/datast export DATASTORE_CONFIG=/path/to/datastore_config.yaml ``` -before running the `texts` tool. If the variable `$DATASTORE_CONFIG` should be used then it has to also be added to the `default_envvars` list in the relevant worker as described (here)[https://vre-middleware.readthedocs.io/en/latest/resconfig.html#configuration-of-environment-variables]. +before running the `texts` tool. If the variable `$DATASTORE_CONFIG` should be used then it has to also be added to the `default_envvars` list in the relevant worker as described [here](https://vre-middleware.readthedocs.io/en/latest/resconfig.html#configuration-of-environment-variables). It is not recommended to set `inline-threshold` to very small values, unless you are testing.