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

Dockerfile dependency error #101

Closed
koetjen opened this issue Jan 13, 2022 · 2 comments
Closed

Dockerfile dependency error #101

koetjen opened this issue Jan 13, 2022 · 2 comments

Comments

@koetjen
Copy link

koetjen commented Jan 13, 2022

In the docker, pyjnius is looking for libjvm.so in the wrong place.

ashlar 'exemplar-001-cycle-01.ome.tiff' 'exemplar-001-cycle-02.ome.tiff' 'exemplar-001-cycle-03.ome.tiff' -m 30 --ffp exemplar-001-cycle-01-ffp.tif exemplar-001-cycle-02-ffp.tif exemplar-001-cycle-03-ffp.tif --dfp exemplar-001-cycle-01-dfp.tif exemplar-001-cycle-02-dfp.tif exemplar-001-cycle-03-dfp.tif --pyramid -f exemplar-001.ome.tif

  Traceback (most recent call last):
    File "/usr/local/bin/ashlar", line 5, in <module>
      from ashlar.scripts.ashlar import main
    File "/usr/local/lib/python3.7/dist-packages/ashlar/scripts/ashlar.py", line 8, in <module>
      from .. import reg
    File "/usr/local/lib/python3.7/dist-packages/ashlar/reg.py", line 37, in <module>
      import jnius
    File "/usr/local/lib/python3.7/dist-packages/jnius/__init__.py", line 42, in <module>
      from .reflect import *  # noqa
    File "/usr/local/lib/python3.7/dist-packages/jnius/reflect.py", line 20, in <module>
      class Class(with_metaclass(MetaJavaClass, JavaClass)):
    File "/usr/lib/python3/dist-packages/six.py", line 827, in __new__
      return meta(name, bases, d)
    File "jnius/jnius_export_class.pxi", line 119, in jnius.MetaJavaClass.__new__
    File "jnius/jnius_export_class.pxi", line 179, in jnius.MetaJavaClass.resolve_class
    File "jnius/jnius_env.pxi", line 11, in jnius.get_jnienv
    File "jnius/jnius_jvm_dlopen.pxi", line 134, in jnius.get_platform_jnienv
    File "jnius/jnius_jvm_dlopen.pxi", line 101, in jnius.create_jnienv
  SystemError: Error calling dlopen(b'/opt/ibm/jre/lib/server/libjvm.so': b'/opt/ibm/jre/lib/server/libjvm.so: cannot open shared object file: No such file or directory'

As a workaround, I added to the dockerfile

RUN mkdir -p /opt/ibm/jre/lib/server/ \
&& ln -s /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so /opt/ibm/jre/lib/server/libjvm.so

possibly related... kivy/pyjnius#428

@jmuhlich
Copy link
Collaborator

Could you tell me what exact version of the container you are using? Did you build your own or pull an image from labsyspharm/ashlar on Dockerhub? I don't see this issue in the current latest image on Dockerhub.

@koetjen
Copy link
Author

koetjen commented Jan 14, 2022

Sorry for not including the full example. It's the labsyspharm/ashlar image from Dockerhub on our computing cluster. I'm not seeing this problem when I run locally, so I will try to identify the problem in the computing environment instead

[koetjen@compute1-client-1 ~]$ bsub -Is -q general-interactive -a 'docker(labsyspharm/ashlar)' /bin/bash
Job <870401> is submitted to queue <general-interactive>.
<<Waiting for dispatch ...>>
<<Starting on compute1-exec-132.ris.wustl.edu>>
Using default tag: latest
latest: Pulling from labsyspharm/ashlar
3f2411103a12: Pull complete 
4da04088b2c2: Pull complete 
ab1184837b6f: Pull complete 
354c6da61dcc: Pull complete 
4b506cc51d18: Pull complete 
e004abadf190: Pull complete 
cb553601e103: Pull complete 
576359f27547: Pull complete 
f445b3192f2a: Pull complete 
Digest: sha256:a595c0f548c00c2c8b1ed55b3299c612b527f73bfa21aaadb11c40ac253c9a46
Status: Downloaded newer image for labsyspharm/ashlar:latest
docker.io/labsyspharm/ashlar:latest
koetjen@compute1-exec-132:~$ ashlar
Traceback (most recent call last):
  File "/usr/local/bin/ashlar", line 5, in <module>
    from ashlar.scripts.ashlar import main
  File "/usr/local/lib/python3.7/dist-packages/ashlar/scripts/ashlar.py", line 8, in <module>
    from .. import reg
  File "/usr/local/lib/python3.7/dist-packages/ashlar/reg.py", line 37, in <module>
    import jnius
  File "/usr/local/lib/python3.7/dist-packages/jnius/__init__.py", line 42, in <module>
    from .reflect import *  # noqa
  File "/usr/local/lib/python3.7/dist-packages/jnius/reflect.py", line 20, in <module>
    class Class(with_metaclass(MetaJavaClass, JavaClass)):
  File "/usr/lib/python3/dist-packages/six.py", line 827, in __new__
    return meta(name, bases, d)
  File "jnius/jnius_export_class.pxi", line 119, in jnius.MetaJavaClass.__new__
  File "jnius/jnius_export_class.pxi", line 179, in jnius.MetaJavaClass.resolve_class
  File "jnius/jnius_env.pxi", line 11, in jnius.get_jnienv
  File "jnius/jnius_jvm_dlopen.pxi", line 134, in jnius.get_platform_jnienv
  File "jnius/jnius_jvm_dlopen.pxi", line 101, in jnius.create_jnienv
SystemError: Error calling dlopen(b'/opt/ibm/jre/lib/server/libjvm.so': b'/opt/ibm/jre/lib/server/libjvm.so: cannot open shared object file: No such file or directory'

@koetjen koetjen closed this as completed Jan 14, 2022
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

No branches or pull requests

2 participants