Skip to content

Commit

Permalink
More consistent platform priority
Browse files Browse the repository at this point in the history
This fixes an inconsistency observed in GRID jobs when loading a software package "A".

The bug was:
- The GRID runtime determines available platforms (say el8 and el7) for package A 
- then launches an el8 apptainer container
- alienv executed inside el8 container loads el7 software, inconsistent with the choice of el8 container ... and despite the fact that el8 software A is actually available.

Bug fixed by slightly adjusting the platform priority: We always search the current platform first of all before going elsewhere.
  • Loading branch information
sawenzel authored Apr 5, 2024
1 parent 7f371f4 commit d399f68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cvmfs/alienv
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ case $distro_name in
;;
8*)
distro_xrelease=8.x
platform=el7
platform=el8
;;
9*)
distro_xrelease=8.x
Expand Down Expand Up @@ -303,9 +303,15 @@ alien="AliEn"

# We cannot cross-pick pacakages among different platforms but we have to
# pick all packages consistently from a certain platform tree. When listing
# packages we show them all, when we load a package e define a priority list and
# packages we show them all, when we load a package we define a priority list and
# we always have a fallback for backward compatibility.
PLATFORM_PRIORITY="el9-$uname_m el7-$uname_m el6-$uname_m el5-$uname_m el8-$uname_m"

# The above priority is a general search priority. However, given a platform, we should actually
# start searching for software matching this precise platform and only later fall back to other
# platforms. This prevents loading el9 or el7 software, when I am actually on el8 (and el8 software is available).
PLATFORM_PRIORITY="${platform}-$uname_m ${PLATFORM_PRIORITY//${platform}-$uname_m/}"

ARGS=("$@")
PACKAGES=
EXPECT_PACKAGES=
Expand Down

0 comments on commit d399f68

Please sign in to comment.