wiki:FactoryManual/StandardFactory

Factory Manual: Using the standard factory

<< Previous: Setting up your account | Next: OOOServer backend >>

This chapter details the installation and configuration of the standard factory that is distributed by Officeshots.org. If you have an office application that is not already supported you might like to consider extending the standard factory code to include your office application. On the other hand, you can implement everything yourself using the XML-RPC API, in which case you might like to skip this chapter. If you want to develop a factory that builds on the standard factory then you want to read this so you understand how configuration works.

Downloading and installing the standard factory

Download and installation of the standard factory is detailed in Quickstart. Running the --sniff option to configure-backend.py will copy conf/config.default.ini to conf/config.ini for you. If you do not want to run the --sniff step you will have to manually copy the default configuration file.

Settings in the global section

Change the settings in the global section according to your preferences.

factory_name
The name of your factory. This must match the name of the factory that you created on the website. You can pick any name you like but all your factories must have a different name.
transport
Which SSL transport you want to use. Not all transports work on all platforms. Currently supported are m2crypto which requires the Python M2Crypto library, and pyssl which uses Python's built-in HTTPS connection. The default is currently mycrypto because it allows the use of PEM encrypted SSL client certificates.
log_file
The logfile that you want to log to.

By default log_file is set to /tmp/officeshots.org on non Windows machines and relates to your temporary path on Windows. You might like to make this log stored in your home directory instead to avoid it being deleted after a period of time by the system software. You are strongly suggested to change this parameter.

log_level
Determines the verbosity of the log. Can be set to one of debug, info, warning, error or critical.
log_format
Determines the format of the log entries. Please see the Python documentation on logging for more detail.
xmlrpc_endpoint
The XML-RPC endpoint. This should normally be https://www.officeshots.org/xmlrpc
tls_certificate_file
A full path pointing to the file containing your PEM-encoded SSL/TLS certificate.
tls_key_file
Full path pointing to the file containing your PEM-encoded SSL/TLS private key. This can be the same file as your certificate.
daemon
Set this to "yes" to run the factory as a daemon, "no" to run in the foreground
pidfile
Full path to the pidfile that you want to use when running as a daemon
load_max
The maximum system load. If the system load is greater than this value then the factory will sleep instead of poll for new jobs. This has currently no effect on Windows.
tmp_files
Path to a directory that will be used to store temporary files.
backends
A comma separated list of backends (applications) that are enabled. For every worker that you added to your factory on the server you should have a backend in your configuration file. See below for more information about backends.

Configuring backends

For every worker that you added to your factory on the Officeshots website you should have a backend in your configuration file. You can name the backends any way you like. Add them all to the backends in a comma separated list. Then, for all the backends in that list you need to have a separate configuration section. For example, if you added AbiWord? and Gnumeric as workers on the Officeshots website then you need two backends in your configuration file.

Example configuration

[Global]
backends = my_abiword, some_old_gnumeric

[my_abiword]
# Configuration options for AbiWord

[some_old_gnumeric]
# Configuration options for Gnumeric

If you do not want to use certain backends/sections then you only need to remove them from the backends line. You do not need to remove the entire sections. All the backends have at least a few configuration options in common.

If you do not want to use certain backends/sections then you only need to remove them from the backends line. You do not need to remove the entire sections. All the backends have at least a few configuration options in common.

application
The name of the application. This must be the same as the application name configured on the website.
version
The version number of the application, such as "3.0" or "2003 SP2".
doctypes
A comma separated list of doctypes codes that the application can handle, such as odt, ods or odp. This must be a subset of the doctypes that the application can handle according to the server. This setting should match the document types that you have configured on the server. See Configuring your factory.

These are document type codes not extensions. The document type codes are defined on the server. The odt code for example matches both odt (text) and ott (text template) files.

formats
A comma separated list of format codes that the application can process such as png, pdf or odf.
backend
The name of the Python backend class that implements the worker.

Backend classes

Besides these standard configuration options each backend can have extra configuration options depending on the backend type. Currently two different backend classes have been implemented:

Older backends which might need some updates to work

Running a document conversion locally

You can perform a local test of one or more of the backends that your factory will be offering. See Factory Manual: Local document conversion for details.

Running the standard factory

To run the standard factory, execute the src/factory.py script with one of the commands start, stop or restart.

start
Start the factory.
stop
If the factory is running as a daemon, stop it.
restart
If the factory is running as a daemon, restart it.

There are a couple of extra commandline arguments that you can pass to this script.

--?, --h, --help
Show the help on the commandline options.
-c, --config
Full path to the configuration file to use. By default conf/config.ini is used.
-d, --debug
Turn on debugging. When debugging is on the factory will not run as a daemon, log_level will be set to debug, all log messages will appear on the console and all XML-RPC requests and responses will be echoed.

Running as a service

There is an init script for running the factory as a system service in Debian and derivative Linux distributions. You can find this init script in utils/officeshots-factory. Note that this init script depends on the oooserver init script for running OpenOffice.org as a service. If you do not run OpenOffice.org in your factory, remove the dependency on oooserver from the top of the init script.

To use the script, copy it to /etc/init.d/officeshots-factory and edit the configuration settings in the file. Then execute the following command to install it to the proper runlevels:

# update-rc.d officeshots-factory defaults

Make sure that you are using non-encrypted SSL client certificates when you run the factory as a service. If you use encrypted certificates then the factory will promt for your password every time you boot

<< Previous: Setting up your account | Next: OOOServer backend >>

Last modified 19 months ago Last modified on 08/19/15 05:12:25