Skip to content
Snippets Groups Projects

LHCb Platform Utilities

pipeline status coverage report

This is a project started to coordinate between LHCb Core Software and LHCbDirac platform compatibility information.

It follows up on discussions in

OS Id Derivation

The OS Id (os_id) is a short string used to identify the Operating System (e.g. Linux flavour, MacOS, Windows...) and its version, usually in the format <name><version>.

On Linux, the OS Id is computed from different possible sources:

  • file /etc/os-release [1]
    • the name is extracted from the field ID, up the first (optional) -
    • the version is extracted from the field VERSION_ID
      • if ID or ID_LIKE contain rhel or suse we keep only up to the first .
      • otherwise we remove all occurrences of .
      • if VERSION_ID is not present and the name is debian we set the version to testing
  • file /etc/redhat-release
    • the name is
      • slc if it contains CERN
      • sl if it contains Scientific Linux
      • centos if it contains CentOS
      • rhel if it contains Red Hat Enterprise Linux
    • the version is the number after the word release, up to the first .
  • file /etc/lsb-release
    • the name is extracted from the field DISTRIB_ID, up the first (optional) -, and made lowercase
    • the version is extracted from the field DISTRIB_RELEASE removing all occurrences of .
[1] https://www.freedesktop.org/software/systemd/man/os-release.html

Debugging

In cases where the system is not supported expected features, the lb-debug-platform script can be used, for example:

$ lb-debug-platform
Found 6 errors
    > Required CVMFS location /cvmfs/cernvm-prod.cern.ch is not mounted
    > Required CVMFS location /cvmfs/grid.cern.ch is not mounted
    > Required CVMFS location /cvmfs/lhcb-condb.cern.ch is not mounted
    > Required CVMFS location /cvmfs/lhcb.cern.ch is not mounted
    > File not found when running lb-describe-platform
    > No singularity binary found

More information to aid with debugging can be found by running lb-debug-platform --debug.

This debugging script can also be used in a standalone mode by running:

curl -L https://gitlab.cern.ch/lhcb-core/LbPlatformUtils/-/raw/master/LbPlatformUtils/debug.py > lb-debug-platform.py
python lb-debug-platform.py

NOTE: When running in this mode it is expected that lb-describe-platform, lb-run and singularity executables might not be found.

Development

To work on this project you need Poetry:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
source $HOME/.poetry/env

Then it's easy:

git clone https://gitlab.cern.ch/lhcb-core/LbPlatformUtils.git
cd LbPlatformUtils
poetry install
poetry run pytest
poetry run lb-describe-platform