omero-py icon indicating copy to clipboard operation
omero-py copied to clipboard

omero import: set java.io.tmpdir to gettempdir()

Open sbesson opened this issue 2 months ago • 0 comments

Fixes #485

Summary

This changes set the Java process launched by the omero import utility to work in environments where the default Java temporary directory, usually /tmp/, is mounted with noexec permissions.

The proposed implementation makes use of the built-in OMERO.py temporary directory utility. This should allow the propose solution to be portable and cover scenarios ranging from in-place imports where the import is on the same environment and using the same service user as OMERO.server to client imports which might happen in a different environment and/or operating system and/or as a different user.

Testing

To reproduce the original issue

  • set-up an environment where /tmp is mounted as noexec
  • select an image that requires Java/Bio-Formats to use a native library e.g. CMU-1.ndpi
  • check that omero import -f CMU-1.ndpi does not find any import candidate and reports an ERROR about the inability to load Turbo JPEG

Using a version of OMERO.py with these changes included

  • check omero import -f CMU-1.ndpi detects the NDPI file in the same environment as above
  • check omero import CMU-1.ndpi successfully imports the NDPI file
  • during the import, check that a subfolder under ~/omero/tmp is created for the process with the native libraries
  • on import completion, check the temporary subfolder is cleaned up
  • ideally, run the import tests above both for in-place imports and non-inplace imports

sbesson avatar Nov 13 '25 06:11 sbesson