-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EESSI bash initialization to module file #667
EESSI bash initialization to module file #667
Conversation
Instance
|
Instance
|
Instance
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments from a visual review, will take it for a test drive.
We should also add CI to test this module file (can be done using the EESSI GitHub Action)
I'm not sure if it is really a concern, but we add an Lmod |
This also doesn't cover the cURL issue currently fixed in our initialisation script: rhel_libcurl_file="/etc/pki/tls/certs/ca-bundle.crt"
if [ -f $rhel_libcurl_file ]; then
show_msg "Found libcurl CAs file at RHEL location, setting CURL_CA_BUNDLE"
export CURL_CA_BUNDLE=$rhel_libcurl_file
fi You can use |
The one other thing missing is the current redirection we do for Zen4: software-layer/init/eessi_environment_variables Lines 51 to 59 in 1fc0cb7
|
A quick test, including my suggested changes, shows that this is missing |
Co-authored-by: ocaisa <[email protected]>
Co-authored-by: ocaisa <[email protected]>
Co-authored-by: ocaisa <[email protected]>
Co-authored-by: ocaisa <[email protected]>
Co-authored-by: ocaisa <[email protected]>
Co-authored-by: ocaisa <[email protected]>
Here's the one that works for me (but still misses help([[
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.
More information
================
- URL: https://www.eessi.io/docs/
]])
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/:")
local eessi_version = myModuleVersion()
local eessi_repo = "/cvmfs/software.eessi.io"
local eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version)
local eessi_os_type = "linux"
pushenv("EESSI_VERSION", eessi_version)
pushenv("EESSI_CVMFS_REPO", eessi_repo)
pushenv("EESSI_OS_TYPE", eessi_os_type)
function archdetect_cpu()
local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper.sh')
if not os.getenv("EESSI_ARCHDETECT_OPTIONS") then
if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then
LmodError("Loading this modulefile requires using Lmod version > 8.6, but you can export EESSI_ARCHDETECT_OPTIONS to the available cpu architecture in the form of: x86_64/intel/haswell or aarch64/neoverse_v1")
end
source_sh("bash", script)
end
for archdetect_filter_cpu in string.gmatch(os.getenv("EESSI_ARCHDETECT_OPTIONS"), "([^" .. ":" .. "]+)") do
if isDir(pathJoin(eessi_prefix, "software", eessi_os_type, archdetect_filter_cpu, "software")) then
return archdetect_filter_cpu
end
end
LmodError("Software directory check for the detected architecture failed")
end
local archdetect = archdetect_cpu()
local eessi_cpu_family = archdetect:match("([^/]+)")
local eessi_software_subdir = os.getenv("EESSI_SOFTWARE_SUBDIR_OVERRIDE") or archdetect
local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family)
local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir)
local eessi_module_path = pathJoin(eessi_software_path, "modules", "all")
local eessi_site_module_path = string.gsub(eessi_module_path, "versions", "host_injections")
pushenv("EESSI_SITE_MODULEPATH", eessi_site_module_path)
pushenv("EESSI_SOFTWARE_SUBDIR", eessi_software_subdir)
pushenv("EESSI_PREFIX", eessi_prefix)
pushenv("EESSI_EPREFIX", eessi_eprefix)
prepend_path("PATH", pathJoin(eessi_eprefix, "bin"))
prepend_path("PATH", pathJoin(eessi_eprefix, "usr/bin"))
pushenv("EESSI_SOFTWARE_PATH", eessi_software_path)
pushenv("EESSI_MODULEPATH", eessi_module_path)
prepend_path("MODULEPATH", eessi_module_path)
prepend_path("MODULEPATH", eessi_site_module_path)
pushenv("LMOD_CONFIG_DIR", pathJoin(eessi_software_path, ".lmod"))
pushenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod"))
-- update the prompt (unless overridden)
if not os.getenv("EESSI_RETAIN_PROMPT") then
pushenv("PS1", "{EESSI " .. eessi_version .. "} " .. (os.getenv("PS1") or ""))
end
-- check for RHEL certificate locatioin
local rhel_certificates = "/etc/pki/tls/certs/ca-bundle.crt"
if isFile(rhel_certificates) then
pushenv("CURL_CA_BUNDLE", rhel_certificates)
end
if mode() == "load" then
LmodMessage("EESSI/" .. eessi_version .. " loaded successfully")
end |
Setting the PS1 only would create difficulties for prompts, which don't use the PS1 Variable (Starship, OhMyPosh, etc).
But the |
Added zen4 redirection
Handled in the commit above |
We can only set
|
That's the Thing I don't get. In my test scenario, I believe the problem is that the EDIT: The issue is that directly exporting doesn't work, if I put |
Co-authored-by: ocaisa <[email protected]>
Co-authored-by: ocaisa <[email protected]>
We indeed set Tested it on my laptop:
|
I'm not sure we should be setting |
True. I'm not sure if it can contain multiple paths (then we could prepend to it), but that's definitely possible with LMOD_RC. |
If prepending is an Option, is this part of the module or do we need this in the init scripts? |
|
The difference now is that we are allowing the case where people are using their own Lmod, we should only make the minimal changes to the environment we need to gets things working as we expect. That means using our spider caches and setting up our hooks. I think @casparvl has a good overview of this somewhere in a PR (see #491 (comment)) |
To prevent error bad argument #1 to 'gmatch' when module show is used and EESSI_ARCHDETECT_OPTIONS is not set
Co-authored-by: ocaisa <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for all the effort!
We'll deploy this and iterate from there
bot: build repo:eessi.io-2023.06-software arch:x86_64/generic |
Updates by the bot instance
|
Updates by the bot instance
|
New job on instance
|
This has been ingested, so I'll merge the PR. |
This is a follow up PR to the issue: https://gitlab.com/eessi/support/-/issues/83
The CI tests are intended to evaluate the following: