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

Fix docker_appdir path in omeroweb CreateApp.rst #2134

Merged
merged 2 commits into from
Jul 15, 2020

Conversation

will-moore
Copy link
Member

@jburel
Copy link
Member

jburel commented Jun 24, 2020

@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
Copy link
Member

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.

Copy link
Member

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?

Copy link
Member Author

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'

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @will-moore, merging

@jburel jburel merged commit 34335df into ome:develop Jul 15, 2020
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