Files
Pmodules/doc/Overlays.adoc
T
2022-07-29 14:55:31 +02:00

3.1 KiB

Overlays

Please note: This document is work in progress!

1. What are Overlays and for what can they be used?

2. Overlay configuration

2.1. System wide

2.1.1. Example

Example 1. A system wide configuration file /opt/psi/config/Pmodules.yaml
DefaultGroups: Tools:Programming
DefaultReleaseStages: stable
ReleaseStages: unstable:stable:deprecated
TmpDir: /opt/psi/var/tmp/${USER}
DistfilesDir: /opt/psi/var/distfiles

Overlays:
  base:
    install_root: /opt/psi
    modulefiles_root: /opt/psi
  devel:
    install_root: /opt/psi
    modulefiles_root: ${HOME}/modulefiles

2.1.2. YAML Format

Example 2. Format
Overlays:
  <name>:
    install_root: <installation-root>
    modulefiles_root: <modulefiles-root>
    type: <type of overlay>
  ...
<name>

Name of overlay. Note: whitespace in the name is not supported.

<name>.install_root

The root of the software installation. This key is mandatory.

<name>.modulefiles_root

The root of the modulefile hierarchy. This key is optional and defaults to `<name>.install_root>

<name>.type

The type of the overlay, see below. This key is optional and the default value is n.

2.1.3. Overlay types

n

Normal overlay.

h

Hiding overlay.

r

Replacing overlay.

2.2. User defined overlays

Each user can define his own overlays in $HOME/.Pmodules/Pmodules.yaml.

3. Working with overlays

4. Building modules

The old format of the variants file is simple but very limited and almost impossible to extend for new features. To overcome the limitations a new format using YAML for variants files has been introduced. For the time being both format are supported. But it is highly recommended to use the YAML format for new modules and to migrate existing variants files in the old format to the new.

4.1. With a YAML variants file

4.1.1. Example of a variants file in YAML format

Example 3. A YAML variants file
overlay: base

hdf5_serial/1.12.2:
- with: gcc/{5.5.0,6.5.0,7.5.0,10.2.0,10.3.0}
  relstage: stable
- with: gcc/{8.5.0,9.5.0,11.3.0,12.1.0}
  relstage: unstable
  overlay: devel

4.1.2. Format specification

YAML format
relstage: <default-release-stage>
overlay: <default-overlay>
group: <default-group>
systems: <default-systems>
compilers: <supported-compilers>

<name>/<version>:
  - with: <hierarchical-build-dependencies>
    dependencies: <other-build-dependencies>
    relstate: <release-stage>
    overlay: <overlay>
    systems: <systems>
  ...
...

4.1.3. Defaults

Default values can be overriden per version/variant.

overlay

The default overlay the module will be installed in. This value can be overriden for dedicated versions/variants.

systems

The default for supported systems.

4.1.4. Versions and Variants

<name>/<version>

An array with variants for this version.

<name>/<version>.[i].with

Hierarchical dependencies for variant i.

<name>/<version>.[i].dependencies

Build/run-time dependencies for variant i.

<name>/<version>.[i].relstage

Relase stage of variant i.

<name>/<version>.[i].overlay

Overlay of variant i.

<name>/<version>.[i].systems

Supported systems.

4.2. Legacy format