imagico.de
imagico.de

imagico.de

POV-Anywhere

POV-Anywhere email communication module - Documentation

The POV-Anywhere email communication system is a separate module for exchanging data between the workspaces on different computers. The clients (the computers that render the jobs) have to register via email with a server (the computer that managers the projects and jobs) and the server distributes jobs in its local jobs directory to the idle clients which then render these in their local POV-Anywhere environment.

POV-Anywhere uses GPG so sign (and optionally encrypt) the email. In addition to gpg the following things are required:

How does it work?

The email communication module consists of two scripts:

The server script looks for pending jobs in the local jobs directory that have not yet been started and distributes them to registered clients via email. It can be run together with local clients ( povany_client) that get their jobs via file system or other means of transport.

The clients script reads the incoming email and inserts the jobs into the local system so they can be rendered by a local client. It also searches for finished email jobs and sends the render results back to the server.

Right now the system does not support multiple servers for one client but you can circumvent this limitation by running several clients as several different users.

Installation

The install script includes a basic configuration of the email system. You might have to manually set up gpg afterwards. Operation without mail signing/encryption is not supported and some basic knowledge about gpg and public key cryptography is strongly recommended for safe operation.

Prior to installing you should take care of the following things:

Running the email system

The email module scripts have to be run in addition to the standard POV-Anywhere scripts. Like these they can be run in loop mode or in single mode to be started by cron. So on the server side you will need to run both povany_pm and povany_email_server and on the client side povany_client and povany_email_client.

When the client has been correctly configured with the information of the server it should render for (email address and hostname) the rest will work automatically. Depending on the configuration you will have to confirm the client registration manually by replying the notification email. If registration is finished jobs inserted to the server workspace like described in the main documentation will be distributed to the clients and rendered automatically.

Description of the email related files

The information about the status of the email communication is stored in the POVANY_EMAIL_DIR directory which by default is $HOME/.povany/email/.

In this directory there might be the following files:

email_info

This file stores the position of the last email that has been read from the mbox file POVANY_EMAIL.

email_clients

This file only exists on the server side and contains a list of the known clients and their status. Each line in this file represents one clients and contains the following elements separated by space characters:

register_info.hostname

For every client that registers such a file is written on the server that contains the information submitted in the registration mail.

register_gpg.hostname

This file contains the public gpg key of the client sent in the registration mail.

email_status

On the client this file contains the current status code.

email_servers

This file only exists on the client side and contains the information about the server the client is registered with. Currently only one server is supported. Each line in this file represents one server and contains the following elements separated by space characters:

Status codes in the email related files

Some of the email related files described above contain status codes. These have the following meaning:

Description of the email scripts

Here is a more detailed description of the way the client and server scripts operate. The communication process itself is described later on.

the email server povany_email_server

The purpose of this script is to answer to the clients' emails and to distribute render jobs to the clients.

When started without parameters it runs in loop mode, that means it runs in a loop until it is interrupted. The -c option can be used to turn this off. This feature is especially useful to run povany_email_server automatically with cron or similar tools.

Other available command line options are:
-h <hostname>: the hostname that is used to identify the node. (if not given this is the system hostname)
-v: verbose text output to stdout
-q: minimal text output to log
-s: stop mode - send a stop signal to all running email servers
-S: force stop mode - clear the stop and running signal files
-x: clear mode - remove all email related files and exit. This will remove the information about registered clients and any status information so it is a complete reset of the email system.
-m: message mode - issued a certain message to the email system and exits. This can be called while the script is also running in regular mode. The following command line option tells what message to send. The following messages are available:

The email server first reads the new mail and acts according to it (see the communication description for details). Then offered jobs are checked for timeouts and new jobs available locally are distributed to the idle clients.

the email client povany_email_client

The purpose of this script is to answer to the server's mails and to insert jobs sent by the server into the local POVANY_JOBS_DIR directory so they can be rendered by the povany_client script.

When started without parameters it runs in loop mode, that means it runs in a loop until it is interrupted. The -c option can be used to turn this off. This feature is especially useful to run povany_email_client automatically with cron or similar tools.

Other available command line options are:
-h <hostname>: the hostname that is used to identify the node. (if not given this is the system hostname)
-v: verbose text output to stdout
-q: minimal text output to log
-s: stop mode - send a stop signal to all running email servers
-S: force stop mode - clear the stop and running signal files
-x: clear mode - remove all email related files and exit. This will remove the information about the client status and jobs so it is a complete reset of the email system.

When the client status is 0 the script sends a register mail to the server given in the configuration (POVANY_EMAIL_SERVER).

Then the script reads the new mail and acts according to it (see the communication description for details). When no jobs are currently running (either local jobs or email jobs) it then sends a client_idle mail to the server. If there are finished email jobs it sends a job_finished mail with the results and moves the local results to the POVANY_EMAIL_DIR directory for reference.

When the script receives a stop signal (by calling povany_email_client -s any currently running job is rejected (job_reject) and a client_busy mail is sent. This should be done prior to shutdown of the computer. To invoke this in non-loop mode use povany_email_client -s -c.

Details of the communication system

The information exchanged between server and client is in the subject lines and the body of the emails. The emails are signed with gpg and optionally encrypted to ensure secure communication.

The subject lines look like:

[povanywhere] hostname client_idle

[povanywhere] is an identifier that can be used to filter the mail. The next is the hostname of the machine that sends the mail. The third element is the message type.

The following types of messages are exchanged: