ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
22 stars 32 forks source link

Omero seems to require a HOME directory #178

Open bgruening opened 4 years ago

bgruening commented 4 years ago

Running Omero in a Container yields this error. I assume Omero needs to have a HOME environment set, which is can not be assumed on HPC environments.

Invalid tmp dir: /omero/tmp
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/omero/util/temp_files.py", line 178, in tmpdir
    self.create(target)
  File "/usr/local/lib/python3.8/site-packages/omero/util/temp_files.py", line 246, in create
    dir.makedirs(0o700)
  File "/usr/local/lib/python3.8/site-packages/omero_ext/path.py", line 1254, in makedirs
    os.makedirs(self, mode)
  File "/usr/local/lib/python3.8/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/omero'
joshmoore commented 4 years ago

Hi @bgruening,

you can override the location that's being attempted by setting OMERO_USERDIR. Is there a directory that it would be safe to fallback to in your case?

~Josh

bgruening commented 4 years ago

Hi Josh,

in Galaxy we simply can set the HOME dir to a temp dir, thats what I did in the end. But in general, I don't think its a good idea to assume such a directory. There should be a fallback to some $TEMP or a similar mechanism, imho.

HPC environments can be tricky and they are so diverse, we have collected a few of those HPC recommendations in this article, maybe its interesting: 10.1093/gigascience/giz054

Ciao, Bjoern

jburel commented 4 years ago

Thanks @bgruening for the report, falling back to something like /tmp/omero should be doable.

manics commented 4 years ago

@bgruening we've got a proposal to defer to https://pypi.org/project/appdirs/ for managing user runtime directories. Would this work?

bgruening commented 4 years ago

@manics probably. But keep in mind that a fallback is needed, because you can not assume a HOME directory at all.