Skip to content
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

OMERO.web app configuration style unification and fixes #333

Open
sbesson opened this issue Mar 18, 2022 · 0 comments
Open

OMERO.web app configuration style unification and fixes #333

sbesson opened this issue Mar 18, 2022 · 0 comments

Comments

@sbesson
Copy link
Member

sbesson commented Mar 18, 2022

While reviewed the configuration changes in #332, we realised that our Ansible playbooks use very different styles for setting the OMERO.web app configuration:

  • sls-gallery and learning explicitly set the OMERO.web configuration using the primary omero_web_config_set - see
    omero_web_config_set:
    omero.web.server_list:
    - ["localhost", 4064, "SLS Gallery"]
    omero.web.prefix: '/ome-sls'
    omero.web.static_url: '/ome-sls/static/'
    omero.web.login_redirect:
    redirect:
    - webindex
    viewname: "load_template"
    query_string: "experimenter=-1"
    args:
    - userdata
    omero.web.ui.top_links:
    - ["Image Gallery", "webindex", {"title": "Image Gallery"}]
    - ["HELP", "https://help.openmicroscopy.org/web-client.html", {"title": "Help", "target": "new"}]
    - ["SLS Homepage", "https://www.lifesci.dundee.ac.uk/", {"title": "SLS Homepage", "target": "new"}]
    omero.web.caches:
    default:
    BACKEND: django_redis.cache.RedisCache
    LOCATION: redis://127.0.0.1:6379/0
    omero.web.session_engine: django.contrib.sessions.backends.cache
    omero.web.apps:
    - "omero_iviewer"
    omero.web.open_with:
    - ["Image viewer", "webgateway", {"supported_objects": ["image"], "script_url": "webclient/javascript/ome.openwith_viewer.js"}]
    - ["omero_iviewer", "omero_iviewer_index", {"supported_objects": ["images", "dataset", "well"], "script_url": "omero_iviewer/openwith.js", "label": "OMERO.iviewer"}]
    omero.web.viewer.view: omero_iviewer.views.index
    omero_web_apps_packages:
    - omero-iviewer=={{ omero_web_apps_release.omero_iviewer }}
    omero_web_python_addons:
    - "django-redis<4.9"
    and
    omero_web_config_set:
    omero.web.server_list:
    - ["localhost", 4064, "Virtual Microscope"]
    omero.web.prefix: '/dundee'
    omero.web.static_url: '/dundee/static/'
    omero.web.login_redirect:
    redirect:
    - webindex
    viewname: "webindex_custom"
    omero.web.ui.top_links:
    - ["Virtual Microscope", "webindex", {"title": "Virtual Microscope"}]
    - ["HELP", "https://help.openmicroscopy.org/virtual-microscope.html", {"title": "Help", "target": "new"}]
    omero.web.ui.right_plugins:
    - ["Acquisition", "webclient/data/includes/right_plugin.acquisition.js.html", "metadata_tab"]
    omero.web.caches:
    default:
    BACKEND: django_redis.cache.RedisCache
    LOCATION: redis://127.0.0.1:6379/0
    omero.web.session_engine: django.contrib.sessions.backends.cache
    omero.web.apps:
    - "omero_gallery"
    - "omero_iviewer"
    - "virtualmicroscope"
    omero.web.open_with:
    - ["Image viewer", "webgateway", {"supported_objects": ["image"], "script_url": "webclient/javascript/ome.openwith_viewer.js"}]
    - ["omero_iviewer", "omero_iviewer_index", {"supported_objects": ["images", "dataset", "well"], "script_url": "omero_iviewer/openwith.js", "label": "OMERO.iviewer"}]
    omero.web.viewer.view: omero_iviewer.views.index
    omero.web.public.enabled: true
    omero.web.public.password: "{{ omero_web_public_password | default('public') }}"
    omero.web.public.url_filter: "/(webgateway|gallery)/"
    omero.web.public.user: "{{ omero_web_public_user | default('public') }}"
    omero_web_apps_packages:
    - omero-gallery=={{ omero_web_apps_release.omero_gallery }}
    - omero-iviewer=={{ omero_web_apps_release.omero_iviewer }}
    - omero-virtual-microscope=={{ omero_web_apps_release.omero_virtual_microscope }}
    omero_web_python_addons:
    - "django-redis<4.9"
  • ome-demoserver.yml converts three Jinja template containing a series of config append and config set subcommands into configuration files
    - name: Config for OMERO.web plugins
    become: yes
    template:
    src: templates/omero-web-config-for-webapps.j2
    dest: "{{ omero_web_basedir }}/config/omero-web-config-for-webapps.omero"
    owner: "root"
    group: "root"
    mode: "u=rw,go=r"
    notify:
    - restart omero-web
    - name: OMERO.web config for CORS
    become: yes
    template:
    src: templates/omero-web-config-for-cors.j2
    dest: "{{ omero_web_basedir }}/config/omero-web-config-for-cors.omero"
    owner: "root"
    group: "root"
    mode: "u=rw,go=r"
    notify:
    - restart omero-web
    - name: OMERO.web config for signup app
    become: yes
    template:
    src: templates/omero-web-config-signup.j2
    dest: "{{ omero_web_basedir }}/config/omero-web-config-signup.omero"
    # Contains sensitive info
    owner: "root"
    group: "omero-web"
    mode: "0640"
    notify:
    - restart omero-web
    no_log: true
  • nightshade-webclients.yml uses a combination of omero_web_apps_names, omero_web_apps_packages, omero_web_apps_top_links, omero_web_apps_config_append and omero_web_apps_config_set - see
    omero_web_apps_names:
    - omero_figure
    - omero_fpbioimage
    - omero_iviewer
    - omero_parade
    - omero_webtagging_autotag
    - omero_webtagging_tagsearch
    omero_web_apps_packages:
    - "omero-figure=={{ omero_figure_release }}"
    - "omero-fpbioimage=={{ omero_fpbioimage_release }}"
    - "omero-iviewer=={{ omero_iviewer_release }}"
    - "omero-parade=={{ omero_parade_release }}"
    - "omero-webtagging-autotag=={{ omero_webtagging_autotag_release }}"
    - "omero-webtagging-tagsearch=={{ omero_webtagging_tagsearch_release }}"
    omero_web_apps_top_links:
    - label: Figure
    link: figure_index
    attrs:
    title: Open Figure in new tab
    target: _blank
    - label: Tag Search
    link: tagsearch
    omero_web_apps_config_append:
    omero.web.open_with:
    - - omero_figure
    - new_figure
    - supported_objects:
    - images
    target: _blank
    label: OMERO.figure
    - - omero_fpbioimage
    - fpbioimage_index
    - supported_objects:
    - image
    script_url: fpbioimage/openwith.js
    label: FPBioimage
    - - omero_iviewer
    - omero_iviewer_index
    - supported_objects:
    - images
    - dataset
    - well
    script_url: omero_iviewer/openwith.js
    label: OMERO.iviewer
    omero.web.ui.center_plugins:
    - - Auto Tag
    - omero_webtagging_autotag/auto_tag_init.js.html
    - auto_tag_panel
    - - Parade
    - omero_parade/init.js.html
    - omero_parade
    omero_web_apps_config_set:
    omero.web.viewer.view: omero_iviewer.views.index
  • omero/training-server/playbook.yml copies a .omero file containing a series of omero config set and omero config append commands into the configuration directory - see
    - name: Outreach only config for OMERO.web plugins
    become: yes
    template:
    src: files/omero-web-outreach-webapps.omero
    dest: "{{ omero_web_basedir }}/config/omero-web-outreach-webapps.omero"
    owner: "root"
    group: "root"
    mode: "u=rw,go=r"
    notify:
    - restart omero-web

For comparison, the IDR deployment playbooks use a style most closest to nightshade-webclients i.e. the built-in omero_web_apps* variables supplemented by omero_web_apps_config_append and omero_web_apps_config_set -see https://github.com/IDR/deployment/blob/77b759ce21f2a165903aa5cbea7fcb673fcf55a8/ansible/group_vars/omero-hosts.yml#L162-L604

The mixture of styles is particularly confusing. Deciding on the preferred style(s) and applying them systematically would certainly reduce maintenance.

A related issue highlighted by the progression #332 is that extreme care should be put in the usage of the _append variables. The configuration files stored under /opt/omero/web/config are loaded as part of the omero-web service lifecycle. Internally omero config append includes some logic avoiding the duplication of a value in a configuration list. However, removing a value from a list e.g. unregistering a web app requires more thoughts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant