opkg — Format for OSCAR packages (opkg)
This manual describes the structure of an OSCAR package.
OSCAR packages (opkg) describes software in a multi-distribution way and with cluster-wide characteristics.
The compiler for opkg is opkgc. It produces a set of three native (RPM or Deb) packages:
opkg-<package>
opkg-<package>-server
opkg-<package>-client
We call OSCAR package source (opkg source) a directory containing needed files to build an OSCAR package (opkg). The following is the list of files composing an opkg source. the section called “OSCAR Package Source Files” contains a detailed description of each files.
Table 1. OSCAR Package Source
config.xml | required |
configurator.html/ | optional |
scripts/ | optional |
doc/ | optional |
testing/ | optional |
config.xml
File
The file config.xml
contains the
description of the package (authors, dependancies,
changelog, informal description, etc.).
It is described in a formal way by a XML schema located in
/usr/share/doc/opkg/opkg.xsd
if you
installed the opkgc. The schema is also
available online at http://svn.oscar.openclustergroup.org/trac/oscar/browser/pkgsrc/opkgc/trunk/doc/opkg.xsd
configurator.html
The file configurator.html
is an HTML
file containing a form. Input fields are used to obtain user
input.
See the section called “Package configuration” for more information.
scripts
DirectoryThis directory contains executable scripts executed before or after package installation or removal, or during other stage of the deployment of an OSCAR cluster.
Table 2. opkg scripts
File name | Package | Description |
---|---|---|
api-pre-install | opkg-<package> | native pre-install script |
api-post-install | opkg-<package> | native post-install script |
api-pre-uninstall | opkg-<package> | native pre-removal script |
api-pre-configure | opkg-<package> | Prepare package configuration |
api-post-configure | opkg-<package> | Process results from package configuration |
api-post-image | opkg-<package> | Perform configuration with knowledge about cluster nodes |
api-post-deploy | opkg-<package> | Perform final configuration with fully install/booted cluster nodes |
api-post-uninstall | opkg-<package> | native post-removal script |
server-pre-install | opkg-<package>-server | native pre-install script |
server-post-install | opkg-<package>-server | native post-install script |
server-pre-uninstall | opkg-<package>-server | native pre-removal script |
server-post-uninstall | opkg-<package>-server | native post-removal script |
client-pre-install | opkg-<package>-client | native pre-install script |
client-post-install | opkg-<package>-client | native post-install script |
client-pre-uninstall | opkg-<package>-client | native pre-removal script |
client-post-uninstall | opkg-<package>-client | native post-removal script |
As shown on Table 2, “opkg scripts”, some scripts are integrated into the native package system (RPM or Deb) as pre | post - install | removal scripts. These scripts must be written in sh language. It is the responsability of the author to write scripts which comply with generated packages policies:
for RPM packages, a detailed description of scripts API is at http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html#S2-RPM-INSIDE-ERASE-TIME-SCRIPTS,
for Debian packages, please refer to the Debian Policy Manual, at http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
Sample scripts are available in
/usr/share/doc/opkg/samples/scripts
directory if you installed an opkgc
package.
All scripts which are not described as native scripts in
Table 2, “opkg scripts” are installed with package
opkg-<package>
into
/usr/lib/oscar/packages/<package>
.
About api-pre-configure
and
api-post-configure
, please see the section called “Package configuration”
testing
Directory
All files in this directory are installed into
/usr/lib/oscar/testing/<package>
directory by the opkg-<package>
package (hence on the server).
During the testing phase of the deployment, the OSCAR
framework look for test_root
and
test_user
in this directory:
test_root
is executed as user
root,
test_user
is executed as user
oscartst.
There are obvious security issues with this but currently all operations in the cluster installation are being performed by rootso care is expected at all phases.
Package may obtain use input via a simple facility called the "Configurator". The package author writes a simple HTML form style document that is presented to the user if the package is selected for installation. The standard multi-pick lists, radio button, checkbox fields are avilable. Typically default values are provided to simplify matters where possible for users.
To make use of this facility create a file in the OSCAR Package
Source directory called
configurator.html
. After the selection of
the package selection phase of the OSCAR Wizard all packages
containing this file are processed by the Configurator. The
results of this processing are written out in XML format in
/usr/lib/oscar/packages/<package>/.configurator.values
. At
this point, the api-post-configure
scripts
are fired so packages may read the results of the configuration
phase. The Perl XML::Simple
module is
typically used for processing these results in conjunction with
the OSCAR_PACKAGE_HOME
environment
variable. Alternatively, you can use the Perl subroutine
readInConfigValues
available in the
OSCAR::Configbox
module.
opkg-<package> depends on oscar-base package plus other specified packages, if any. It is installed on the server. It contains various scripts to execute on the OSCAR server before or after other packahes have been installed.