Task #11373 (closed)
Opened 11 years ago
Closed 11 years ago
Bug: OMERO_PREFIX vv OMERO_HOME in web docs
Reported by: | wmoore | Owned by: | wmoore |
---|---|---|---|
Priority: | major | Milestone: | OMERO-4.4.9 |
Component: | Documentation | Version: | n.a. |
Keywords: | n.a. | Cc: | cxallan, atarkowska, jamoore, drussell-x |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
In the web docs for running the django development server directly from /components/tools/OmeroWeb/omeroweb, we now tell users to set $OMERO_PREFIX instead of $OMERO_HOME: https://www.openmicroscopy.org/site/support/omero4/developers/Web/CreateApp.html
However, if they do not have $OMERO_HOME set, then omeroewb/settings.py tries to find it, and gets it wrong if you are running from /components/tools/OmeroWeb/omeroweb, since it expects you to be running from /dist/lib/python/omeroweb
if os.environ.has_key('OMERO_HOME'): OMERO_HOME =os.environ.get('OMERO_HOME') else: OMERO_HOME = os.path.join(os.path.dirname(__file__), '..', '..', '..') OMERO_HOME = os.path.normpath(OMERO_HOME)
Simple fix is for users to set $OMERO_HOME to /dist (as I and Ola have), but there was some reason we tell people not to set $OMERO_HOME?
Alternative is we change the code in omeroweb/settings.py to use $OMERO_PREFIX instead of $OMERO_HOME, BUT currently $OMERO_PREFIX is currently not used anywhere in our code, it's just a convenience for users to set up their environments, so users could be using something else, or it could change.
Need to decide which of these alternatives is preferable OR find another solution...
Change History (9)
comment:1 Changed 11 years ago by drussell-x
- Cc drussell-x added
comment:2 Changed 11 years ago by wmoore
comment:3 Changed 11 years ago by jamoore
OMERO_HOME has special handling in bin/omero. Basically, if it's set, strange things can happen. Likely the behavior of this snippet is correct assuming OMERO_HOME is set, but since we are generally discouraging people from using it, it seems like we don't want this remaining example. Running git grep -E "OMERO_(HOME|PREFIX)" shows a pretty confusing picture. It seems that several of us have been using these names, each in our own way.
Is there any reason to keep the os.environ check? What wouldn't be possible without it?
comment:4 Changed 11 years ago by wmoore
The main use case here is running OMERO.web either via
$ bin/omero web start
OR in development via
$ cd components/tools/OmeroWeb/omeroweb $ python manage.py runserver
In both cases the omeroweb/settings.py is in different places - E.g dist/lib/python/omeroweb/ OR components/tools/OmeroWeb/omeroweb, but in both cases it needs to be able to find various config locations
INSIGHT_JARS = os.path.join(OMERO_HOME, "lib", "insight").replace('\\','/') LOGDIR = os.path.join(OMERO_HOME, 'var', 'log').replace('\\','/') CONFIG_XML = os.path.join(OMERO_HOME, 'etc', 'grid', 'config.xml')
comment:5 Changed 11 years ago by jamoore
- Milestone changed from Testing and Docs to OMERO-4.4.9
- Sprint Testing and Docs (2) deleted
Moving to 4.4.9 in case this is something that we can clear up. If we need to push to milestone:Testing2, feel free to do so.
comment:6 Changed 11 years ago by wmoore
- Resolution set to fixed
- Status changed from new to closed
comment:7 Changed 11 years ago by wmoore
https://github.com/openmicroscopy/openmicroscopy/pull/1485 closed (not merged).
Instead, we could tell OMERO.web devs to set $OMERO_HOME?
comment:8 Changed 11 years ago by wmoore
- Resolution fixed deleted
- Status changed from closed to reopened
comment:9 Changed 11 years ago by wmoore
- Resolution set to fixed
- Status changed from reopened to closed
Josh or Chris, you have any input here? I'm happy to make the changes to docs or code, but need to know what you want.