Skip to content
Snippets Groups Projects

Resolve "faq entry to set datastore configuration in resconfig"

Files
2
+ 14
1
@@ -26,4 +26,17 @@ 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]
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())
```
Loading