Name

opkg — Format for OSCAR packages (opkg)

Introduction

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:

  1. opkg-<package>

  2. opkg-<package>-server

  3. 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.xmlrequired
configurator.html/optional
scripts/optional
doc/optional
testing/optional


OSCAR Package Source Files

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 Directory

This 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 namePackageDescription
api-pre-installopkg-<package>native pre-install script
api-post-installopkg-<package>native post-install script
api-pre-uninstallopkg-<package>native pre-removal script
api-pre-configureopkg-<package>Prepare package configuration
api-post-configureopkg-<package>Process results from package configuration
api-post-imageopkg-<package>Perform configuration with knowledge about cluster nodes
api-post-deployopkg-<package>Perform final configuration with fully install/booted cluster nodes
api-post-uninstallopkg-<package>native post-removal script
server-pre-installopkg-<package>-servernative pre-install script
server-post-installopkg-<package>-servernative post-install script
server-pre-uninstallopkg-<package>-servernative pre-removal script
server-post-uninstallopkg-<package>-servernative post-removal script
client-pre-installopkg-<package>-clientnative pre-install script
client-post-installopkg-<package>-clientnative post-install script
client-pre-uninstallopkg-<package>-clientnative pre-removal script
client-post-uninstallopkg-<package>-clientnative post-removal script


Native Packaging System Scripts

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:

Sample scripts are available in /usr/share/doc/opkg/samples/scripts directory if you installed an opkgc package.

Non-Native Packaging System Scripts

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.

Notes

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.

doc Directory

All files in this directory are included as documentation of the opkg-<package> package. Depending on standards of distributions, these files are translated into HTML or PDF files. Hence, recommended language for documentation is either LaTeX or DocBook.

Package configuration

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.

Native Generated Packages

opkg-<package>

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.

opkg-<package>-server

opkg-<package>-server depends on oscar-base-server package plus other specified packages, if any. It is installed on the server. Its main goal is to describe dependancies for server side of the software. It may also contain post installation or removal scripts.

opkg-<package>-client

opkg-<package>-client depends on oscar-base-client package plus other specified packages, if any. It is installed on the client nodes image. Its main goal is to describe dependancies for client side of the software. It may also contain post installation or removal scripts.

Author

This manual has been written by the Core OSCAR Team.

See Also

  • opkgc (1)