Skip to content
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

Add new init scripts for new initialization module #668

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d512675
Add init scripts
MaKaNu Aug 12, 2024
7f71c28
Fix fish init script
MaKaNu Aug 12, 2024
1e2f154
Add init script
MaKaNu Aug 12, 2024
a0c4377
convert bash init script
MaKaNu Aug 12, 2024
68aea9f
Add init script
MaKaNu Aug 12, 2024
788375d
Export ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ for all init scr…
MaKaNu Aug 12, 2024
b14cef8
Implement module load following doc
MaKaNu Aug 13, 2024
1aa8cb8
Add init scripts test
MaKaNu Aug 16, 2024
0b6bc54
Cleanup script and FIX init module path
MaKaNu Aug 16, 2024
4aa7d00
Use haswell for testing
MaKaNu Aug 16, 2024
71543e3
Fix Pipeline
MaKaNu Aug 16, 2024
ea32ffe
Add StdEnv.lua module
MaKaNu Aug 16, 2024
bb3c8bd
Install Shells on github actions
MaKaNu Aug 16, 2024
385aee0
Fix requirements install on github action
MaKaNu Aug 16, 2024
461c941
Fix Fish command call issue
MaKaNu Aug 19, 2024
aee306c
Merge pull request #1 from EESSI/2023.06-software.eessi.io
MaKaNu Aug 21, 2024
6d7fde5
Merge branch 'EESSI:2023.06-software.eessi.io' into 2023.06-software.…
MaKaNu Sep 5, 2024
fcf4937
move init scripts into init/lmod
MaKaNu Sep 6, 2024
032cdae
Revert a0c4377e
MaKaNu Sep 6, 2024
33b6b92
Use EESSI as LMOD SYSTEM DEFAULT
MaKaNu Sep 6, 2024
d4bc3bc
Revert "Add StdEnv.lua module"
MaKaNu Sep 6, 2024
63482f5
Remove PS1 export
MaKaNu Sep 6, 2024
7f95d5e
Update init scripts path in test script
MaKaNu Sep 6, 2024
a2ce628
Remove Prompt test from unittest
MaKaNu Sep 6, 2024
2ab75c3
Rename Test Numbers
MaKaNu Sep 6, 2024
7c798d4
Remove PROMPT variable from action
MaKaNu Sep 6, 2024
8d74aea
Set correct arch override
MaKaNu Sep 6, 2024
596f605
Fix arch differences
MaKaNu Sep 11, 2024
462f180
Add Exception for CSH
MaKaNu Sep 12, 2024
68ad3af
Add Check for not testable shells
MaKaNu Sep 12, 2024
bccd55a
Add csh to test
MaKaNu Sep 12, 2024
7ad306a
Update init/lmod/csh
MaKaNu Sep 12, 2024
1b38cec
Update install_scripts.sh
MaKaNu Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 9 additions & 41 deletions init/bash
Original file line number Diff line number Diff line change
@@ -1,41 +1,9 @@
function show_msg {
# only echo msg if EESSI_SILENT is unset
msg=$1
if [[ -z ${EESSI_SILENT+x} ]]; then
echo "$msg"
fi
}

# The following method should be safe, but might break if file is a symlink
# (could switch to $(dirname "$(readlink -f "$BASH_SOURCE")") in that case)
source $(dirname "$BASH_SOURCE")/eessi_environment_variables

# only continue if setting EESSI environment variables worked fine
if [ $? -eq 0 ]; then

export PS1="{EESSI $EESSI_VERSION} $PS1"

# add location of commands provided by compat layer to $PATH;
# see https://github.com/EESSI/software-layer/issues/52
export PATH=$EPREFIX/usr/bin:$EPREFIX/bin:$PATH

# init Lmod
show_msg "Initializing Lmod..."
source $EESSI_EPREFIX/usr/share/Lmod/init/bash

# prepend location of modules for EESSI software stack to $MODULEPATH
show_msg "Prepending $EESSI_MODULEPATH to \$MODULEPATH..."
module use $EESSI_MODULEPATH
show_msg "Prepending site path $EESSI_SITE_MODULEPATH to \$MODULEPATH..."
module use $EESSI_SITE_MODULEPATH

#show_msg ""
#show_msg "*** Known problems in the ${EESSI_VERSION} software stack ***"
#show_msg ""
#show_msg "1) ..."
#show_msg ""
#show_msg ""

echo "Environment set up to use EESSI (${EESSI_VERSION}), have fun!"

fi
# Choose an EESSI version
ocaisa marked this conversation as resolved.
Show resolved Hide resolved
EESSI_VERSION="${EESSI_VERSION:-2023.06}"
# Automatically load the module for EESSI version
export LMOD_SYSTEM_DEFAULT_MODULES="${LMOD_SYSTEM_DEFAULT_MODULES:-EESSI/${EESSI_VERSION}}"
# Path to top-level module tree
export MODULEPATH=/cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules
. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/bash

module load "$LMOD_SYSTEM_DEFAULT_MODULES"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module load should not be necessary, they should be loaded when Lmod is initialised

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module load should not be necessary, they should be loaded when Lmod is initialised

In my test cases the EESSI/2023.06 module was not loaded automatically, that why I put it in.

Just setting StdEnv.lua doesn't do the trick also.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there already an Lmod loaded when you sourced it?

module load $LMOD_SYSTEM_DEFAULT_MODULES is a little brittle as this won't work if there is more than module in the variable (I think). It's probably best to take the official route as per the Lmod docs (shell dependent):

if [ -z "$__Init_Default_Modules" ]; then
   export __Init_Default_Modules=1;

   ## ability to predefine elsewhere the default list
   LMOD_SYSTEM_DEFAULT_MODULES=${LMOD_SYSTEM_DEFAULT_MODULES:-"StdEnv"}
   export LMOD_SYSTEM_DEFAULT_MODULES
   module --initial_load --no_redirect restore
else
   module refresh
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there already an Lmod loaded when you sourced it?

No, Lmod was not loaded at that moment. Only loaded with the script.

10 changes: 10 additions & 0 deletions init/csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Choose an EESSI version
if (! $?EESSI_VERSION) then; set EESSI_VERSION = "2023.06"; endif
# Automatically load the module for EESSI version
if (! $?LMOD_SYSTEM_DEFAULT_MODULES) then; setenv LMOD_SYSTEM_DEFAULT_MODULES "EESSI/$EESSI_VERSION"; endif
# Path to top-level module tree
setenv MODULEPATH /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules
source /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/`uname -m`/usr/share/Lmod/init/csh

module load "$LMOD_SYSTEM_DEFAULT_MODULES"

9 changes: 9 additions & 0 deletions init/fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Choose an EESSI version
set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06")
# Automatically load the module for EESSI version
set -x LMOD_SYSTEM_DEFAULT_MODULES (set -q LMOD_SYSTEM_DEFAULT_MODULE; and echo "$LMOD_SYSTEM_DEFAULT_MODULE"; or echo "EESSI/$EESSI_VERSION")
# Path to top-level module tree
set -x MODULEPATH /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules
. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/fish

module load $LMOD_SYSTEM_DEFAULT_MODULES
9 changes: 9 additions & 0 deletions init/ksh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Choose an EESSI version
EESSI_VERSION="${EESSI_VERSION:-2023.06}"
# Automatically load the module for EESSI version
export LMOD_SYSTEM_DEFAULT_MODULES="${LMOD_SYSTEM_DEFAULT_MODULES:-EESSI/${EESSI_VERSION}}"
# Path to top-level module tree
export MODULEPATH=/cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules
. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/ksh

module load "$LMOD_SYSTEM_DEFAULT_MODULES"
9 changes: 9 additions & 0 deletions init/zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Choose an EESSI version
EESSI_VERSION="${EESSI_VERSION:-2023.06}"
# Automatically load the module for EESSI version
export LMOD_SYSTEM_DEFAULT_MODULES="${LMOD_SYSTEM_DEFAULT_MODULES:-EESSI/${EESSI_VERSION}}"
# Path to top-level module tree
export MODULEPATH=/cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules
. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/zsh

module load "$LMOD_SYSTEM_DEFAULT_MODULES"