Batchelor - batch job queue manager

Install instructions:

General:

The source should be unpacked to a directory outside of the webroot. If your webroot is /var/www/htdocs, then create a directory /var/www/apps to contain this and other web applications. Using a directory under the webroot is considered as bad practice and might lead to security problem.

Read the notes inside conf/apache.conf. Make sure the directory cache is writable by the user the apache server is running as.

Keep in mind:

  • The only directory writable by the webserver should be the cache directory.
  • Only the source directory should be accessable over the web.

Example:

/var/lib/http/
     +-- apps/                        // Webapps like batchelor goes here
     |     +-- batchelor/
     |             +-- cache/         // Can be moved, see conf/config.inc
     |             +-- conf/
     |             +-- include/
     |             +-- source/        // Aliased in Apache conf, see conf/apache.conf
     |             +-- utils/         // Contains the command wrapper script.sh
     |             +-- template/      // UI templates (modify at will).
     +-- cgi-bin/
     +-- htdocs/                      // The standard webroot, plain HTML
     +-- error/                       // Apache internal
     +-- icons/                       // Apache internal

The cache directory:

All job gets spooled under cache like this:

 cache/
    +-- jobs/
          +-- hostid1/                // Unique host ID
          |      +-- timestamp1/      // The job directory
          |      |      +-- xxx       // Any output files (stdout, jobid, a.s.o.)
          |      |      +-- result/   // The result from the runned job
         ...    ...    ...
          |      +-- timestampN/
          |      |      +-- xxx
          |      |      +-- result/
         ...    ...    ...
          +-- hostidN/
          |      +-- timestamp1/
          |      |      +-- xxx
          |      |      +-- result/
         ...    ...    ...

The cache directory must be rwx for the user the web server is running as.

Configure the package (batchelor):

Go inside the conf directory. Copy apache.conf.in -> apache.conf and config.inc.in -> config.inc. Edit these two files and include apache.conf in your main Apache configuration (i.e. /etc/apache/httpd.conf).

The next step is to define the tasks that constitutes your web application. This is done inside utils/script.inc, create the file by making a copy of utils/script.inc.in.

You can customize your user interface by making copies of the files inside the template directory (copy *.ui.in -> *.ui).

Check your installation by pointing a browser at http://localhost/batchelor/check.php or run it from inside the source directory as 'php check.php'.

Testing the job queue:

A small C-source program (include/simula.c) exist for testing the job queue. Compile it with i.e. 'gcc -Wall -O2 simula.c -o simula' if you want to test the job queue (its the default command runned from inside include/script.sh).