LHCb Platform Utilities
This is a project started to coordinate between LHCb Core Software and LHCbDirac platform compatibility information.
It follows up on discussions in
- LHCBDIRAC-158: Fixing "Platforms" and "SystemConfig" parameters
- LBCORE-1227: Enable -m sse4.2 in gcc6.2 opt compilation
- LBCORE-1228: Provide a CMTCONFIG build with -m avx2
- LHCBDIRAC-626: dirac-pilot and CPU architecture
- LBCORE-1247: extend lb-run to understand the special platform "best"
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
orID_LIKE
containrhel
orsuse
we keep only up to the first.
- otherwise we remove all occurrences of
.
- if
VERSION_ID
is not present and the name isdebian
we set the version totesting
- if
- the version is extracted from the field
- the name is extracted from the field
- file
-
- file
/etc/redhat-release
-
-
- the name is
-
-
slc
if it containsCERN
-
sl
if it containsScientific Linux
-
centos
if it containsCentOS
-
rhel
if it containsRed Hat Enterprise Linux
-
- the version is the number after the word release, up to the first
.
-
- file
-
- 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.
- the name is extracted from the field
- file
[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