Git Product home page Git Product logo

omero_3dscript's People

Contributors

bene51 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

omero_3dscript's Issues

Use Docker to build the server

Hi!

I'm trying to build a docker image from the omero-web-standalone image (based on CentOS7) with omero-3Dscript installed. I managed to install the tool and open the 3D-script page, but got stuck with the following error:

/usr/local/share/Fiji.app/lib/linux64/libOpenCLRaycaster.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/share/Fiji.app/lib/linux64/libOpenCLRaycaster.so)
java.lang.UnsatisfiedLinkError: /usr/local/share/Fiji.app/lib/linux64/libOpenCLRaycaster.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/share/Fiji.app/lib/linux64/libOpenCLRaycaster.so)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at animation3d.renderer3d.OpenCLRaycaster.<clinit>(OpenCLRaycaster

I tried to get around that by installing a newer gcc (as advised on the internet), but I don't know how to point to the new libstdc++.so -- the "just to a symlink" strategy failed. I'm not familiar with Java nor CentOS so I'm a bit lost here.

Bellow is the content of the DockerFile:

# https://github.com/ome/omero-web-docker/blob/master/Dockerfile
FROM openmicroscopy/omero-web-standalone:5

USER root
RUN yum install -y \
    ffmpeg \
    wget \
    unzip \
    ocl-icd \
    opencl-headers \
    scl-utils \
    scl-utils-build \
    centos-release-scl

RUN yum install -y \
    devtoolset-8-gcc \
    devtoolset-8-gcc-c++

RUN scl enable devtoolset-8 -- bash
RUN ln -s /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so /usr/lib64/libstdc++.so

ENV FIJI_HOME=/usr/local/share/Fiji.app
RUN mkdir $FIJI_HOME
WORKDIR /usr/local/share/
RUN wget https://downloads.imagej.net/fiji/latest/fiji-linux64.zip
RUN unzip fiji-linux64.zip
WORKDIR $FIJI_HOME
RUN ./ImageJ-linux64 --update add-update-site 3Dscript "https://romulus.oice.uni-erlangen.de/updatesite/"
RUN ./ImageJ-linux64 --update add-update-site 3Dscript-server "https://romulus.oice.uni-erlangen.de/imagej/updatesites/3Dscript-server/"
RUN ./ImageJ-linux64 --update update

RUN /opt/omero/web/venv3/bin/python -m pip install omero-3Dscript
USER omero-web
ADD omero-web-apps.omero /opt/omero/web/config/

It is invoked with:

docker run --name omero-web-3dscript -e OMEROHOST=omero.example.com -p 4080:4080 omeroweb-3dscript

I'd be happy to share the dockerfile (and even the built image) once it's running.

Thanks for any hint!

Guillaume

Installation feedback

Apologies for my lack of Fiji knowledge, this was just what I tried...

I starting at https://github.com/bene51/omero_3Dscript/blob/master/README.md but I went a little "off-script" already since I'm installing on my local Mac laptop and I already have Fiji etc installed, so I just installed 3Dscript via the Fiji update manager and put the 3D_Animation_Server-0.1.jar under /Applications/Fiji.app/plugins.
I set: export FIJI_HOME="/Applications/Fiji.app/" but wasn't sure from the install instructions whether I needed that in my omero-web environment?

You'll want to make the app "pip installable". See https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py
You should make the omero_3dscript package into a sub-directory of your repo (nest it one level deeper), and create a top-level setup.py (you can use the example from the link above as a starting point). This is what we do with all our OMERO.web apps. By using that example to create a setup.py and editing it to use name="omero_3dscript" meant that I could do a install with

$ pip install -e .

without worrying which directory I had cloned your repo (doesn't need to be in the omero-web $install_dir). The other steps to make the app 'pip installable' and push it to pypi are not too hard either and it's important if you want to make it easy for others to install.

You can then list 'pid' as a dependency in the setup.py and users won't have to install that manually.

The other config and a web restart allowed me to open an image in the app via open-with...

But when I tried to startRendering I got "ERROR: signal only works in main thread". Is there a step I missing to start Fiji running headless? Animation_Server

Thanks,
Will.

Use Django to generate base URLs

When you create URLs such as '/omero_3dscript/startRendering', in the JavaScript code, you should base this on a Django-generated URL, e.g:

var BASE_3DSCRIPT_URL = "{% url '3Dscript_index' %}";

See example at https://github.com/ome/omero-figure/blob/master/omero_figure/templates/figure/index.html#L42
then use this global variable to create URLs.

This will include any web URL 'prefix' (see https://docs.openmicroscopy.org/omero/5.6.1/sysadmins/unix/install-web.html#customizing-your-omero-web-installation )
e.g. If using an 'omero' prefix as in the docs example, BASE_3DSCRIPT_URL will be /omero/omero_3dscript/.

Use POST requests where appropriate

When you access any URL that is not idempotent (updates the server) this should really be a POST request, not GET. e.g. startRendering

You can use the @require_POST decorator as in https://github.com/ome/omero-web/blob/master/omeroweb/webclient/views.py#L2582 and you'll need to use request.POST.getlist() instead of GET.
This will give you Django's CSRF protection, but you will need to include Django's CSRF token in your POST requests which you can do by including https://github.com/ome/omero-web/blob/master/omeroweb/webgateway/static/webgateway/js/ome.csrf.js

It also means that if you have the public user configured, they will be prevented from performing any POST requests.

Minor point: I wonder why you're using imageId[] as your query parameter? It works OK but seems unnecessary and the URLs are harder to read: ?imageId%5B%5D=52 instead of ?imageId=52

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.