Pandora-IsoMemo / ReSources

Food Reconstruction Using Isotopic Transferred Signals (ReSources)
https://pandora-isomemo.github.io/ReSources/
GNU General Public License v3.0
0 stars 1 forks source link

Export image bug #76

Closed isomemo closed 1 year ago

isomemo commented 1 year ago

@arunge

Export of images does not work for any of the graphs in ReSources and ReSources Beta (in Model characteristics, Model diagnostics, and Output), Error below.

image

arunge commented 1 year ago

It looks like the tool is missing in the container but is needed for plot export. Installation instructions can be found here: https://github.com/plotly/orca#installation

@jan-abel-inwt Can you check if it is missing and let me know tomorrow?

jan-abel-inwt commented 1 year ago

It seems that the libgtk-3-0 library is missing.

Listening on http://0.0.0.0:3838
Loading required package: nimble
nimble version 0.12.2 is loaded.
For more information on NIMBLE and a User Manual,
please visit https://R-nimble.org.

Attaching package: ‘nimble’

The following object is masked from ‘package:stats’:

    simulate

Error in processx::run("orca", "-h") : 
  System command 'orca' failed, exit status: 127, stderr:
E> /opt/conda/lib/orca_app/orca: error libgtk-3-0while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory

I will update the dockerfile in the base-image repository

jan-abel-inwt commented 1 year ago

I have updated the dockerfile with the missing library. But we have still the same bug, but a new Error Message:

(orca:153): Gtk-WARNING **: 11:56:58.158: cannot open display:

This is caused by the plotly:::orca_available() function, which is trying to use orca --help cmd tool to check if orca is installed on the system. But this requires XServer to work.

Fast Fix: Change the orca_available() function to Sys.which("orca") to check if orca is installed.

BUT: Orca is no longer the recommended way to do static image export and maybe its better to switch to Kaleido

see https://github.com/plotly/orca/issues/349

jan-abel-inwt commented 1 year ago

I added the install instruction of miniconda, reticulate, kaleido & plotly in the local Dockerfile.

If the feature is working as expected, we should move these instruction to the base-image dockerfile to make kaleido available for all applications

isomemo commented 1 year ago

@jan-abel-inwt @arunge is this working now?

jan-abel-inwt commented 1 year ago

Not yet, but i'm working on this. There is a bug with the save_image() function of the plotly package we use. I have found a workaround, but there are still some issues with dependencies.

isomemo commented 1 year ago

@jan-abel-inwt Ok! Thanks for the update!

arunge commented 1 year ago

@isomemo Just a small update here: we are still trying to identify the problem. We have implemented a solution using a different function from the plotly package plotly::save_image. The image export now works again when running the app version 23.02.4.2 locally with R and also locally with docker. Just pull with

docker pull ghcr.io/pandora-isomemo/resources:beta

and run with

docker run -p 3838:3838 ghcr.io/pandora-isomemo/resources:beta

However, we were not able to get it working on the online machine. There is an issue with the installation of some python packages. We are looking for a solution.

But at least for now you can use the local version for plot export.

jan-abel-inwt commented 1 year ago

@isomemo the issue is fixed. The "export image" feature works again in the beta version.