Kitware / paraviewweb

Web framework for building interactive visualization relying on VTK or ParaView to produce visualization data
http://kitware.github.io/paraviewweb/
BSD 3-Clause "New" or "Revised" License
163 stars 51 forks source link

Set up of files: 001-pvw.conf and launcher.config #232

Closed chris2009 closed 8 years ago

chris2009 commented 8 years ago

Hi!,

I have been trying set up paraviewweb to work with multiple sessions in one machine but I have had problems in how configure these files: 001-pvw.conf and launcher.config. They look this:

==============================================================================
launcher.config
=================================================================================
{
  ## ===============================
  ## General launcher configuration
  ## ===============================
  "configuration": {
    "host" : "192.168.1.8:8080,                           # name of network interface to bind for launcher webserver
    "port" : 8080,                                  # port to bind for launcher webserver
    "endpoint": "paraview",                         # SessionManager Endpoint
    "content": "/.../www",                          # Optional: Directory shared over HTTP
    "proxy_file" : "/home/christian/Escritorio/mapping-file/proxy.txt",  # Proxy-Mapping file for Apache
    "sessionURL" : "ws://192.168.1.8:8080/ws",       # ws url used by the client to connect to started process
    "timeout" : 5,                                  # Wait time in second after process start
    "log_dir" : "/.../viz-logs",                    
# Directory for log files
    "upload_dir" : "/.../uploadDirectory",          # Start file upload server on same port as launcher
    "fields" : ["file", "host", "port", "updir"]    # Fields not listed are filtered from response
  },
  ## ===============================
  ## Resources list for applications
  ## ===============================
  "resources" : [ { "host" : "http://192.168.1.8:8080/apps/Visualizer/", "port_range" : [9001, 9003] } ],
  ## ===============================
  ## Set of properties for cmd line
  ## ===============================
  "properties" : {
    "build_dir" : "/.../build",
    "python_exec" : "/.../build/bin/vtkpython",
    "WWW" : "/.../build/www",
    "source_dir": "/.../src"
  },
  ## ===============================
  ## Application list with cmd line
  ## ===============================
  "apps": {
    "pipeline": {
      "cmd": [
        "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_visualizer.py",
        "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
      ],
      "ready_line" : "Starting factory"
    },
    "visualizer": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_visualizer.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
    },
    "loader": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_file_loader.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
    },
    "data_prober": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_data_prober.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
==============================================================================
```==
==============================================================================
001-pvw.conf
==================================================================================

<VirtualHost *:80>
    ServerName 192.168.1.8:8080
    ServerAdmin webmaster@example-host.example.com
    DocumentRoot /home/christian/Escritorio/Proyecto/build/www
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    ### The following commented lines could be useful when running
    ### over https and wss:
    # SSLEngine On
    # SSLCertificateFile    /etc/apache2/ssl/your_certificate.crt
    # SSLCertificateKeyFile /etc/apache2/ssl/your_domain_key.key
    # SSLCertificateChainFile /etc/apache2/ssl/DigiCertCA.crt
    # <Location /home/christian/Escritorio/Proyecto/build/www>
    #   SSLRequireSSL On
    #   SSLVerifyClient optional
    #   SSLVerifyDepth 1
    #   SSLOptions +StdEnvVars +StrictRequire
    # </Location>

    # Rule for ParaViewWeb launcher
    ProxyPass /paraview http://localhost:8080/paraview

    # Rewrite setup for ParaViewWeb
    RewriteEngine On

    # This is the path the mapping file Jetty creates
    RewriteMap session-to-port txt:/home/christian/Escritorio/mapping-file/proxy.txt

    # This is the rewrite condition. Look for anything with a sessionId= in the query part of the URL and capture the value to use below.
    RewriteCond %{QUERY_STRING}     ^sessionId=(.*)&path=(.*)$ [NC]
    # This does the rewrite using the mapping file and the sessionId
    RewriteRule    ^/proxy.*$  ws://${session-to-port:%1}/%2  [P]
    <Directory "/home/christian/Escritorio/Proyecto/build/www">
        Options Indexes FollowSymLinks
        Order allow,deny
        Allow from all
        AllowOverride None
        Require all granted
    </Directory>

</VirtualHost>

I would like to know if this configuration is the correct.

Thank you for your time.
jourdain commented 8 years ago

You can't keep the comments in the json file, as it will make a json file an invalid one...

jourdain commented 8 years ago
"host" : "192.168.1.8:8080, 

So host mean "host" not "host+port" with missing ".

jourdain commented 8 years ago
"content": "/.../www", 

Is that a valid path? You are lucky that property is not useful when using apache.

jourdain commented 8 years ago
"sessionURL" : "ws://192.168.1.8:8080/ws"

This is wrong when used with Apache. If you read the documentation, you should find what to replace it with.

jourdain commented 8 years ago
/home/christian/Escritorio/mapping-file/proxy.txt

Did you make sure that security wise Apache can read that file and the launcher can write it?

jourdain commented 8 years ago
"log_dir" : "/.../viz-logs",    

Is it a valid path?

jourdain commented 8 years ago
"upload_dir" : "/.../uploadDirectory", 

Is it a valid path?

Maybe you can help me to make things clearer. How can I write in a documentation that the field should be filled up by the user with a valid path instead of left untouched?

jourdain commented 8 years ago
/.../

Please fix ALL of them with a valid path...

chris2009 commented 8 years ago

Hi Jourdain,

You are rigth, I'll fix all your observations and them I'll write you again.

Thank you very much.

jourdain commented 8 years ago

For Apache now

ServerName mean the name of your server not "name + port"

You should probably fix that too

${APACHE_LOG_DIR} with a valid path.

Otherwise that seems fine.

chris2009 commented 8 years ago

Hi Jourdain,

Now the launcher.config looks like that:


{
  ## ===============================
  ## General launcher configuration
  ## ===============================
  "configuration": {
    "host" : "192.168.1.8,                           # name of network interface to bind for launcher webserver
    "port" : 8080,                                  # port to bind for launcher webserver
    "endpoint": "paraview",                         # SessionManager Endpoint
    "content": "/home/christian/Escritorio/Proyecto/build/www",                          # Optional: Directory shared over HTTP
    "proxy_file" : "/home/christian/Escritorio/mapping-file/proxy.txt",  # Proxy-Mapping file for Apache
    "sessionURL" : "ws://192.168.1.8:8080/apps/Visualizer/",       # ws url used by the client to connect to started process
    "timeout" : 5,                                  # Wait time in second after process start
    "log_dir" : "/home/christian/Escritorio/Proyecto/build/log_dir",                    # Directory for log files
    "upload_dir" : "/home/christian/Escritorio/Proyecto/build/upload_dir",          # Start file upload server on same port as launcher
    "fields" : ["file", "host", "port", "updir"]    # Fields not listed are filtered from response
  },
  ## ===============================
  ## Resources list for applications
  ## ===============================
  "resources" : [ { "host" : "http://192.168.1.8:8080/apps/Visualizer/", "port_range" : [9001, 9003] } ],
  ## ===============================
  ## Set of properties for cmd line
  ## ===============================
  "properties" : {
    "build_dir" : "/home/christian/Escritorio/Proyecto/build",
    "python_exec" : "/home/christian/Escritorio/Proyecto/build/bin/vtkpython",
    "WWW" : "/home/christian/Escritorio/Proyecto/build/www",
    "source_dir": "/home/christian/Escritorio/Proyecto/ParaView"
  },
  ## ===============================
  ## Application list with cmd line
  ## ===============================
  "apps": {
    "pipeline": {
      "cmd": [
      ],
      "ready_line" : "Starting factory"
    },
    "visualizer": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_visualizer.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
    },
    "loader": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_file_loader.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
    },
    "data_prober": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_data_prober.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
jourdain commented 8 years ago

Correct for the log_dir and upload_dir.

But still find the issue mention earlier:

"host" : "192.168.1.8,                           # name ....

1) Remove comment

"host" : "192.168.1.8,                         

2) End the field properly

"host" : "192.168.1.8",

3) Please do the same for the other comments

jourdain commented 8 years ago

Moreover sessionURL is still wrong and also increase the timeout to 25.

The last line of that page give you the correct value:

http://kitware.github.io/paraviewweb/docs/guides/python_launcher.html

chris2009 commented 8 years ago

And when I putted in the command window this:


root@christian-All-Series:~/Escritorio/Proyecto/build# ./bin/pvpython lib/site-packages/vtk/web/launcher.py launcher.config
ERROR: Unable to read config file.
[Errno 2] No such file or directory: 'launcher.config'
<traceback object at 0x7fb7d3ba1d88>

I putted the file launcher.config in /home/christian/Escritorio/Proyecto/ParaView/VTK/Web/Python/vtk/web. It's correct?

jourdain commented 8 years ago

The launcher.config file can be anywhere.

In your case you will have to run

$ ./bin/pvpython lib/site-packages/vtk/web/launcher.py /home/christian/Escritorio/Proyecto/ParaView/VTK/Web/Python/vtk/web/launcher.config 
chris2009 commented 8 years ago

The launcher looks like:

{
  ## ===============================
  ## General launcher configuration
  ## ===============================
  "configuration": {
    "host" : "192.168.1.8",                           # name of network interface to bind for launcher webserver
    "port" : "8080",                                  # port to bind for launcher webserver
    "endpoint": "paraview",                         # SessionManager Endpoint
    "content": "/home/christian/Escritorio/Proyecto/build/www",                          # Optional: Directory shared over HTTP
    "proxy_file" : "/home/christian/Escritorio/mapping-file/proxy.txt",  # Proxy-Mapping file for Apache
    "sessionURL" : "ws://192.168.1.8:8080/ws",       # ws url used by the client to connect to started process
    "timeout" : "25",                                  # Wait time in second after process start
    "log_dir" : "/home/christian/Escritorio/Proyecto/build/log_dir",                    # Directory for log files
    "upload_dir" : "/home/christian/Escritorio/Proyecto/build/upload_dir",          # Start file upload server on same port as launcher
    "fields" : ["file", "host", "port", "updir"]    # Fields not listed are filtered from response
  },
  ## ===============================
  ## Resources list for applications
  ## ===============================
  "resources" : [ { "host" : "http://192.168.1.8:8080/apps/Visualizer/", "port_range" : [9001, 9003] } ],
  ## ===============================
  ## Set of properties for cmd line
  ## ===============================
  "properties" : {
    "build_dir" : "/home/christian/Escritorio/Proyecto/build",
    "python_exec" : "/home/christian/Escritorio/Proyecto/build/bin/vtkpython",
    "WWW" : "/home/christian/Escritorio/Proyecto/build/www",
    "source_dir": "/home/christian/Escritorio/Proyecto/ParaView"
  },
  ## ===============================
  ## Application list with cmd line
  ## ===============================
  "apps": {
    "pipeline": {
      "cmd": [
      ],
      "ready_line" : "Starting factory"
    },
    "visualizer": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_visualizer.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
    },
    "loader": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_file_loader.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"
    },
    "data_prober": {
        "cmd": [
            "${python_exec}", "-dr", "${python_path}/paraview/web/pv_web_data_prober.py",
            "--port", "${port}", "--data-dir", "${dataDir}", "-f", "--authKey", "${secret}"
        ],
        "ready_line" : "Starting factory"

But I got the next message:

root@christian-All-Series:~/Escritorio/Proyecto/build# ./bin/pvpython lib/site-packages/vtk/web/launcher.py /home/christian/Escritorio/Proyecto/ParaView/VTK/Web/Python/vtk/web/launcher.config 
ERROR: Unable to read config file.
Expecting property name: line 2 column 3 (char 4)
<traceback object at 0x7f053b44fe18>

What could be the mistake?

jourdain commented 8 years ago

I think you should read my comments... All the answer are in them. As well as in the documentation. If you can't apply them, then Kitware provide support contract. Then I'll be able to write that file for you.

chris2009 commented 8 years ago

I'm sorry Jourdain. I haven't read with attention your advices. I removed the comments in the file launcher.config.

Now I wrote : ./bin/pvpython lib/site-packages/vtk/web/launcher.py /home/christian/Escritorio/mapping-file/launcher.config And the terminal looks like in waiting mode. Is it good?

jourdain commented 8 years ago

yes that's good. Does it work?

chris2009 commented 8 years ago

I am writing http://192.168.1.8:8080/apps/Visualizer/ and it stays loading.

jourdain commented 8 years ago

Why don't you try to connect to http://192.168.1.8/apps/Visualizer/ instead?

chris2009 commented 8 years ago

In your advice:

You should probably fix that too
${APACHE_LOG_DIR} with a valid path.

should I create the APACHE_LOG_DIR by myself or I should find it inside the file /etc/apache2 because I can't find it.

jourdain commented 8 years ago

Create it yourself so you can run log analyser on it if you like. Just make sure Apache can write in it.

jourdain commented 8 years ago

Could you provide some background on what you are trying to do? Because most of your questions would depend on what you want to do with it.

For test, you can surely do whatever you want in term of file location. But in the real world, you should rely on some standard and get some help from an IT team to setup a web server in a secured way where you can deploy ParaViewWeb.

chris2009 commented 8 years ago

when I try to connect to http://192.168.1.8/apps/Visualizer/ it doesn't work. It said: Object not found.

jourdain commented 8 years ago

But just FYI, this is what you try to make it work. So that should be what you should test.

Did you enabled your virtual host?

I think you should really seek for some support contract with Kitware so we could truly spend the time helping you. Because with the amount of information we have and the fact you are not always following our recommendation, it is very hard for us to help you.

chris2009 commented 8 years ago

I am trying to investigate the ParaviewWeb to make my thesis, I have studied Computing Science and since I read about Paraview I was very interestered in this tool. So I have could run paraviewweb in my PC, but If I wanted to show this tool to my assessor or and a work team I would have to run Paraviewweb in diferents machines and is for this reason I am giving your help Jourdain.

What is your opinion?

jourdain commented 8 years ago

I see, but you seem to be missing so much background, it is very hard to help you.

jourdain commented 8 years ago

If it is just for an investigation, you should just run ParaViewWeb from the command line, like you run the ParaView application. This way it will be simpler and you won't have to deal with this server setup.

chris2009 commented 8 years ago

Ok Jourdain, thank you anyway. I learned much about that.