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

Prep for idr #4

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 55 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
OMERO MS Image Region
=====================

[![Actions Status](https://github.com/ome/ansible-role-omero-server/workflows/Molecule/badge.svg)](https://github.com/ome/ansible-role-omero-server/actions)
[![Ansible Role](https://img.shields.io/badge/ansible--galaxy-omero_ms_image_region-blue.svg)](https://galaxy.ansible.com/ui/standalone/roles/ome/omero_server/)
[![Actions Status](https://github.com/ome/ansible-role-omero-ms-image-region/workflows/Molecule/badge.svg)](https://github.com/ome/ansible-role-omero-ms-image-region/actions)
[![Ansible Role](https://img.shields.io/badge/ansible-galaxy-omero_ms_image_region-blue.svg)](https://galaxy.ansible.com/ui/standalone/roles/ome/omero_ms_image_region/)

Installs and configures OMERO ms image region
Installs and configures the OMERO microservice image region.

Dependencies
------------
Expand All @@ -15,31 +15,31 @@ OMERO.server and OMERO.web are required.
Role Variables
--------------

- omero_ms_image_region_user: Microservice user, the defaults is 'omero-server'
- omero_ms_image_region_folder: Microservice installation folder
- omero_ms_image_region_port: Microservice port
- omero_ms_image_region_db_url: OMERO database URL
- omero_ms_image_region_db_port: OMERO database server port
- omero_ms_image_region_db_name: OMERO database name
- omero_ms_image_region_db_username: OMERO database user name
- omero_ms_image_region_db_pass: OMERO database user password
- omero_ms_image_region_log_level: Logging level, allowed values: ``info``, ``debug``, ``error``
- omero_data_dir: OMERO data folder
- omero_script_repo_root: OMERO scripts folder
- omero_ms_image_region_worker_pool_size: No of Microservice workers, the default is double the number of processors which the machine has
- session_id: OMERO Session id, if you do not know it, you may get it using this command:
- omero_ms_image_region_max_active_channels: Max number of channels to allow per request default is 10
- `omero_ms_image_region_user`: The microservice user, the default is `omero-server`
- `omero_ms_image_region_folder`: The microservice installation folder
- `omero_ms_image_region_port`: The microservice port
- `omero_ms_image_region_db_url`: The OMERO database URL
- `omero_ms_image_region_db_port`: The OMERO database server port
- `omero_ms_image_region_db_name`: The OMERO database name
- `omero_ms_image_region_db_username`: The OMERO database user name
- `omero_ms_image_region_db_pass`: The OMERO database user password
- `omero_ms_image_region_log_level`: The logging level, allowed values: ``info``, ``debug``, ``error``
- `omero_data_dir`: The OMERO data folder
- `omero_script_repo_root`: The OMERO scripts folder
- `omero_ms_image_region_worker_pool_size`: Number of microservice workers, the default is double the number of available processors
- `session_id`: The OMERO session identifier, if you do not know it, you may get it using this command:

/opt/omero/web/OMERO.web/bin/omero config get omero.web.session_cookie_name
/opt/omero/web/OMERO.web/bin/omero config get omero.web.session_cookie_name

- omero_ms_image_region_update_nginx: if false, it will not update the nginx config file
- `omero_ms_image_region_max_active_channels`: The maximum number of channels to allow per request, the default is `10`
- `omero_ms_image_region_update_nginx`: if set to `false`, it will not update the NGINX configuration file
- `omero_ms_image_region_download_URL`: The download URL for the distributed microservice build (zip file)
- `omero_ms_image_region_package_sha256`: The sha256 for the distributed microservice build
- `java_version`: The Java version matching the server version. Supported versions are 11, 17 and 21

- omero_ms_image_region_download_URL: The download URl for the distibuted ms build (zip file)
- omero_ms_image_region_package_sha256: The sha256 for the distibuted ms build

The ms build should be compatible with the installed OMERO.server, i.e.:
- The bio-format version for the Microservice should match the Bio-Formats version of the OMERO.server
- Also, in case of using ngff data, the version of OMEZarrReader should be the same for both of the Microsevice and the OMERO.server.
The microservice build **must be compatible** with the installed OMERO.server:
- The Bio-Formats version used in the microservice must match the Bio-Formats version of the OMERO.server.
- Also, in the case of using NGFF data, the version of OMEZarrReader should be the same for both the Microsevice and the OMERO.server.

Example Playbook
----------------
Expand All @@ -48,3 +48,33 @@ Example Playbook
roles:
- role: ome.omero_ms_image_region
omero_ms_image_region_update_nginx: true

Another example:
----------------
The following example is used to deploy in multiple nodes and configure the microservice download url and other roles variables
For example, it can be used to deploy the microservice on the IDR omeroreadonly servers. The variable values inside the playbook should be modified for the IDR environment in which the microservice will be deployed.

- hosts: nodes
become: true

roles:
- role: ome.omero_ms_image_region
omero_ms_image_region_update_nginx: true
omero_ms_image_region_db_url: databse_url
omero_ms_image_region_db_name: database_name
omero_ms_image_region_db_username: database_username
omero_ms_image_region_db_pass: database_password
omero_data_dir: /data/OMERO
omero_ms_image_region_session_id: sessionid
# URL pointing to the micro service omero-ms-region-download
# It is important to have a version of the micro service using a version of Bio-Formats and OMEZarrReader than
# match the versions running on the server
omero_ms_image_region_download_URL: 'https://github.com/ome/omero-ms-image-region/releases/download/2024.07.15/omero-ms-image-region-0.10.0_b16.zip'
# sha256 for the Latest build
omero_ms_image_region_package_sha256: 77bd3df2241c2beb439001fb00bfd8b207a06de63b8ee78c7170916d6dde963e


Author Information
------------------

[email protected]
19 changes: 15 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,22 @@ omero_ms_image_region_session_id: 'sessionid'
# Controls updating of the nginx config file (omero-web.conf). If False, the file does not get update
omero_ms_image_region_update_nginx: false

# Microservice download URL should be updated to match Bio-Formats versions of the Microservice and OMERO.server.
#Also, the OMEZarrReader (if NGFF is used) versions of the Microservice and OMERO.server must match.
omero_ms_image_region_download_URL: 'https://github.com/khaledk2/ice-archh-64/releases/download/new_tag/omero-ms-image-region-0.8.7.zip'
java_version: 11

all_omero_ms_image_region_download_URL:
11:
url: "https://github.com/ome/omero-ms-image-region/releases/download/2024.07.22/omero-ms-image-region-0.10.0_11.zip"
sha256: 5b5f907a28191d311819c57d3c93bd918a679c92a5c74803bc8dbe3bb17ca45c
17:
url: "https://github.com/ome/omero-ms-image-region/releases/download/2024.07.22/omero-ms-image-region-0.10.0_17.zip"
sha256: 1a46201d6f20cb3e0520116f6eeb9b9f2396e666a4ef8b51d7fac4def5d59ef1
21:
url: "https://github.com/ome/omero-ms-image-region/releases/download/2024.07.22/omero-ms-image-region-0.10.0_21.zip"
sha256: 73dcc0510d28e27f3fa063f8e27621546d89b9cbd3e2267bbbbe7e094659bb1c

omero_ms_image_region_download_URL: "{{ all_omero_ms_image_region_download_URL[java_version]['url'] }}"
omero_ms_image_region_package_sha256: "{{ all_omero_ms_image_region_download_URL[java_version]['sha256'] }}"

omero_ms_image_region_package_sha256: 9da1606fb1141b1044e0544451c92305710bca4c378febf003214b920ff510d2

omero_ms_image_region_name: "{{ omero_ms_image_region_download_URL | basename }}"

Expand Down
3 changes: 3 additions & 0 deletions molecule/resources/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
password: omero
databases: [ omero ]

- role: ome.java
java_versions: 11

- role: ome.omero_server
omero_server_release: 5.6.10
postgresql_version: "14"
Expand Down
1 change: 1 addition & 0 deletions molecule/resources/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
- src: ome.omero_server
- src: ome.postgresql
- src: ome.omero_web
- src: ome.java
8 changes: 3 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,31 @@

- name: omero-ms-image-region | copy config file
become: true
become_user: "{{ omero_ms_image_region_user }}"
ansible.builtin.template:
dest: "{{ omero_ms_image_region_folder }}/omero-ms-image-region/conf/config.yaml"
src: config.yaml.j2

- name: omero-ms-image-region | copy log config file
become: true
become_user: "{{ omero_ms_image_region_user }}"
ansible.builtin.template:
dest: "{{ omero_ms_image_region_folder }}/omero-ms-image-region/conf/logback.xml"
src: logback.xml.j2

- name: omero-ms-image-region | copy run.sh
become: true
become_user: "{{ omero_ms_image_region_user }}"
ansible.builtin.template:
dest: "{{ omero_ms_image_region_folder }}/omero-ms-image-region/run.sh"
src: run.sh.j2
mode: +x

- name: omero-ms-image-region | copy stop.sh
become: true
become_user: "{{ omero_ms_image_region_user }}"
ansible.builtin.template:
dest: "{{ omero_ms_image_region_folder }}/omero-ms-image-region/stop.sh"
src: stop.sh.j2
mode: +x

- name: omero-ms-image-region | systemd service
- name: omero-ms-image-region | copy systemd service
become: true
ansible.builtin.template:
dest: /etc/systemd/system/omero-ms-image-region.service
Expand All @@ -73,6 +69,8 @@

- name: omero-ms-image-region | selinux http_port_t for ms port
become: true
ignore_errors: true

ansible.builtin.seport:
ports: "{{ omero_ms_image_region_port }}"
proto: tcp
Expand Down
2 changes: 1 addition & 1 deletion tasks/pre_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
deploy_archive_sha256: "{{ omero_ms_image_region_package_sha256 }}"
deploy_archive_symlink: "{{ omero_ms_image_region_folder }}/omero-ms-image-region"
deploy_archive_internal_root: >-
omero-ms-image-region-0.8.7
{{ omero_ms_image_region_name | splitext | first | replace(java_version,'') | replace('_','') }}

- name: omero-ms-image-region | chown to ms-user
become: true
Expand Down
5 changes: 3 additions & 2 deletions templates/omero-web.conf.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
proxy_cache_path /tmp/cache levels=1:2 keys_zone=ms_cache:10m max_size={{ nginx_cache_max_size }} inactive={{ nginx_cache_inactive_time }} use_temp_path=off;

upstream image_region_backend {
server 127.0.0.1:{{ omero_ms_image_region_port }} git push
proxy_cache_path /tmp/cache levels=1:2 keys_zone=ms_cache:10m max_size={{ nginx_cache_max_size }} inactive={{ nginx_cache_inactive_time }} use_temp_path=off;
server 127.0.0.1:{{ omero_ms_image_region_port }} fail_timeout=0 max_fails=0;
}

{{ nginx_contents['content'] | b64decode | regex_replace('}$', '') }}

Expand Down
Loading