-
Notifications
You must be signed in to change notification settings - Fork 51
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
add a way to access the broker's config object outside of the broker #4161
Comments
This is a great idea. I was thinking that we might have to add conditional logic to |
That's a good example. I was actually thinking about configuring optional modules, like the content back end, or doing some configuration dependent garbage collection in rc1 as mentioned in #258 |
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Feb 25, 2022
Problem: flux_get_conf() only works in the broker or its loadable modules; there is no way to access the broker's config from other locations, for example from rc files. Add flux-config get subcommand. Run without arguments, the entire config object is dumped Run wtih a 'path' argument, a subset of the object, or an individual key may be dumped. Output is in compact JSON form. Fixes flux-framework#4161
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Feb 25, 2022
Problem: There is no way to query the broker's configuration object from a shell script such as rc1. Add the "flux-config get" subcommand. If run without arguments, it dumps the entire config object. Otherwise, it walks a period-separated path and dumps the result. By default, the value is printed as compact, string-encoded JSON, unless it is a bare string value, in which case the string is printed without quotes. If the --type=TYPE option is specified, it is an error if the value does not match the type, which may be any jansson type (object, array, integer, string, real, boolean) or one of the following special type names: any - value matches any type (the default) fsd - value must parse as a FSD, printed as its original string form fsd-integer - value must parse as a FSD, printed as integer seconds fsd-real - value must parse as a FSD, printed a real seconds If the requested value is not set, or if the type does not match --type, the program exits with a nonzero exit code. Fixes flux-framework#4161
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Feb 26, 2022
Problem: There is no way to query the broker's configuration object from a shell script such as rc1. Add the "flux-config get" subcommand. If run without arguments, it dumps the entire config object. Otherwise, it walks a period-separated path and dumps the result. By default, the value is printed as compact, string-encoded JSON, unless it is a bare string value, in which case the string is printed without quotes. If the --type=TYPE option is specified, it is an error if the value does not match the type, which may be any jansson type (object, array, integer, string, real, boolean) or one of the following special type names: any - value matches any type (the default) fsd - value must parse as a FSD, printed as its original string form fsd-integer - value must parse as a FSD, printed as integer seconds fsd-real - value must parse as a FSD, printed a real seconds If the requested value is not set, then: - if no --quiet and no --default, an error is printed and program fails - if --quiet, nothing is printed and program fails - if --default, the option argument is printed and program succeeds Fixes flux-framework#4161
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Feb 26, 2022
Problem: There is no way to query the broker's configuration object from a shell script such as rc1. Add the "flux-config get" subcommand. If run without arguments, it dumps the entire config object. Otherwise, it walks a period-separated path and dumps the result. By default, the value is printed as compact, string-encoded JSON, unless it is a bare string value, in which case the string is printed without quotes. If the --type=TYPE option is specified, it is an error if the value does not match the type, which may be any jansson type (object, array, integer, string, real, boolean) or one of the following special type names: any - value matches any type (the default) fsd - value must parse as a FSD, printed as its original string form fsd-integer - value must parse as a FSD, printed as integer seconds fsd-real - value must parse as a FSD, printed a real seconds If the requested value is not set, then: - if no --quiet and no --default, an error is printed and program fails - if --quiet, nothing is printed and program fails - if --default, the option argument is printed and program succeeds Fixes flux-framework#4161
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Feb 28, 2022
Problem: There is no way to query the broker's configuration object from a shell script such as rc1. Add the "flux-config get" subcommand. If run without arguments, it dumps the entire config object. Otherwise, it walks a period-separated path and dumps the result. By default, the value is printed as compact, string-encoded JSON, unless it is a bare string value, in which case the string is printed without quotes. If the --type=TYPE option is specified, it is an error if the value does not match the type, which may be any jansson type (object, array, integer, string, real, boolean) or one of the following special type names: any - value matches any type (the default) fsd - value must parse as a FSD, printed as its original string form fsd-integer - value must parse as a FSD, printed as integer seconds fsd-real - value must parse as a FSD, printed a real seconds If the requested value is not set, then: - if no --quiet and no --default, an error is printed and program fails - if --quiet, nothing is printed and program fails - if --default, the option argument is printed and program succeeds Fixes flux-framework#4161
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem: the config object built from parsing TOML config files is accessible only from the broker and its loadable modules. It may be useful to have a front end utility that can interrogate the config and be used to implement conditional logic in rc scripts (among other things).
Implement a
config.get
RPC in brokercfg.c that fetches the entire config object.The
flux config
utility could add aget
sub-command that either lets you dump the json object, or takes a key in dotted path format to let you dump a subset or bare value.The text was updated successfully, but these errors were encountered: