diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index bf27492a..941a2b9a 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -183,6 +183,20 @@ else fatal_error "Failed to initialize Lmod?! (see output in ${ml_version_out}" fi +# install any additional required scripts +# order is important: these are needed to install a full CUDA SDK in host_injections +# for now, this just reinstalls all scripts. Note the most elegant, but works + +# the install_scripts.sh script relies on knowing the location of the PR diff +# assume there's only one diff file that corresponds to the PR patch file +pr_diff=$(ls [0-9]*.diff | head -1) +export PR_DIFF="$PWD/$pr_diff" + +# Only run install_scripts.sh if not in dev.eessi.io for security +if [[ -z ${EESSI_DEV_PROJECT} ]]; then + ${TOPDIR}/install_scripts.sh --prefix ${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION} --eessi-version ${EESSI_VERSION} +fi + # Make sure we start with no modules and clean $MODULEPATH echo ">> Setting up \$MODULEPATH..." module --force purge @@ -238,20 +252,6 @@ if [ ! -f ${_lmod_sitepackage_file} ]; then python3 ${TOPDIR}/create_lmodsitepackage.py ${_eessi_software_path} fi -# install any additional required scripts -# order is important: these are needed to install a full CUDA SDK in host_injections -# for now, this just reinstalls all scripts. Note the most elegant, but works - -# the install_scripts.sh script relies on knowing the location of the PR diff -# assume there's only one diff file that corresponds to the PR patch file -pr_diff=$(ls [0-9]*.diff | head -1) -export PR_DIFF="$PWD/$pr_diff" - -# Only run install_scripts.sh if not in dev.eessi.io for security -if [[ -z ${EESSI_DEV_PROJECT} ]]; then - ${TOPDIR}/install_scripts.sh --prefix ${EESSI_PREFIX} -fi - echo ">> Configuring EasyBuild..." # Make sure EESSI-extend is not loaded, and configure location variables for a diff --git a/eb_hooks.py b/eb_hooks.py index 482ade4c..4775bd44 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -408,7 +408,7 @@ def parse_hook_zen4_module_only(ec, eprefix): # Need to escape newline character so that the newline character actually ends up in the module file # (otherwise, it splits the string, and a 2-line string ends up in the modulefile, resulting in syntax error) errmsg = "EasyConfigs using toolchains based on GCCcore-12.2.0 are not supported for the Zen4 architecture.\\n" - errmsg += "See https://www.eessi.io/docs/known_issues/eessi-2023.06/#gcc-1220-and-foss-2022b-based-modules-cannot-be-loaded-on-zen4-architecture" + errmsg += "See https://www.eessi.io/docs/known_issues/eessi-/#gcc-1220-and-foss-2022b-based-modules-cannot-be-loaded-on-zen4-architecture" ec['modluafooter'] = 'if (not os.getenv("%s")) then LmodError("%s") end' % (env_varname, errmsg) diff --git a/init/eessi_defaults b/init/eessi_defaults index 654a8294..4b0c9e9d 100644 --- a/init/eessi_defaults +++ b/init/eessi_defaults @@ -8,6 +8,8 @@ # license: GPLv2 # +export EESSI_VERSION_DEFAULT='__EESSI_VERSION_DEFAULT__' + # use different defaults for RISC-V, as we want to redirect to the riscv.eessi.io repo if [[ $(uname -m) == "riscv64" ]]; then export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/riscv.eessi.io}" @@ -20,7 +22,7 @@ if [[ $(uname -m) == "riscv64" ]]; then fi else export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/software.eessi.io}" - export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=2023.06}" + export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=${EESSI_VERSION_DEFAULT}}" fi # use archdetect by default, unless otherwise specified export EESSI_USE_ARCHDETECT="${EESSI_USE_ARCHDETECT:=1}" diff --git a/init/lmod/zsh b/init/lmod/zsh index bc6e8e4d..a1894108 100644 --- a/init/lmod/zsh +++ b/init/lmod/zsh @@ -1,7 +1,7 @@ # Choose an EESSI CVMFS repository EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" # Choose an EESSI version -EESSI_VERSION="${EESSI_VERSION:-2023.06}" +EESSI_VERSION="${EESSI_VERSION:-__EESSI_VERSION_DEFAULT__}" # Path to top-level module tree export MODULEPATH="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" . "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/zsh" diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index d5105e89..d5070b9d 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -10,6 +10,7 @@ More information whatis("Description: The European Environment for Scientific Software Installations (EESSI, pronounced as easy) is a collaboration between different European partners in HPC community. The goal of this project is to build a common stack of scientific software installations for HPC systems and beyond, including laptops, personal workstations and cloud infrastructure.") whatis("URL: https://www.eessi.io/docs/") conflict("EESSI") +-- this is a version-agnostic module file, works for EESSI/2023.06, EESSI/2025.06, etc. local eessi_version = myModuleVersion() local eessi_repo = "/cvmfs/software.eessi.io" if (subprocess("uname -m"):gsub("\n$","") == "riscv64") then @@ -80,18 +81,18 @@ local archdetect_accel = archdetect_accel() -- eessi_cpu_family is derived from the archdetect match, e.g., x86_64 local eessi_cpu_family = archdetect:match("([^/]+)") local eessi_software_subdir = archdetect --- eessi_eprefix is the base location of the compat layer, e.g., /cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64 +-- eessi_eprefix is the base location of the compat layer, e.g., /cvmfs/software.eessi.io/versions//compat/linux/x86_64 local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family) -- eessi_software_path is the location of the software installations, e.g., --- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 +-- /cvmfs/software.eessi.io/versions//software/linux/x86_64/amd/zen3 local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) local eessi_modules_subdir = pathJoin("modules", "all") -- eessi_module_path is the location of the _CPU_ module files, e.g., --- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/modules/all +-- /cvmfs/software.eessi.io/versions//software/linux/x86_64/amd/zen3/modules/all local eessi_module_path = pathJoin(eessi_software_path, eessi_modules_subdir) local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") -- Site module path is the same as the EESSI one, but with `versions` changed to `host_injections`, e.g., --- /cvmfs/software.eessi.io/host_injections/2023.06/software/linux/x86_64/amd/zen3/modules/all +-- /cvmfs/software.eessi.io/host_injections//software/linux/x86_64/amd/zen3/modules/all local eessi_site_module_path = pathJoin(eessi_site_software_path, eessi_modules_subdir) setenv("EPREFIX", eessi_eprefix) eessiDebug("Setting EPREFIX to " .. eessi_eprefix) @@ -134,10 +135,10 @@ if not (archdetect_accel == nil or archdetect_accel == '') then -- The CPU subdirectory of the accelerator installations is _usually_ the same as host CPU, but this can be overridden eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir -- CPU location of the accelerator installations, e.g., - -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 + -- /cvmfs/software.eessi.io/versions//software/linux/x86_64/amd/zen3 eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) -- location of the accelerator modules, e.g., - -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/accel/nvidia/cc80/modules/all + -- /cvmfs/software.eessi.io/versions//software/linux/x86_64/amd/zen3/accel/nvidia/cc80/modules/all eessi_module_path_accel = pathJoin(eessi_accel_software_path, archdetect_accel, eessi_modules_subdir) eessiDebug("Checking if " .. eessi_module_path_accel .. " exists") if isDir(eessi_module_path_accel) then diff --git a/init/modules/EESSI/2025.06.lua b/init/modules/EESSI/2025.06.lua new file mode 120000 index 00000000..cbf80d1f --- /dev/null +++ b/init/modules/EESSI/2025.06.lua @@ -0,0 +1 @@ +2023.06.lua \ No newline at end of file diff --git a/install_scripts.sh b/install_scripts.sh index f4863686..9e98f6d7 100755 --- a/install_scripts.sh +++ b/install_scripts.sh @@ -49,8 +49,12 @@ compare_and_copy() { if [ ! -f "$destination_file" ] || ! diff -q "$source_file" "$destination_file" ; then echo "Files $source_file and $destination_file differ, checking if we should copy or not" # We only copy if the file is part of the PR - if file_changed_in_pr "$source_file"; then - echo "File has changed in the PR" + if [ ! -f "${destination_file}" ] || file_changed_in_pr "$source_file"; then + if [ ! -f "${destination_file}" ]; then + echo "File has not been copied yet ($destination_file does not exist}" + else + echo "File has changed in the PR" + fi cp "$source_file" "$destination_file" echo "File $source_file copied to $destination_file" else @@ -100,6 +104,10 @@ POSITIONAL_ARGS=() while [[ $# -gt 0 ]]; do case $1 in + --eessi-version) + EESSI_VERSION="$2" + shift 2 + ;; -p|--prefix) INSTALL_PREFIX="$2" shift 2 @@ -120,6 +128,16 @@ while [[ $# -gt 0 ]]; do esac done +if [ -z "${INSTALL_PREFIX}" ]; then + echo "EESSI prefix not specified, you must use --prefix" >&2 + exit 2 +fi + +if [ -z "${EESSI_VERSION}" ]; then + echo "EESSI version not specified, you must use --eessi-version" >&2 + exit 3 +fi + set -- "${POSITIONAL_ARGS[@]}" TOPDIR=$(dirname $(realpath $0)) @@ -146,7 +164,7 @@ copy_files_by_list ${TOPDIR}/init/Magic_Castle ${INSTALL_PREFIX}/init/Magic_Cast # Copy for init/modules/EESSI directory mc_files=( - 2023.06.lua + ${EESSI_VERSION}.lua ) copy_files_by_list ${TOPDIR}/init/modules/EESSI ${INSTALL_PREFIX}/init/modules/EESSI "${mc_files[@]}" @@ -183,3 +201,18 @@ hook_files=( eb_hooks.py ) copy_files_by_list ${TOPDIR} ${INSTALL_PREFIX}/init/easybuild "${hook_files[@]}" + + +# make sure that scripts in init/ and scripts/ use correct EESSI version +sed -i "s/__EESSI_VERSION_DEFAULT__/${EESSI_VERSION}/g" ${INSTALL_PREFIX}/init/eessi_defaults + +# replace placeholder for default EESSI version in Lmod init scripts +for shell in $(ls ${INSTALL_PREFIX}/init/lmod); do + sed -i "s/__EESSI_VERSION_DEFAULT__/${EESSI_VERSION}/g" ${INSTALL_PREFIX}/init/lmod/${shell} +done + +# replace EESSI version used in comments in EESSI module +sed -i "s@//@/${EESSI_VERSION}/@g" ${INSTALL_PREFIX}/init/modules/EESSI/${EESSI_VERSION}.lua + +# replace EESSI version used in EasyBuild hooks +sed -i "s@//@/${EESSI_VERSION}/@g" ${INSTALL_PREFIX}/init/easybuild/eb_hooks.py