mathworks / matlab-proxy

Python® package enables you to open a MATLAB® desktop in a web browser tab.
Other
42 stars 23 forks source link

matlab-proxy is unable to render the CONN toolbox GUI #30

Closed cagancayco closed 6 months ago

cagancayco commented 8 months ago

Summary

I am trying to use the CONN toolbox with a MATLAB server running via matlab-proxy. When I launch the CONN GUI, the GUI figure opens, but none of the menu buttons render. No error messages appear but there is no text on the GUI buttons and they are not clickable.

To reproduce the issue, you can download the CONN toolbox and SPM12. I add the toolboxes to the path and then launch the CONN GUI via the command line.

addpath('/path/to/spm12')
addpath('/path/to/conn')
conn

I'm not sure what can be done to fix it, but I'm wondering if it might be Java related? I want to add that I'm running this on a cluster via Open OnDemand.

Browser(s) used

Chrome

Script output

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                     MATLAB                                                                                                    
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 matlab - /share/software/user/restricted/matlab/R2022b/bin/matlab OK

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                matlab-proxy-app                                                                                               
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 matlab-proxy-app - /share/software/user/open/python/3.9.0/bin/matlab-proxy-app OK

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                           Python and pip executables                                                                                          
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 python - usr/bin/python OK

 Python 2.7.5 

 pip - /share/software/user/open/python/3.9.0/bin/pip OK

 pip 23.3.1 from /share/software/user/open/python/3.9.0/lib/python3.9/site-packages/pip (python 3.9) 

 python3 - /share/software/user/open/python/3.9.0/bin/python3 OK

 Python 3.9.0 

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                      Xvfb                                                                                                     
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 Xvfb - /share/software/user/open/x11/7.7/bin/Xvfb OK

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                 OS information                                                                                                
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Linux
 3.10.0-1160.105.1.el7.x86_64
 Linux-3.10.0-1160.105.1.el7.x86_64-x86_64-with-glibc2.17
 uname_result(system='Linux', node='sh02-01n58.int', release='3.10.0-1160.105.1.el7.x86_64', version='#1 SMP Thu Dec 7 15:39:45 UTC 2023', machine='x86_64')

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                               Conda information                                                                                               
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 conda - None 

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                               Installed packages                                                                                              
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 /bin/python: No module named pip 

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                             Environment variables                                                                                             
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 MW_LD_SHIM=/share/software/user/restricted/matlab/R2022b/bin/glnxa64/ld_shim.so.2.17
 __LMOD_STACK_MATLABDIR=L3NoYXJlL3NvZnR3YXJlL3VzZXIvcmVzdHJpY3RlZC9tYXRsYWIvUjIwMjJi
 MATLABDIR=/share/software/user/restricted/matlab/R2022b
 __LMOD_STACK_MATLAB_JAVA=L3NoYXJlL3NvZnR3YXJlL3VzZXIvcmVzdHJpY3RlZC9tYXRsYWIvUjIwMjJiL3N5cy9qYXZhL2pyZS9nbG54YTY0L2pyZQ==
 MWI_AUTH_TOKEN=QaSlzWvru51NZnrxxuD4D3dDYqMtLAGd
 MW_PATCH_OFFSETS=00001080000008F0
 MW_DOCROOT=ui/webgui/src
 __LMOD_STACK_MATLABPATH=L3NoYXJlL3NvZnR3YXJlL3VzZXIvcmVzdHJpY3RlZC9tYXRsYWIvUjIwMjJiL3Rvb2xib3gvbG9jYWwvc2hlcmxvY2s=
 MATLAB_WORKER_CONFIG_ENABLE_LOCAL_PARCLUSTER=true
 MATLAB_PREFDIR=/lscratch/gancayco/.matlab
 MATLAB_JAVA=/share/software/user/restricted/matlab/R2022b/sys/java/jre/glnxa64/jre
 MWI_APP_PORT=63563
 MW_GLIBC_SHIM=/share/software/user/restricted/matlab/R2022b/bin/glnxa64/glibc-2.17_shim.so
 MW_CRASH_MODE=native
 MATLAB_CONNECTOR_HOSTING_ENVIRONMENT=tmw
 HTTP_MATLAB_CLIENT_GATEWAY_PUBLIC_PORT=1
 MW_CONTEXT_TAGS=MATLAB_PROXY:BASE:V1
 MWI_APP_HOST=0.0.0.0
 BASEMATLABPATH=/share/software/user/restricted/matlab/R2022b/toolbox/local/sherlock
 MATLAB_LOG_DIR=/home/users/gancayco/.matlab/MWI/hosts/sh02-01n58.int/ports/63563
 __LMOD_STACK_MATLAB_PREFDIR=L2xzY3JhdGNoL2dhbmNheWNvLy5tYXRsYWI=
 MW_CD_ANYWHERE_ENABLED=true
 MWI_ENABLE_TOKEN_AUTH=True
 MW_CD_ANYWHERE_DISABLED=false 
krisctl commented 7 months ago

Dear @cagancayco,

Thank you for trying out matlab-proxy, and I apologize for the delayed response! I was able to reproduce the issue at my end and can also confirm that the issue is happening because the "conn" toolbox is built using Java components that are not supported in the web-enabled mode of accessing MATLAB via matlab-proxy.

An ideal fix for this would be for the toolbox developers to transition to alternative technologies as listed in this article. However, considering you might not be able to influence this code change, a current workaround would be to access MATLAB desktop over the VNC protocol. I have verified that the UIs are rendered correctly in this mode. If your cluster is set up with our official MATLAB docker image from Docker Hub, it comes packaged with VNC and can be started and accessed as mentioned below:

Run MATLAB in desktop mode and interact with it via VNC
To start the MATLAB desktop, execute:

$ docker run -it --rm -p 5901:5901 -p 6080:6080 --shm-size=512M mathworks/matlab:r2023b -vnc
To connect to the MATLAB desktop, either:

Point a browser to port 6080 of the docker host machine running this container (http://hostname:6080)
Use a VNC client to connect to display 1 of the docker host machine (hostname:1)
The VNC password is matlab by default. Use the PASSWORD environment variable to change it.

Hope that helps!

Sincerely, Krishan