Skip to content
Snippets Groups Projects
Commit 03d25dc2 authored by Rodrigo Cortes Mejia's avatar Rodrigo Cortes Mejia
Browse files

docs(faqs): add entry to configure custom datastore_config in res_config

parent 1dda032e
No related branches found
No related tags found
1 merge request!340Resolve "faq entry to set datastore configuration in resconfig"
Pipeline #415093 passed
......@@ -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 os import path
from virtmat.middleware.resconfig import get_resconfig_loc, ResConfig, WorkerConfig
cfg = ResConfig.from_file(get_resconfig_loc())
wcfg = cfg.workers[0]
wcfg.envvars = {'DATASTORE_CONFIG': '/alternative/path_to/my_project/datastore_config.yaml'}
wcfg.default_envvars = ['DATASTORE_CONFIG']
cfg.default_worker = wcfg
cfg.to_file(get_resconfig_loc())
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment