-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should OmegaConfigLoader Support Cross-Environment Interpolation? Investigation Required #2465
Comments
We need to verify what the current behaviour is. I would expect that cross-environment interpolation doesn't work. It also doesn't seem like desirable behaviour as it would be hard to reason about how and where the values of the templates come from. |
I agree with the fact that it could be hard to reason about where values come from. But on the other hand, allowing cross-env interpolation would mimic what the |
I have done some testing and cross-env interpolation does not work currently @MatthiasRoels (expected as we never intend to allow it) You are correct that with All of options has some overlap area and we need to think what's the best way. One thing we don't want to see is that people start abusing global everywhere. Allowing cross-env interpolation also make the |
It's true that Our goals is to deprecate the legacy With the The current abstraction of the I hope this explains the thinking that has gone into the Thanks as always for the feedback and discussion @MatthiasRoels, hopefully we'll manage to deliver a solution that solves your need by the time we release |
I am closing down this issue, unless someone think this is really needed. In that case we need to have separate discussion, I think this need to be discussed in a larger context how everything works together. To summarize, Cross-env interpolation is not supported at the moment (expected). |
I agree that this should not be discussed in isolation but rather taken up into a broader config discussion! |
Sorry to flog a dead horse, but I'd like to point out some (personal) experience that I've had with cross-env interpolation and a few other related things. I used to work a lot with the Java Spring ecosystem, and one of the central features there is "easy" and transparent application configuration. To give a small sample of what's possible (I'll be using 'environment' and 'profile' interchangeably here, since that's the equivalent in the Spring world): ---
# Base
# application.yaml
server:
host: localhost
port: 80
---
# Dev-profile specific
# application-dev.yaml
server:
host: dev
client:
url: http://${server.host}:${server.port}/
# URL after interpolation: http://dev:80 The idea is to have a base environment/profile for attributes that change less often and them being overridable in other environments/profiles. Additionally, a grouping of environments is possible: ---
spring:
profiles:
group:
prod: prod_data_lake,prod_settings
---
spring:
config:
activate:
on-profile: prod_data_lake
client:
url: 's3://...'
---
spring:
config:
activate:
on-profile: prod_settings
client:
partition_size: 256mb
# Starting the application with the 'prod' env enables the following:
# client.url: 's3://...'
# client.partition_size: 256mb I realize that this is way out of scope of what Kedro wants to accomplish (since it's not meant for generalized application development), but perhaps these (IMO, really cool) features can inspire some future behaviour in Kedro. On a slightly unrelated note, one of my first bookmarked pages in the Spring Documentation was a page documenting the order of variable interpolation. I feel that a documentation page like this would be really helpful together with the new ConfigLoader. I was surprised more than a few times that e.g. environment variables did not have an effect on any defined placeholders in my catalog. I hope this info can help with future discussions. |
Context:
Parent #2458 An user report that cross-environment interpolation is allowed for
OmegaConfigLoader
.Description
I think it shouldn't be allowed as this can become confusing with the use of
globals
, user then have to check many files to confirm the source of parameters - and it's hard to reason about the resolution order.Possible outcome
This is fine, we should enable
This isn't something we want, figure out what's need to be done to prevent this
About interpolation: do we want to allow interpolation across envs? E.g.
Because that's we currently (want to) do (I think)
Originally posted by @MatthiasRoels in #2458 (comment)
The text was updated successfully, but these errors were encountered: