Alternative JSON configuration system for OMERO.web #6086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does
This is an experimental implementation of an alternative config system discussed in #6053 (comment)
The configuration format is described in the doc-string of
omero.config.load_json_configs
: https://github.com/openmicroscopy/openmicroscopy/compare/develop...manics:web-json-config?expand=1#diff-5deedb87cde10b4e5f8a28d83b49559aR461This is in OmeroPy not OmeroWeb since we might want to use this elsewhere in future.
To enable the new config system, set the environment variable
OMERO_WEB_CONFIG_DIR
to the directory containing your*.json
config files. Currently these are merged with the existingconfig.xml
properties though this could be easily changed. JSON properties override config.xml ones..yaml
/.yml
config files can also be used if PyYAML is installed.The major change in
omeroweb.settings.py
is the handling the difference between JSON properties which are a typed scalars or objects, and config.xml which is always a string which is converted by OMERO.web where necessary. This means the conversion functions used by OMERO.web to convert the config.xml string value to the type required by OMERO.web have to be aware of the source.This should be backwards compatible so existing config.xml properties will be converted as expected, and furthermore external web-apps that use mapping functions should continue to work if their properties are set using config.xml. It is not possible to use the new JSON config system in apps that haven't been updated.
Testing this PR