Kitware / visualizer

The ParaViewWeb Visualizer application which can be used standalone or as a component within another web context.
https://kitware.github.io/visualizer/
BSD 3-Clause "New" or "Revised" License
115 stars 28 forks source link

ParaViewWeb: session did not start when timeout expired #69

Closed Shaileshbg1 closed 5 years ago

Shaileshbg1 commented 5 years ago

Hello, I am working with OpenFOAM simulations on Ubuntu 16.04, the paraview which I have is paraviewopenfoam54 which came coupled with OpenFOAM5. This paraview has a slightly different folder structure than of the downloadable paraview binaries.

I followed this documentation to set up a paraViewWeb server instance: http://kitware.github.io/paraviewweb/docs/ubuntu_14_04.html

These are my configuration files 1) launcher.json { "resources": [ {"port_range": [9001, 9103], "host": "localhost"} ], "sessionData": { "updir": "/Home" },

"configuration": {
  "log_dir": "/data/pvw/logs",
  "host": "localhost",
  "endpoint": "paraview",
  "sessionURL": "ws://shailesh-office/proxy?sessionId=${id}&path=ws",
  "timeout": 25,
  "upload_dir": "/data/pvw/upload",
  "fields": ["file", "host", "port", "updir"],
  "port": 8080,
  "proxy_file": "/data/proxy.txt"
},
"properties": {
  "web_path": "/data/pv/pv-current/lib/paraview-5.4/site-packages/paraview/web",
  "dataDir": "/data/pvw/data/simulation",
  "python_exec": "/data/pv/pv-current/bin/pvpython"
},
"apps": {
  "visualizer": {
    "cmd": [
      "${python_exec}",
      "-dr",
      "${web_path}/visualizer/server/pvw-visualizer.py",
      "--port", "${port}",
      "--data", "${dataDir}",
      "-f",
      "--authKey", "${secret}"
    ],
    "ready_line" : "Starting factory"
  },
  "lightviz": {
    "cmd": [
      "${python_exec}",
      "-dr",
      "${web_path}/lightviz/server/pvw-light-viz.py",
      "--port", "${port}",
      "--data", "${dataDir}",
      "-f",
      "--authKey", "${secret}"
    ],
    "ready_line" : "Starting factory"
  }
}

}

2) Apache config file <VirtualHost *:80> ServerName shailesh-office ServerAdmin shailesh@niramai.com DocumentRoot /data/www

  ErrorLog /data/logs/error.log
  CustomLog /data/logs/access.log combined

  <Directory /data/www>
      Options Indexes FollowSymLinks
      Order allow,deny
      Allow from all
      AllowOverride None
      Require all granted
  </Directory>

  # Handle launcher forwarding
  ProxyPass /paraview http://localhost:8080/paraview

  # Handle WebSocket forwarding
  RewriteEngine On
  RewriteMap session-to-port txt:/home/shailesh/mappingFileDirectory/proxy.txt
  RewriteCond %{QUERY_STRING} ^sessionId=(.*)&path=(.*)$ [NC]
  RewriteRule ^/proxy.*$  ws://${session-to-port:%1}/%2  [P]
</VirtualHost>

3) Launcher start file: start.sh

!/bin/bash

export DISPLAY=:0.0 /data/pv/pv-current/bin/pvpython /data/pv/pv-current/lib/paraview-5.4/site-packages/vtk/web/launcher.py /data/pvw/conf/launcher.json &

I have double checked the directory structure changes in accordance with paraviewopenfoam54.

When I run http://shailesh-office/visualizer/ in my web browser, I get the following error: "Session did not start before timeout expired"

This is my launcher log file 2018-12-26 17:30:49,279:INFO:twisted:"127.0.0.1" - - [26/Dec/2018:12:00:48 +0000] "POST /paraview/ HTTP/1.1" 503 78 "http://shailesh-office/visualizer/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" 2018-12-26 17:31:49,281:INFO:twisted:Timing out client: IPv4Address(TCP, '127.0.0.1', 59766)

Could you please let me know of what my error is, I am completely new to this domain so I am finding it hard to proceed from here.

Thanks and regards, Shailesh

jourdain commented 5 years ago

Which version of ParaView is bundled with open foam? Try to run it by hand first without Apache and the launcher on local host by using a similar command line you have in your launcher config while adding the --content /path-to/web/content

Then connect to it with http://localhost:8080/

On Dec 26, 2018, at 08:15, Shailesh notifications@github.com wrote:

Hello, I am working with OpenFOAM simulations on Ubuntu 16.04, the paraview which I have is paraviewopenfoam54 which came coupled with OpenFOAM5. This paraview has a slightly different folder structure than of the downloadable paraview binaries.

I followed this documentation to set up a paraViewWeb server instance: http://kitware.github.io/paraviewweb/docs/ubuntu_14_04.html

These are my configuration files

launcher.json { "resources": [ {"port_range": [9001, 9103], "host": "localhost"} ], "sessionData": { "updir": "/Home" },

"configuration": { "log_dir": "/data/pvw/logs", "host": "localhost", "endpoint": "paraview", "sessionURL": "ws://shailesh-office/proxy?sessionId=${id}&path=ws", "timeout": 25, "upload_dir": "/data/pvw/upload", "fields": ["file", "host", "port", "updir"], "port": 8080, "proxy_file": "/data/proxy.txt" }, "properties": { "web_path": "/data/pv/pv-current/lib/paraview-5.4/site-packages/paraview/web", "dataDir": "/data/pvw/data/simulation", "python_exec": "/data/pv/pv-current/bin/pvpython" }, "apps": { "visualizer": { "cmd": [ "${python_exec}", "-dr", "${web_path}/visualizer/server/pvw-visualizer.py", "--port", "${port}", "--data", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" }, "lightviz": { "cmd": [ "${python_exec}", "-dr", "${web_path}/lightviz/server/pvw-light-viz.py", "--port", "${port}", "--data", "${dataDir}", "-f", "--authKey", "${secret}" ], "ready_line" : "Starting factory" } } }

Apache config file <VirtualHost *:80> ServerName shailesh-office ServerAdmin shailesh@niramai.com DocumentRoot /data/www

ErrorLog /data/logs/error.log CustomLog /data/logs/access.log combined

<Directory /data/www> Options Indexes FollowSymLinks Order allow,deny Allow from all AllowOverride None Require all granted

Handle launcher forwarding

ProxyPass /paraview http://localhost:8080/paraview

Handle WebSocket forwarding

RewriteEngine On RewriteMap session-to-port txt:/home/shailesh/mappingFileDirectory/proxy.txt RewriteCond %{QUERY_STRING} ^sessionId=(.)&path=(.)$ [NC] RewriteRule ^/proxy.*$ ws://${session-to-port:%1}/%2 [P]

Launcher start file: start.sh

!/bin/bash

export DISPLAY=:0.0 /data/pv/pv-current/bin/pvpython /data/pv/pv-current/lib/paraview-5.4/site-packages/vtk/web/launcher.py /data/pvw/conf/launcher.json &

I have double checked the directory structure changes in accordance with paraviewopenfoam54.

When I run http://shailesh-office/visualizer/ in my web browser, I get the following error: "Session did not start before timeout expired"

This is my launcher log file 2018-12-26 17:30:49,279:INFO:twisted:"127.0.0.1" - - [26/Dec/2018:12:00:48 +0000] "POST /paraview/ HTTP/1.1" 503 78 "http://shailesh-office/visualizer/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" 2018-12-26 17:31:49,281:INFO:twisted:Timing out client: IPv4Address(TCP, '127.0.0.1', 59766)

Could you please let me know of what my error is, I am completely new to this domain so I am finding it hard to proceed from here.

Thanks and regards, Shailesh

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Shaileshbg1 commented 5 years ago

Hi Jourdain, Thank you for your reply, when I tried to run it by hand first I got this error: "ImportError: cannot import name pv_wslink", another discussion https://github.com/Kitware/visualizer/issues/49 suggested that my versions are not compatible, and indeed the version of paraview bundled with OpenFoam5 is 5.4 and the visualizer version I installed with npm was 3.1.10, which are not compatible. As suggested by this version compatibility document: https://kitware.github.io/visualizer/docs/compatibility.html I tried to upgrade the existing version of paraview by replacing a set of python files, now I am getting a new error:

File "/data/pv/pv-5.4.0/lib/paraview-5.4/site-packages/paraview/web/pv_wslink.py", line 5, in from vtkmodules.web import wslink as vtk_wslink ImportError: No module named vtkmodules.web

I tried searching for solutions to this but could not find them. After this I uninstalled the npm installed pvw-visualizer, to try the ParaView Visualizer application bundled with my installed paraview. But I still got the same error. Could you please let me know where I am going wrong.

Thanks and Regards, Shailesh

Shaileshbg1 commented 5 years ago

Hi Jourdain,

I tried to install visualizer version 2.2.0 which is compatible with paraview version 5.4.0, using npm install -g pvw-visualizer@2.2.0

but still, I get the same error, File "/data/pv/pv-5.4.0/lib/paraview-5.4/site-packages/paraview/web/pv_wslink.py", line 5, in from vtkmodules.web import wslink as vtk_wslink ImportError: No module named vtkmodules.web

Looking forward to hearing back from you,

Thanks and Regards, Shailesh

jourdain commented 5 years ago

Did you check first if visualizer was not already bundled with the OpenFoam version of ParaView? Look for the file /visualizer/server/pvw-visualizer.py in the ParaView tree as well as /visualizer/www/index.html

In other words, there is no need to install visualizer using npm especially if you plan a real deployment.

Since I'm not familiar with the OpenFoam version of ParaView, I don't know which python version and bundle from VTK they've enabled.

Anyhow with small edits, it should be possible to patch your version of ParaView so it can work with the ParaViewWeb Visualizer app.

But like I said, I don't know anything of the OpenFOAM version of PV and therefore, I'm not aware of possible path change and so on. You can either point me to a version of that PV I can unzip on my local computer or you can post the tree structure of the ParaView in question here.

Shaileshbg1 commented 5 years ago

Hi Jourdain,

Thank you for your reply and a happy new year to you. Visualizer is not bundled with the OpenFOAM version of paraview.

Please find below a link to downloading OpenFOAM version 5 on ubuntu 16.04, this comes coupled with paraviewopenfoam54 (this is the one which I am using): https://openfoam.org/download/5-0-ubuntu/

Windows10 (OpenFOAM version6): https://openfoam.org/download/windows-10/

I have not worked on macOS, so I have not tested it, but below is the link: https://openfoam.org/download/6-macos/

Looking forward to hearing back from you. Thanks and Regards, Shailesh

Shaileshbg1 commented 5 years ago

Hi Jourdain,

I was able to get visualizer with python launcher and apache front end working. I do not know if this is the right way but I downloaded paraview 5.6.0 binary and changed all my configuration files to point to that instead of the paraviewopenfoam54 (paraview 5.4.0 version) which came in with openfoam5. Since the set up is with the paraview binaries, I deleted the npm installed visualizer,. With a few changes to index.html, I am now able to specify the data which I want to view by passing "?data=" string in the url. Thank you for your help, now I would like to load a state file (.pvsm) file, I came across this issue https://github.com/Kitware/visualizer/issues/47 where you have explained that it is possible to preload a state file by changing a few parameters. I am sorry I went through them, but could not understand which are the parameters to be changed. Could you please let me know, or point me to some documentation, on how to load a state file.

There was a curious thing which I observed when I downloaded ParaView-5.6.0-osmesa-MPI-Linux-64bit, it did not have a paraview executable in the bin directory, is this as expected? I then went on to download ParaView-5.6.0-MPI-Linux-64bit version.

I look forward to hearing back from you.

Thanks and Regards, Shailesh

jourdain commented 5 years ago

Loading a state file or a data file is the same thing with Visualizer. So in some way you should be all-set. The only difference with state loading is that the view and other proxy get replaced which require the client to update itself to use those new proxies.

Regarding your question on the osmesa version of ParaView not having ParaView make sense as osmesa stands for off screen mesa. Those binaries are meant to be used on the server without GPU and display. In which case having a Qt application would not make sense.

Shaileshbg1 commented 5 years ago

Hi Jourdain,

Thank you for your help, I was able to load a state file in Visualizer and hence successfully configure a multi-user set up with apache front end and python launcher.