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 admin diagnostics: move OMERO.py version as part of the output #339

Merged
merged 2 commits into from
Nov 18, 2022

Conversation

sbesson
Copy link
Member

@sbesson sbesson commented Oct 12, 2022

The historical behavior of the omero admin diagnostics is to output a title line of type OMERO Diagnostics (plugin) version. Since OMERO 5.6.0 and the decoupling of OMERO.py from OMERO.server, this leads to ambiguity as this will display the OMERO.py version but will typically be executed on a server environment.

This commit proposes to strip the version from the command title and instead report the versions of OMERO.py and OMERO.server as separate entries under the report.

To test this PR, run omero admin diagnostics on OMERO.server ideally with and without this change and compare the output

@sbesson
Copy link
Member Author

sbesson commented Oct 12, 2022

While this PR immediately helps clarifying a confusion reported several few times, this work is partly related to phase 4 ome/omero-certificates#26 as it adds an API for the discovery of properties stored under etc/omero.properties

@sbesson sbesson marked this pull request as draft October 12, 2022 16:24
@sbesson sbesson marked this pull request as ready for review November 10, 2022 08:31
@sbesson sbesson marked this pull request as draft November 10, 2022 08:42
@sbesson sbesson marked this pull request as ready for review November 10, 2022 08:48
@sbesson
Copy link
Member Author

sbesson commented Nov 10, 2022

Now included in the daily builds and should be ready for review - see e.g. https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-server/1402/console

10:29:16 + omero admin diagnostics
10:29:18 
10:29:18 ================================================================================
10:29:18 OMERO Diagnostics (admin)
10:29:18 ================================================================================
10:29:18         
10:29:18 Commands:   java -version                  1.8.0     (/home/omero/tools/hudson.model.JDK/JDK8/bin/java -- 2 others)
10:29:18 Commands:   python -V                      3.6.8     (/home/omero/workspace/OMERO-server/.venv3/bin/python -- 2 others)
10:29:18 Commands:   icegridnode --version          3.6.4     (/usr/bin/icegridnode)
10:29:18 Commands:   icegridadmin --version         3.6.4     (/usr/bin/icegridadmin)
10:29:18 Commands:   psql --version                 9.4.22    (/usr/bin/psql)
10:29:18 Commands:   openssl version                1.0.2     (/usr/bin/openssl)
10:29:18 
10:29:18 Component:  OMERO.py                       5.12.2.dev0
10:29:18 Component:  OMERO.server                   5.6.3-293-301773d-ice36-b1371
10:29:18 
10:29:18 Server:     icegridnode                    running
10:29:18 Server:     Blitz-0                        active (pid = 18268, enabled)
10:29:18 Server:     DropBox                        active (pid = 18277, enabled)

@pwalczysko
Copy link
Member

pwalczysko commented Nov 16, 2022

Comparing the

omero admin diagnostics on merge-ci vs latest-ci, I can see two changes

Change 1 (vanishing of the version of the diagnostics itself - pretty confusing number, good riddance imho)
latest

OMERO Diagnostics (admin) 5.12.2.dev0

merge

OMERO Diagnostics (admin)

Change 2
merge has 2 additional lines

Component:  OMERO.py                       5.12.2.dev0
Component:  OMERO.server                   5.6.3-294-25a351b-ice36-b1378

which make sense when looking at https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-build/ and https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-build/ (just slightly surprising that on merge-ci is the version number so low, not 5.6.5, but I guess this is another issue)

lgtm

@@ -1112,6 +1117,16 @@ def _glacier2_icessl_xml(self, config_props):
return ['<property name="%s" value="%s"/>' % kv
for kv in list(glacier2_icessl.items())]

def get_omero_server_version(self):
"""Returns the value of omero.version stored in omero.properties"""
omero_props_file = old_div(self._get_etc_dir(), "omero.properties")
Copy link
Member

@jburel jburel Nov 16, 2022

Choose a reason for hiding this comment

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

the usage of old_div gives me trouble during the API generation in some cases. Any reason not to use os.path.join

Copy link
Member

Choose a reason for hiding this comment

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

👍 sounds good

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the usage of old_div comes from my copying the implementation in

def _get_omero_properties(self):
omero_props_file = old_div(self._get_etc_dir(), "omero.properties")
.

And the old_div usage there itself comes the application of futurize across the code (3e17e99) which substituted division operators and path separators alike. I think in that case os.path.join is appropriate and I'll push a commit for testing appropriately but this might require a wider review.

@sbesson sbesson closed this Nov 17, 2022
@sbesson sbesson reopened this Nov 17, 2022
@jburel jburel closed this Nov 17, 2022
@jburel jburel reopened this Nov 17, 2022
@sbesson sbesson requested a review from jburel November 17, 2022 12:11
@sbesson
Copy link
Member Author

sbesson commented Nov 17, 2022

/home/docs/checkouts/readthedocs.org/user_builds/omero-py/checkouts/339/CHANGELOG.md:109: ERROR: Unexpected indentation.
/home/docs/checkouts/readthedocs.org/user_builds/omero-py/checkouts/339/CHANGELOG.md:115: ERROR: Unexpected indentation.
/home/docs/checkouts/readthedocs.org/user_builds/omero-py/checkouts/339/CHANGELOG.md:116: WARNING: Block quote ends without a blank line; unexpected unindent.

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/omero-py/envs/339/lib/python3.7/site-packages/sphinx/cmd/build.py", line 281, in build_main
    app.build(args.force_all, args.filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/omero-py/envs/339/lib/python3.7/site-packages/sphinx/application.py", line 347, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/omero-py/envs/339/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 312, in build_update
    len(to_build))
  File "/home/docs/checkouts/readthedocs.org/user_builds/omero-py/envs/339/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 326, in build
    updated_docnames = set(self.read())
  File "/home/docs/checkouts/readthedocs.org/user_builds/omero-py/envs/339/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 437, in read
    self.env.doc2path(self.config.root_doc))
sphinx.errors.SphinxError: root file /home/docs/checkouts/readthedocs.org/user_builds/omero-py/checkouts/339/index.rst not found

Sphinx error:
root file /home/docs/checkouts/readthedocs.org/user_builds/omero-py/checkouts/339/index.rst not found

is that a new error? related to #348 ?

@jburel
Copy link
Member

jburel commented Nov 17, 2022

This is new but strangely enough it only happens on this PR. Not directly related to #348. I will check
#349 was green

@jburel
Copy link
Member

jburel commented Nov 17, 2022

I suspect the problem was due to #350
This should hopefully sort the error only seen on this PR

The historical behavior of the `omero admin diagnostics` is to output
a title line of type `OMERO Diagnostics (plugin) version`.
Since OMERO 5.6.0 and the decoupling of OMERO.py from OMERO.server,
this leads to ambiguity as this will display the OMERO.py version but
will typically be executed on a server environment.

This commit proposes to strip the version from the command title and
instead report the versions of OMERO.py and OMERO.server as separate
entries under the report.
@jburel
Copy link
Member

jburel commented Nov 17, 2022

rtd build is now green

@jburel
Copy link
Member

jburel commented Nov 18, 2022

@pwalczysko are you okay to redo the functional testing after the last round of adjustments?

@pwalczysko
Copy link
Member

@pwalczysko are you okay to redo the functional testing after the last round of adjustments?

No changes in functionality detected, works as before.

@jburel
Copy link
Member

jburel commented Nov 18, 2022

thanks @pwalczysko

@jburel jburel merged commit 77680f1 into ome:master Nov 18, 2022
@sbesson sbesson deleted the diagnostics_versions branch December 2, 2022 08:58
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.

4 participants