HowTo install povray demos

From ComputeMode
Jump to: navigation, search

This page describes the steps to install the povray demonstrations on a computemode server based on Debian SQueeze 64bits.


Requirements

POVRAY demos have a few requirements :

  • a user named: "pov"
  • APACHE + PHP
  • SUDO command
  • POVRAY 3.6
  • A BATCH MANAGER (like oar)
  • DISTRIBUTED FILE SYSTEM (NFS at least)
  • ImageMagick
  • SCREEN command
  • Scripts and scenes
  • Additional components on computation nodes


Requirement additional informations

  • the user "pov"

You can easily add a new user with the following command:

# adduser pov


  • APACHE + PHP

The server must be installed and PHP scripts must be executables.


  • SUDO

Add to /etc/sudoers :

www-data ALL=(pov) NOPASSWD: ALL

which tells sudo to let the user the Apache web server uses, impersonate the pov user.


  • POVRAY 3.6

For the installation of POVRAY 3.6 on Debian Squeeze:

# cat <<EOF >> /etc/apt/sources.list
deb http://ftp.fr.debian.org/debian/ stable main non-free contrib
EOF
# apt-get update
# apt-get install povray povray-examples

The tests have been done with povray 3.6 which have to be installed on the computations nodes. A scene rendering must be runnable on the computation nodes (paths, scripts, textures, etc).

  • To authorize povray to write results you have to edit the povray.conf file on your image:
# vi /cm/debian/orig/etc/povray/3.6/povray.conf

and change the section:

[File I/O Security]
restricted

to:

[File I/O Security]
none
  • A BATCH MANAGER (with oar)

This has been tested with OAR 2.3.5 but should work with any other batch manager.

--- YOU MUST EDIT 'go.sh' so that the batch manager environment gets set. ---


  • DISTRIBUTED FILE SYSTEM (NFS at least)

This demo relies on the fact that the file system is distributed (NFS is used). Some nasty cache effects may appear, if the image merging is not computed on the main node (there are already some workarounds in the codes but not tested thoroughly enough).


  • ImageMagick

ImageMagick's convert is used to convert the file from tga to png. For its installation:

# apt-get install imagemagick


  • SCREEN command

SCREEN is used to launch and to follow on the web at the same time the computation. To install screen, just type:

# apt-get install screen


  • Scripts and scenes

To finish you have to get the povray scenes and shell scripts to launch the computation:

# su - pov
# cd ~pov/
# wget http://computemode.imag.fr/files/debian/squeeze/demos/pov3/demos_povray.tgz
# tar zxvf demos_povray.tgz


  • Additional component on computation nodes

To install additionnal sofwares on computation nodes you can use a chrooted environment. If your exported image is in the /cm/debian directory, just type:

# cd /cm/debian/orig
# chroot . /bin/bash
# apt-get install povray povray-examples
# apt-get install ttf-mscorefonts-installer


  • To access to the povray's demos:
# ln -s ~pov/public_html /var/www/

How to it should run

  1. There should be a standard HTML page with a link to the file that the user wants rendered (http://your-server-address/public_html/ for example)
  2. When a link is clicked, a script is launched and run as the Apache user. Its role is to parse the request and call the other scripts.
  3. This script generates some logs file and will call the command: sudo -u pov ./prego.sh file.pov
  4. ./prego.sh will output some information (in HTML) on what it's doing and will display the URL to access the image.
  5. Then, it calls 'go.sh' which will now generate the tasks, submit them to the batch manager thanks to qsub, then start merge the results.
  6. If the user clicks on the image links, it will be possible to observe the image being rendered


NB: it's currently really too simple for a full production environment (lacking complete escaping etc.)

NB: currently, there must be a scenes directory containing the scenes (~pov/scenes)

NB: the pov user will be the one submitting jobs to the batch manager so it has to have enough privileges

NB: there are issues if a task is aborted as the script may fail in merging the image parts and start looping endlessly.

NB: the demo is not foolproof, for instance if two jobs are submitted at a same time the second one will be scheduled after the first one. The rendering of the 2nd image will appear to be much more longer to start.

Personal tools
Namespaces

Variants
Actions
user portal
developer portal
wiki stuff
Tools