LHCb User Environment

Introduction

To perform any software related task in LHCb, from submitting a job to the Grid to developing core framework components, we need some tools and some environment settings. Knowing these details is not obvious for newcomers, and it is not practical for experienced users to deal with the low level settings.

For these reasons, the LHCb Core Software group provides a collection of tools and settings to simplify day-to-day work of LHCb users, both physicists and developers.

Flavours

The tools and settings are continuously evolving with bug fixes and improvements. So to avoid disruptions to users and running jobs, we deploy fixes and changes in stages, or flavours:

unstable

where we deploy new features and possible disruptive changes (updated automatically)

testing

only contains new fixes or minor changes not yet validated (updated automatically)

stable

default flavour, new versions of the tools are promoted to stable only after they have been validated in testing (updated manually); important: until the 11th of May 2020, stable is equivalent to legacy (i.e. the old LbLogin environment)

Another special flavour is defined for very special cases, but should not be used unless suggested by experts

legacy

version of the tools used during Run1 and Run2 (LbLogin), kept mainly for reference, not maintained

Group login

Enabling common environment settings for a group of people is not uncommon, so the HEPiX forum helps defining guidelines for such use case. Machines configured according to their specifications, like CERN Linux Public Login User Service (LXPLUS) cluster, activate user environment customizations based on the group the user belongs to, it’s the so called group login.

The LHCb group login script lives in the project LbEnvBootstrap and is deployed to the CVMFS location /cvmfs/lhcb.cern.ch/lib/etc/cern_profile.sh (a tcsh version is available with limited support, see Unix shell support).

The group login script tasks are

  • set some CERN specific environment variables

  • enable the LHCb User Environment (LbEnv) in one of the available flavours

User configuration of group login

For some special cases (e.g. development of the LHCb User Environment tools) it might be advisable to avoid part or all of the group login procedure, or to choose a non default flavour. For that purpose we provide a few hooks. The following files in the user home directory activate special behaviours:

~/.nogrouplogin

if present, prevent the execution of the group login script, so no customization of the environment is applied

~/.nolbenv

if present, disable the LHCb User Environment, but still set CERN specific variables, including helper shell aliases to enable the LHCb User Environment by hand

~/.lbenv_flavour

allows the user to select which flavours of the LHCb User Environment must be used, it must contain any of allowed flavour names (stable, testing, etc.); if the file is missing or its content invalid, the stable flavour is used

For example, to enable the testing flavour:

# make sure the customization is enabled
rm ~/.nogrouplogin ~/.nolbenv
# select "testing" flavour
echo testing > ~/.lbenv_flavour

Unix shell support

During the LHCb Core Software meeting of the 12/12/2018 (https://indico.cern.ch/event/779237/), the following policy was decided:

  1. bash is the officially supported shell

    • It should be used for production jobs

    • It will be used in all environment tools integration/regression tests

  2. tcsh support of the existing code will be done on a best effort basis, i.e. when time allows and not critical

    • New features will not be ported

    • Deprecation warnings will be added to LbEnv when sourcing from tcsh

  3. Support for bourne compatible shells such as zsh will be done on a best effort basis

    • We will avoid using really bash-specifics constructs

    • we will rely on users to come to us with merge requests as we will not investigate all shells

Rolling back to Python 2

On 28th September 2020 the stable LbEnv environment was updated to Python 3. This should be transparent however if issues are found they should be reported to lhcb-core-soft@cern.ch. As a temporary workaround a Python 2 based LbEnv environment can be restored on lxplus by running:

$ touch ~/.nogrouplogin
# Log out and back in again
$ export OVERRIDE_LBENVROOT=/cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/941/stable/x86_64-centos7
$ rm ~/.nogrouplogin
$ source /cvmfs/lhcb.cern.ch/lib/LbEnv-stable