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

Bump omero_figure_release to 5.0.0 everywhere #362

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

will-moore
Copy link
Member

Bump OMERO.figure version to latest 5.0.0 everywhere.

cc @pwalczysko

@sbesson
Copy link
Member

sbesson commented Aug 11, 2022

👍 Similar question as always with OMERO.figure: does the figure script need to be updated i.e. do we need a server restart in addition to the OMERO.web restart?

@will-moore
Copy link
Member Author

Yes, the script does need updating. But I'm not familiar with how that happens on our playbooks (normally a script update wouldn't require a server restart)

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script updates are standalone tasks similar to

- name: Download the Figure_To_Pdf.py script
become: yes
get_url:
url: https://raw.githubusercontent.com/ome/omero-figure/v{{ omero_figure_release }}/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
dest: /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts/Figure_To_Pdf.py
mode: 0644
owner: root
force: yes
which are consuming the omero_figure_release variable that you modified already. So no additional change is required.

Looking at the tasks, you are correct a server restart is not required when this task is updated. This is useful and allows us to apply these upgrades without downtime

@pwalczysko any preference on how to proceed here for the deployment?

@pwalczysko
Copy link
Member

@pwalczysko any preference on how to proceed here for the deployment?

I know how to do the training servers, as the playbook is just one there for omero and web.
But for ns, my experience is limited to server upgrade deployment:
#357

Is it feasible to run just the web-related playbooks on ns ? (which ones exactly if yes ?)
About the demo, never did it yet.

@sbesson
Copy link
Member

sbesson commented Aug 11, 2022

Is it feasible to run just the web-related playbooks on ns ? (which ones exactly if yes ?)
About the demo, never did it yet.

Practically, it's the same process as the server except you are running other playbooks with different scopes:

  • nightshade-webclients.yml manages the UoD SLS OMERO.web deployments (authenticated and public)
  • ome-demoserver.yml manages the OME demo OMERO.server and its OMERO.web deployment

I expect you have full permissions to be able to run both playbooks. That being said, it would be very timely to confirm this is the case and fix issues if necessary.

@pwalczysko
Copy link
Member

@sbesson Ran the two playbooks (from this branch) you mention in #362 (comment) against three servers in check mode:

ns-web.openmicroscopy.org
ns-web-pub.openmicroscopy.org
ome-demoserver.openmicroscopy.org

The output looked reasonable and there were no probs with authentication

@pwalczysko
Copy link
Member

pwalczysko commented Aug 11, 2022

I will hold on upgrading further servers until the problem with Figure_To_Pdf.py is clarified.
At the moment, we have

Traceback (most recent call last):
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omeroweb/webclient/views.py", line 4963, in run_script
    handle = scriptService.runScript(sId, inputMap, None, conn.SERVICE_OPTS)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/gateway/__init__.py", line 4796, in __call__
    return self.handle_exception(e, *args, **kwargs)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omeroweb/webclient/webclient_gateway.py", line 2109, in handle_exception
    super(OmeroWebSafeCallWrapper, self).handle_exception(e, *args, **kwargs)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/gateway/__init__.py", line 4793, in __call__
    return self.f(*args, **kwargs)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero_api_IScript_ice.py", line 935, in runScript
    return _M_omero.api.IScript._op_runScript.invoke(self, ((scriptID, inputs, waitSecs), _ctx))
omero.InternalException: exception ::omero::InternalException
{
    serverStackTrace = 
    serverExceptionClass = 
    message = Sha1s don't match! expected 0d195d208b1493d8997c4d04c68813936eb81db2, found 15f37a30ba393bc054aad734154c99cfedc58425
}

When the attempt is made to export the pdf from the OMERO.figure UI on ome-training-4.

Edit: Checked that

  1. manual deletion of the script from the folder /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts and re-running the playbook does not solve the problem.
  2. The script in that folder is the correct one, it has the new lines added in recent PR.
  3. The same script uploaded manually to merge-ci works fine.
  4. If the script is deleted on ome-training-3, manually from /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts, then the same script uploaded manually via Figure UI to ome-training-3 does solve the problem (i.e. you can use it without error from the UI).
  5. After manual upload via Figure UI on ome-training-3 (Ad 5. above), the script also appears in the /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts folder but has different perms than the other scripts uploaded by ansible. It is not executable, but in the correct group and owned by correct user, see below.
[pwalczysko@ome-training-3 figure_scripts]$ ls -lah
total 260K
drwxr-xr-x 2 omero-server omero-server  255 Aug 11 18:43 .
drwxr-xr-x 8 omero-server omero-server  140 Jul  4 14:33 ..
-rwxr-xr-x 1 omero-server omero-server 6.3K Jul  4 14:33 Dataset_Images_To_New_Figure.py
-rwxr-xr-x 1 omero-server omero-server 3.2K Jul  4 14:33 Figure_Images_To_Dataset.py
-rw-rw-r-- 1 omero-server omero-server  89K Aug 11 18:43 Figure_To_Pdf.py
-rwxr-xr-x 1 omero-server omero-server    0 Jul  4 14:31 __init__.py
-rwxr-xr-x 1 omero-server omero-server  25K Jul  4 14:31 Movie_Figure.py
-rwxr-xr-x 1 omero-server omero-server  31K Jul  4 14:31 Movie_ROI_Figure.py
-rwxr-xr-x 1 omero-server omero-server  35K Jul  4 14:31 ROI_Split_Figure.py
-rwxr-xr-x 1 omero-server omero-server  31K Jul  4 14:31 Split_View_Figure.py
-rwxr-xr-x 1 omero-server omero-server  26K Jul  4 14:31 Thumbnail_Figure.py
[pwalczysko@ome-training-3 figure_scripts]$ pwd
/opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts

@sbesson
Copy link
Member

sbesson commented Aug 12, 2022

Thanks @pwalczysko, it looks like the replacement of the script file directly within the server directory is not sufficient and additional logic is required to update the internal checksums. Possibly previous OMERO.figure upgrades were combined with OMERO.server upgrades so that the service restart was triggered anyways and we did not encounter this error.

Options I can think of:

  • add a server restart handler to the script replacement task
  • invoke an OMERO CLI command (omero script upload/replace/edit) for replacing the script content
  • find an intermediate command that would refresh the script list without requiring a full server restart

@will-moore
Copy link
Member Author

As discussed this morning (@sbesson and @pwalczysko), plan for nightshade is to upgrade omero-web via the playbook. At the same time, update the figure script manually via $ omero script replace ... which won't require any server downtime.

@will-moore
Copy link
Member Author

omero script replace... failed on nightshade with

  File "/Users/wmoore/opt/anaconda3/envs/omeroweb/lib/python3.9/site-packages/omero_api_IScript_ice.py", line 767, in editScript
    return _M_omero.api.IScript._op_editScript.invoke(self, ((fileObject, scriptText), _ctx))
omero.InternalException: exception ::omero::InternalException
{
    serverStackTrace = java.io.IOException: File '/opt/omero/server/OMERO.server-5.6.5-ice36-b233/lib/scripts/omero/figure_scripts/Figure_To_Pdf.py' cannot be written to
	at org.apache.commons.io.FileUtils.openOutputStream(FileUtils.java:2177)

Seb: might be due the fact /opt/omero/server is owned by root

So we resorted to replace script via playbook and a restart of the server.

@pwalczysko
Copy link
Member

pwalczysko commented Aug 12, 2022

As @will-moore noted, the route of running the ansible playbook omero/ome-dundeeomero.yml -l ome-dundeeomero.openmicroscopy.org was taken, which elicited the Sha1 problem, and then the server was restarted.

Atm, all the servers (4 outreach servers, demo, ns-private and ns-public) are upgraded and working as expected.

@sbesson sbesson merged commit b2e0137 into ome:master Aug 12, 2022
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

Successfully merging this pull request may close these issues.

3 participants