-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(*): Adds initial config interface implementation #4
Conversation
Please note that I'll be intermittently available the rest of the week and completely unavailable next week, so if I don't respond, that is why! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a first glance, this looks reasonable to me; nice! I included some nits, but I don't feel super-strongly about them, so happy to discuss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing. Mostly LGTM just added one comment on the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly looked at this months ago (#2) and came to the conclusion that - for the use cases I was coming up with - there wasn't much benefit to a separate runtime config interface over just implementing as a KV store.
As @Mossaka asked inline I think it would be really helpful to understand concrete use cases here and in particular where those use cases wouldn't be well served by wasi-keyvalue.
/// Gets a single opaque config value set at the given key if it exists | ||
get: func(key: string) -> result<option<list<u8>>, config-error>; | ||
/// Gets a list of all set config data | ||
get-all: func() -> result<list<tuple<string, list<u8>>>, config-error>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are some use cases for get-all
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some apps and libraries iterate over environment variables to look for prefix matches, e.g. "find all variables starting with FOO_BAR_" as a way of encoding a variable-length map or list. So perhaps this would make it easier to port such software.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah @dicej had it right. There is also a use case where you want to fetch all the config once and then iterate over it in memory rather than doing individual fetches
Great question @lann! So there are definitely some distinct differences between KV and config. But more importantly, the ultimate goal here are interfaces that increase interoperability. This is the absolute bare minimum interface that heads towards that goal and allows a component to indicate very clearly that "I am looking for config" rather than a datastore. Some additional points:
|
This is the most basic functionality needed to have a shared config interface that all components could use. It's goal is simplicity. There are many things we could add/polish, and all of those are called out in the documentation. For reference, this is what we are using in wasmCloud, but we aren't married to the interface as is. What we want is the ability for any runtime to be able to provide configuration to the components it is running in a standardized way. That will make it possible to actually have the cross runtime/platform experience that components promise Signed-off-by: Taylor Thomas <taylor@cosmonic.com>
09092fa
to
c768db1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asked some questions, otherwise it LGTM
all sorts of crazy things with configuration values! Calling entirely different branches of code, | ||
setting upstream URLs or services, configuring the number of threads to use, etc. | ||
2. toggling on/off feature flags | ||
3. A/B testing | ||
|
||
and many more use cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is secrets management in-scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting discussion. For now, I'm going to say no. But I think that access to secret values could be through this interface. Implementors (generally hosts) would need to make sure that secret values are injected into the available config
all sorts of crazy things with configuration values! Calling entirely different branches of code, | ||
setting upstream URLs or services, configuring the number of threads to use, etc. | ||
2. toggling on/off feature flags | ||
3. A/B testing | ||
|
||
and many more use cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some advanced features I've seen from runtime config providers like Google Cloud's Runtime Configurator are:
- versioning,
- hierarchy
- watching
Although this spec does not have to include any of above features but I would like to see they are mentioned somewhere in the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want those called out as "not addressed right now, but maybe in the future" or do you want it mentioned in some other way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling out as not addressed right now is good.
I am going to merge this PR. This can be added later.
This is the most basic functionality needed to have a shared config interface that all components could use. It's goal is simplicity. There are many things we could add/polish, and all of those are called out in the documentation. For reference, this is what we are using in wasmCloud, but we aren't married to the interface as is. What we want is the ability for any runtime to be able to provide configuration to the components it is running in a standardized way. That will make it possible to actually have the cross runtime/platform experience that components promise