ome / omero-web-docker

OMERO.web production docker image
https://hub.docker.com/r/openmicroscopy/omero-web/
BSD 2-Clause "Simplified" License
6 stars 19 forks source link

installing external omero-web app #60

Closed will-moore closed 3 years ago

will-moore commented 3 years ago

I would like to run an external web app with omero-web-standalone, as described https://docs.openmicroscopy.org/omero/5.6.1/developers/Web/CreateApp.html#run-your-app-with-omero-web-in-a-docker-container

But, in those instructions the web app is not pip-installed but rather linked into place, so any dependencies are not installed.

I tried this with https://github.com/will-moore/omero-web-zarr:

cd omero-web-zarr/
$ appdir=$(pwd)/omero_web_zarr
$ docker_appdir=/opt/omero/web/venv3/lib64/python3.6/site-packages/omero_web_zarr
$ echo "config append omero.web.apps '\"omero_web_zarr\"'" > config.omero
$ config=$(pwd)/config.omero
$ docker_config=/opt/omero/web/config/config.omero
$ host=demo.openmicroscopy.org

$ docker run -it --rm -e OMEROHOST=$host -p 4080:4080 -v $appdir:$docker_appdir -v $config:$docker_config openmicroscopy/omero-web-standalone

...
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero_web_zarr/views.py", line 20, in <module>
    import zarr
ModuleNotFoundError: No module named 'zarr'

Any ideas @joshmoore ?

joshmoore commented 3 years ago

I think the only method at the moment is to add your own Dockerfile which does:

USER root
...install stuff...
USER 1000
will-moore commented 3 years ago

This worked for me, modifying 2 existing files:

diff --git a/standalone/01-default-webapps.omero b/standalone/01-default-webapps.omero
index bf9e702..1ec37b3 100644
--- a/standalone/01-default-webapps.omero
+++ b/standalone/01-default-webapps.omero
@@ -22,3 +22,7 @@ config append -- omero.web.ui.center_plugins '["Parade", "omero_parade/init.js.h

 # Top links
 config set -- omero.web.ui.top_links '[["Data", "webindex", {"title": "Browse Data via Projects, Tags etc"}],["History", "history", {"title": "History"}], ["Mapr", {"viewname": "maprindex_anyvalue"}, {"title": "Find Any Value"}], ["Figure", "figure_index", {"title": "Open Figure in new tab", "target": "_blank"}], ["Help", "https://help.openmicroscopy.org/", {"title":"Open OMERO user guide in a new tab", "target":"new"}]]'
+
+# omero-web-zarr
+config append -- omero.web.apps '"omero_web_zarr"'
+config append omero.web.open_with '["web_zarr_vizarr", "omero_web_zarr_index", {"supported_objects":["image"], "label": "Vizarr", "script_url": "omero_web_zarr/openwith.js"}]'

diff --git a/standalone/Dockerfile b/standalone/Dockerfile
index ba45b0e..a2afef6 100644
--- a/standalone/Dockerfile
+++ b/standalone/Dockerfile
@@ -4,6 +4,8 @@ MAINTAINER ome-devel@lists.openmicroscopy.org.uk

 USER root

+RUN yum -y install git
+
 RUN /opt/omero/web/venv3/bin/pip install \
         'django-cors-headers<3.3' \
         omero-figure \
@@ -13,6 +15,7 @@ RUN /opt/omero/web/venv3/bin/pip install \
         omero-parade \
         omero-webtagging-autotag \
         omero-webtagging-tagsearch \
+        'git+git://github.com/will-moore/omero-web-zarr.git@main#egg=omero-web-zarr' \
         whitenoise

And:

$ cd standalone
$ docker build -t omero_web_zarr .
$ docker run -it --rm -e OMEROHOST=demo.openmicroscopy.org -p 4080:4080 omero_web_zarr