Giter Site home page Giter Site logo

ome / prod-playbooks Goto Github PK

View Code? Open in Web Editor NEW
4.0 9.0 19.0 1.31 MB

Playbooks used by the OME team for deploying production services including OMERO

Home Page: https://www.openmicroscopy.org/omero

License: BSD 2-Clause "Simplified" License

Python 68.50% Jinja 31.50%
ansible playbooks omero deployment production

prod-playbooks's Introduction

OME production services playbooks

These playbooks encapsulate the running of various production servers run by the OME team. If you are looking for examples of running your own production OMERO.server see

https://github.com/ome/omero-deployment-examples

Details

For details of individual playbooks see the comments in site.yml.

Testing

All server playbooks have a corresponding molecule test scenario under molecule.

prod-playbooks's People

Contributors

dgault avatar hflynn avatar jburel avatar joshmoore avatar kennethgillen avatar manics avatar mtbc avatar pwalczysko avatar sbesson avatar stephenogg avatar will-moore avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prod-playbooks's Issues

Review infra PRs for modifications

@manics pointed out that a number of discussions had been had regarding the prod playbooks. The ones I've found are:

These should be reviewed for modifications. Positive outcomes would include:

  • trusting -C --diff on production hosts
  • trusting site.yml to run periodically
  • refactoring into idempotent tasks
  • reducing duplication between the playbooks here

Disable PixelData service on training servers

We have recently been faced with the import of data a that does not meet the multi-resolution criteria for large images cross multiple users. This leads to large pyramids been generated (even if the data is in-place imported) and can put the system at risk. Similarly to the approach taken on several production deployments, the PixelData service could be fully disabled on the training servers especially if none of the training workflows should rely on the pyramid generation at the moment.

The omero.server.nodedescriptors configuration property should allow to select the services that need to be enabled at server startup.

In the case of IDR, we only enable Blitz and Tables

https://github.com/IDR/deployment/blob/a5871ed5fc144158fbe8d830ae062cc6d6e6417c/ansible/group_vars/omero-hosts.yml#L110-L111

For the training server, we probably also want to keep Processor-0 (for OMERO.scripts) and Indexer-0 (for the Lucene indexing).

"Download the Figure_To_Pdf.py script" fails when omero_figure_release is 4.4.0

TASK [Download the Figure_To_Pdf.py script] ********************************************************************
fatal: [206.12.95.221]: FAILED! => {"changed": false, "dest": "/opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts/Figure_To_Pdf.py", "elapsed": 0, "msg": "Request failed", "response": "HTTP Error 404: Not Found", "status_code": 404, "url": "https://raw.githubusercontent.com/ome/omero-figure/v4.4.0./omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py"}

I think this is due to the fact that on PyPi, omero-figure is released at 4.4.0, but in the Github repo, the latest release is 4.3.1.

OME Schemas migration

Current deployment

The OME schemas, available publicly from https://www.openmicroscopy.org/Schemas/ are composed of:

  • the specification files (xsd), transforms (xslt) and index pages, generated from the source files under https://github.com/ome/ome-model
  • the HTML documentation generated using oXygen Editor from the live schemas

At the moment, the schema pages are hosted on www-legacy.openmicroscopy.org:

These locations are then proxied from www-legacy.openmicroscopy to www.openmicroscopy.org

- location: /Schemas
server: https://www-legacy.openmicroscopy.org/Schemas
- location: /XMLschemas
server: https://www-legacy.openmicroscopy.org/XMLschemas
- location: /schema_doc
server: https://www-legacy.openmicroscopy.org

Specification migration

A first step towards the simplification of this deployment was performed in ome/www.openmicroscopy.org#420 with the inclusion of the specification, transforms and index pages as part of the static OME Jekyll website - see https://ome.github.io/www.openmicroscopy.org/Schemas/. As per the proxy configuration above, these pages are not the ones used in production yet.

Generated documentation migration

In order to get rid of the www-legacy -> www proxying, the generated oXygen documentation also needs to be migrated.

The paragraph below discusses a few deployment options. All of them assume that:

  1. deploy the static generation under https://www.openmicroscopy.org/schema_doc (similar to the read-only phpBB forums -
    - role: ome.deploy_archive
    become: yes
    deploy_archive_dest_dir: /var/www
    deploy_archive_src_url: https://downloads.openmicroscopy.org/web-archive/phpbbforum-20190718.tar.gz
    deploy_archive_sha256: e9d7a7eefbacf42ddbdf92b201584913cb6d94ec331750f811232b2e91aa5b40
    # This file is patched later so only unzip if it doesn't exist
    when: not _phpbbforum_style_file_st.stat.exists
    and
    # Static copy of old phpBB forums: treat query params as part of filename
    - location: "~ ^/community/style.php.*"
    root: /var/www/phpbbforum/www.openmicroscopy.org
    custom:
    - try_files $request_uri $uri =404
    - default_type text/css
    - location: "~ ^/community/?$"
    redirect301: /community/index.php
    - location: /community
    root: /var/www/phpbbforum/www.openmicroscopy.org
    custom:
    # Need to exclude extra query parameters in incoming external links
    # e.g. sid=
    # If an exact match isn't found try just these parameters:
    # [f, t, p], [f, t], [f]
    - >-
    try_files
    $request_uri
    $uri?f=$arg_f&t=$arg_t&p=$arg_p
    $uri?f=$arg_f&t=$arg_t
    $uri?f=$arg_f
    =404
    - default_type text/html
    ), add some nginx redirects to serve these under the /Schemas/Documentation/Generated
    • pros: close to the current deployment, minimal amount of redeployment for the generated documentation
    • cons: requires some investigation for the nginx configuration
  2. commit the generated documentation pages under https://github.com/ome/schemas, include these pages in the OME static website artifact and have it deployed as part of each update
  • pros: minimal amount of redirection/nginx configuration
  • cons: increased size for the static website, might force to manage copies more proactively
  1. redirect https://www.openmicroscopy.org/Schemas/Documentation/Generated to a third-party location hosting the oXygen schema documentation
  • pros: separates the official specification from the documentation
  • cons: with the migration of the content away from docs.openmicroscopy.org, need to define a hosting platform

Learning maintenance: evaluate script moving users to a disabled group

The UoD SLS learning system is getting heavily used during the academic term with new students logging into the resource using their University credentials and being mapped into the default group containing the course supporting data to allow access - see

omero.ldap.base: "{{ omero_server_ldap_base }}"
omero.ldap.username: "{{ omero_server_ldap_username }}"
omero.ldap.password: "{{ omero_server_ldap_password | default('') }}"
omero.ldap.user_filter: "{{ omero_server_ldap_user_filter }}"
omero.ldap.new_user_group: "{{ omero_server_ldap_new_user_group }}"
.

Eventually, many teaching semesters lead to the creation of several 100s of users in the single group. This causes performance degradation on the OMERO.web deployment as several of the queries start to run more slowly.

At the moment, the OME team runs periodically ad-hoc maintenance scripts on the system to reduce the number of users in the group. On the image.sc forum, a similar problem was discussed with a script being shared which allows to move stale users into a "graveyard" group - see https://forum.image.sc/t/omero-user-scripted-inactivation/70767/3.

For the next maintenance, we might want to evaluate whether this script could be adapted to the requirements of the SLS learning deployment and used to move students from the former year to another group to restore performance.

ome-demoserver.yml with current inventory/prod-hosts has two tasks that always show as changed

ome-demoserver.yml with current inventory/prod-hosts has two tasks that always show as changed:

TASK [Create a figure scripts directory] ***************************************
task path: /Users/spli/omesys/management_tools/prod/playbooks/ome-demoserver.yml:292
changed: [ome-demoserver.openmicroscopy.org] => {"changed": true, "gid": 990, "group": "omero-server", "mode": "0755", "owner": "root", "path": "/opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts", "size": 162, "state": "directory", "uid": 0}

TASK [Download the Figure_To_Pdf.py script] ************************************
task path: /Users/spli/omesys/management_tools/prod/playbooks/ome-demoserver.yml:301
changed: [ome-demoserver.openmicroscopy.org] => {"changed": true, "dest": "/opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts/Figure_To_Pdf.py", "gid": 0, "group": "root", "mode": "0644", "msg": "file already exists but file attributes changed", "owner": "root", "size": 77648, "state": "file", "uid": 0, "url": "https://raw.githubusercontent.com/ome/omero-figure/v4.0.0/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py"}
META: ran handlers

Enable www/redirect tests

Enable www/redirect tests
These were disabled in #211 due to timeouts on Travis. See the issue for potential and failed workarounds

Production server playbooks: broken installation of reportlab

See https://github.com/ome/prod-playbooks/runs/3462688112 and https://github.com/ome/prod-playbooks/runs/3462688217.

The same issue as the one reported in https://forum.image.sc/t/omero-reportlab-fails-to-install-with-gcc-error/56552 now affects the Molecule testing of our current SLS OMERO playbooks. This leaves us with the same range of workarounds:

  • install gcc and python3-devel on these servers
  • install python-reportlab
  • cap reportlab ?
  • look into alternative options

/cc @will-moore @pwalczysko

Mount data volumes on training servers

Design of an ansible feature in the training playbook which would insert a loop into the training playbook iterating over a list of directories to be mounted as a volume on the training servers governed by training playbook
The list would be by default empty inside the public training playbook playbook, but it would consume an override private variable.
This feature is mainly motivated by new addition of idr data such as ome/omero-figure#431 (comment) but can be useful for external users of the training playbook as they can replace the list of the directories accordingly for their environment.

cc @sbesson

OMERO.web prerequisites aren't updated on upgrades

For some reason https://github.com/openmicroscopy/openmicroscopy/blob/v5.4.9/components/tools/OmeroWeb/requirements-py27-all.txt doesn't appear to be re-evaluated on OMERO.web upgrades for at least

  • ome-demoserver.yml

This may well be an issue with https://github.com/openmicroscopy/ansible-role-omero-web rather than the "prod playbook", but at least a workaround can be written in this repo, and I'd class this repo as the place to leave a top-level issue with the config of a server defined here.

SLS Gallery and Virtual Microscope playbooks don't restart web

learning.yml and sls-gallery.yml have omero_web_systemd_start: False because there was originally an issue that the playbook would not work correctly for a fresh install, perhaps because the web server was started before all configuration and certificates were yet in place.

OMERO.web app configuration style unification and fixes

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

Add support for SLA

The OMERO sign-up application has been deployed in production onto the OME Demo server

Screen Shot 2019-08-21 at 11 33 02

As a RFE, it would be useful to display the Service Level Agreement (SLA), either as a pop-up or as a separate static page linked from the signup page.

OME demo server: fix DH key exchange errors

See https://forum.image.sc/t/omero-in-place-import-dh-key-too-small/83219/7

The server is currently hosted on CentOS7 and is affected by the DH key exchange errors when connecting from e.g. Ubuntu 22.04 as discussed in https://forum.image.sc/t/omero-login-ssl-error-dh-key/79574.

Work is ongoing to update omero-certificates (see ome/omero-certificates#33) and the OMERO documentation (ome/omero-documentation#2315) with recommendations on how to update the server configuration. Once these are finalized, these recommendations should likely be applied via the playbook.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.