How to support nested list with config from sub-directories #2937
maheshkelkar
started this conversation in
General
Replies: 1 comment
-
Composing lists in general is not supported. Example from the OmegaConf docs: cfg = OmegaConf.create(
{
"workers": {
"node3": "10.0.0.2",
"node7": "10.0.0.9",
},
"nodes": "${oc.dict.keys: workers}",
"ips": "${oc.dict.values: workers}",
}
)
# Keys are copied from the DictConfig:
show(cfg.nodes)
type: ListConfig, value: ['node3', 'node7']
# Values are dynamically fetched through interpolations:
show(cfg.ips)
type: ListConfig, value: ['${workers.node3}', '${workers.node7}']
assert cfg.ips == ["10.0.0.2", "10.0.0.9"] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to add config, with nested lists. Outer list is called pods. Each pod has list called containers (i.e. inner list). Instead of duplicating pods and containers config, I want to use it from their individual files in the sub-directories. I am not able to make it work.
I am using: hydra-core==1.3.2.
This blog post here uses dict to make lists work.
I couldn't find any recommendations or ways to make this work. Thank you in advance for ideas/thoughts/comments.
The directory structure for
example/conf
config.yaml
pods/basic.yaml. I need to define "basic" here as mentioned in the blog post; or the config for plusone overwrites it
pods/plusone.yaml. This doesn't work. It simply adds config for "baz" to the overall "site" list (or dict).
pods/containers/foo.yaml
In the end I want to be able to override these pods and containers from the command line
E.g.
Beta Was this translation helpful? Give feedback.
All reactions