mg_container_wizard

Name

Container creation wizard -- Make the creation of container definitions simpler

Synopsis

$DAQBIN/mg_container_wizard database-name

DESCRIPTION

A container in the manager is a run-time environment. A containzerized run-time environment includes the following:

The container wizard provides a simplified method to create new container definitions in a manager configuration database. It depends on a configuration file to define the set of container images (linux run-times), and where the /usr/opt filesystems live, and presents a list of the names associated with those container images (in the configuration file).

Once a container image has been selected (by double clicking its name in the list of containers), the /usr/opt/daq for that container is probed for available NSCLDAQ versions. Once one of thiose is selected (by double-clicking it's installation directory from the list), the user is presented with a subset of the mg_cfgcontainers container editor as is given the opportunity to add and remove bindings from the filesystem the container sees.

Note that removing the binding that maps to /usr/opt will likely make the containe fail unless a functioally equivalent binding is used to replace it.

When the container file system has been configured appropriately simplyy click Ok to enter the container into the configuration database selected on the command line.

Note that the configuration editor initiated by the main configuration menu; mg_config has been written so that it's New button will run the container wizard.

Container definition file

For the wizard to work properly it needs:

  1. To have a configuration file that defines the available containers.

  2. To be able to see the /usr/opt file systems for all of the containers defined in the configuration file.

The configuration file must be named containers.ini and is looked for in the following directories in the following order (first find terminates the search).

The containers.ini file is in the format of an ini file or, more formally a toml file.

Ini files are divided into sections. Each section is introduced by its name in square brackets. For example a line containing: [CONFIG] would introduce the CONFIG section.

The lines in each section can contain several key/value pairs, one per line. These are of the form key=value. For example. path=/scratch/nscl-bullseye.img gives the path key the value /scratch/nscl-bullseye.img. The keys within each section are indpendent of the keys in any other section. Thus you can think of a section as a namespace that holds its keys.

The containers.ini file has one mandatory section CONFIG and a section for each container image it supports. The section name for the containers is used as the container's base name. That is then qualified by the version of NSCLDAQ selected to produce the container's name for the manager database.

The CONFIG section is mandatory. It must contain the following keys:

native_tree

This is the location of the directory tree that contains all of the /usr/opt filesystems for the containers, in the native system. At the FRIB, this has the value /usr/opt

container_tree

This is an alternate location at which the /usr/opt trees can be found. It is provided to allow the wizard to run within a container, which has a specific mapping to /usr/opt, while the wizard, nonetheless needs to see all of those trees to be able to probe the set of available NSCLDAQ versions.

In addtion to the CONFIG section, the configuration file must have one section for each supported container image. The name of each section is the base name of the container (which will be qualified by the version of NSCLDAQ selected. These sections have both mandatory and optional keys:

path (mandatory)

The value of this key is a path relative to the value of native_tree or container_tree (both will be searched) for the singularity image of the container associated with this section.

usropt (mandatory)

The path, again relative to either native_tree or container_tree in which the /usr/opt directory tree for this container can be found. This path, relative to native_tree will be bound to /usr/opt. It will also be probed for NSCLDAQ versions.

bindings (optional)

The value of this key, if it's supplied is a valid value to the --bind option to the singularity command, as such it can specify several comma separated bindings strings.

EXAMPLE

Example 1. Sample containers.ini file


[CONFIG]
native_tree=/usr/opt
container_tree=/non-container

[buster]
path=/usr/opt/nscl-buster.img
usropt=opt-buster

[jessie]
path=/usr/opt/nscl-jessie.img
usropt=opt-jessie

[bullseye]
path=/usr/opt/nscl-bullseye.img
usropt=opt-bullseye
bindings=/scratch,/projects/daq:/daq

                

FILES

containers.ini

Container description file.