Skip to content
Snippets Groups Projects
Commit f23764ed authored by Damian Alvarez's avatar Damian Alvarez
Browse files

Let's do the check at parsing time, and fix a couple of format issues and oopsies

parent a294da12
Branches
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ VETOED_INSTALLATIONS = { ...@@ -46,7 +46,7 @@ VETOED_INSTALLATIONS = {
'juwelsbooster': ['impi'], 'juwelsbooster': ['impi'],
'juwels': [], 'juwels': [],
'jurecadc': [], 'jurecadc': [],
'jurecabooster': ['OpenMPI', 'CUDA', 'nvidia-driver', 'UCX', 'NVHPC'] 'jurecabooster': ['OpenMPI', 'CUDA', 'nvidia-driver', 'UCX', 'NVHPC'],
'jusuf': ['impi'], 'jusuf': ['impi'],
'hdfml': [], 'hdfml': [],
} }
...@@ -64,10 +64,26 @@ REQUIRE_MODALTSOFTNAME = { ...@@ -64,10 +64,26 @@ REQUIRE_MODALTSOFTNAME = {
"intel-compilers": "Intel", "intel-compilers": "Intel",
} }
def installation_vetoer(ec):
"Check whether this package is NOT supposed to be installed in this system, and abort if necessary"
name = ec['name']
system_name = os.getenv('LMOD_SYSTEM_NAME')
if name in VETOED_INSTALLATIONS[system_name]:
print_warning(
"\nYou are attempting to install software that should not be installed in this system.\n"
"Please double check the list of packages that you are attempting to install. The following\n"
f"packages can't be installed in {system_name}:\n"
)
for package in VETOED_INSTALLATIONS[system_name]:
print(f"- {package}")
exit(1)
def parse_hook(ec, *args, **kwargs): def parse_hook(ec, *args, **kwargs):
"""Custom parse hook to manage installations intended for JSC systems.""" """Custom parse hook to manage installations intended for JSC systems."""
# First of all check if this should be installed
installation_vetoer(ec)
ec_dict = ec.asdict() ec_dict = ec.asdict()
# Compilers are are a family (in the Lmod sense) # Compilers are are a family (in the Lmod sense)
if ec.name in SUPPORTED_COMPILERS: if ec.name in SUPPORTED_COMPILERS:
...@@ -193,28 +209,10 @@ family("mpi") ...@@ -193,28 +209,10 @@ family("mpi")
" eb --robot=$EASYBUILD_ROBOT:$EBROOTEASYBUILD/easybuild/easyconfigs --try-update-deps ...." " eb --robot=$EASYBUILD_ROBOT:$EBROOTEASYBUILD/easybuild/easyconfigs --try-update-deps ...."
) )
def installation_vetoer(self):
"Check whether this package is NOT supposed to be installed in this system, and abort if necessary"
ec = self.cfg
name = ec['name']
system_name = os.getenv('SYSTEMNAME')
if name in VETOED_INSTALLATIONS[system_name]:
print_warning(
"\nYou are attempting to install software that should not be installed in this system.\n"
"\nPlease double check the list of packages that you are attempting to install. The following\n"
f"\npackages can't be installed in {system_name}:\n"
)
for package in VETOED_INSTALLATIONS[system_name]:
print_warning(f"- {package}\n")
exit(1)
def pre_ready_hook(self, *args, **kwargs): def pre_ready_hook(self, *args, **kwargs):
"When we are building something, do some checks for bad behaviour" "When we are building something, do some checks for bad behaviour"
ec = self.cfg ec = self.cfg
# First of all check if this should be installed
installation_vetoer(ec)
# Grab name, path, toolchain, install path and check if we are installing # Grab name, path, toolchain, install path and check if we are installing
# GCCcore/MPI # GCCcore/MPI
name = ec["name"] name = ec["name"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment