-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fix docker_appdir path in omeroweb CreateApp.rst #2134
Fix docker_appdir path in omeroweb CreateApp.rst #2134
Conversation
@will-moore I directly pushed a commit removing the remaining python2.7 on that page |
@@ -83,7 +83,7 @@ python can import our ``minimal_webapp`` module. | |||
$ appdir=$(pwd)/minimal-webapp/minimal_webapp | |||
|
|||
# Location within Docker instance we want to link the app, so it can be imported. | |||
$ docker_appdir=/opt/omero/web/venv/lib/python2.7/site-packages/minimal_webapp | |||
$ docker_appdir=/opt/omero/web/venv3/lib/python3.6/site-packages/minimal_webapp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it need beed done in this PR, but @manics, is there anything that could be done in the omero-web(-standalone) app to make this registration easier? A symlink from /apps
? A .pth
file? etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does -e PYTHONPATH=/mountpoint
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I set $appdir so that
$ echo $appdir
/Users/wmoore/Desktop/WEB-APP-EXAMPLES/omero-web-apps-examples/minimal-webapp/
This allows me to import the app locally:
$ export PYTHONPATH=$appdir
$ python
>>> import minimal_webapp
But this doesn't work:
$ docker run -it --rm -e OMEROHOST=$host -p 4080:4080 -e PYTHONPATH=$appdir -v $config:$docker_config openmicroscopy/omero-web-standalone
...
ModuleNotFoundError: No module named 'minimal_webapp'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll still need to mount it inside the docker image. E.g.
appdir=$PWD/omero-metadata/src
docker run -it --rm ... -e PYTHONPATH=/apps -v $appdir:/apps --name test openmicroscopy/omero-web-standalone
$ docker exec -it test python -c 'import omero_metadata; print(omero_metadata.__file__)'
/apps/omero_metadata/__init__.pyc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #2140 to look into this - but not essential for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @will-moore, merging
See https://forum.image.sc/t/enable-fpbioimage-in-omeroweb-docker/39361/3?u=will-moore
Fix path to docker_appdir with py3.6.