-
Notifications
You must be signed in to change notification settings - Fork 74
Add new init scripts for new initialization module #668
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
Merged
ocaisa
merged 33 commits into
EESSI:2023.06-software.eessi.io
from
MaKaNu:2023.06-software.eessi.io
Sep 12, 2024
Merged
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
d512675
Add init scripts
MaKaNu 7f71c28
Fix fish init script
MaKaNu 1e2f154
Add init script
MaKaNu a0c4377
convert bash init script
MaKaNu 68aea9f
Add init script
MaKaNu 788375d
Export ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ for all init scr…
MaKaNu b14cef8
Implement module load following doc
MaKaNu 1aa8cb8
Add init scripts test
MaKaNu 0b6bc54
Cleanup script and FIX init module path
MaKaNu 4aa7d00
Use haswell for testing
MaKaNu 71543e3
Fix Pipeline
MaKaNu ea32ffe
Add StdEnv.lua module
MaKaNu bb3c8bd
Install Shells on github actions
MaKaNu 385aee0
Fix requirements install on github action
MaKaNu 461c941
Fix Fish command call issue
MaKaNu aee306c
Merge pull request #1 from EESSI/2023.06-software.eessi.io
MaKaNu 6d7fde5
Merge branch 'EESSI:2023.06-software.eessi.io' into 2023.06-software.…
MaKaNu fcf4937
move init scripts into init/lmod
MaKaNu 032cdae
Revert a0c4377e
MaKaNu 33b6b92
Use EESSI as LMOD SYSTEM DEFAULT
MaKaNu d4bc3bc
Revert "Add StdEnv.lua module"
MaKaNu 63482f5
Remove PS1 export
MaKaNu 7f95d5e
Update init scripts path in test script
MaKaNu a2ce628
Remove Prompt test from unittest
MaKaNu 2ab75c3
Rename Test Numbers
MaKaNu 7c798d4
Remove PROMPT variable from action
MaKaNu 8d74aea
Set correct arch override
MaKaNu 596f605
Fix arch differences
MaKaNu 462f180
Add Exception for CSH
MaKaNu 68ad3af
Add Check for not testable shells
MaKaNu bccd55a
Add csh to test
MaKaNu 7ad306a
Update init/lmod/csh
MaKaNu 1b38cec
Update install_scripts.sh
MaKaNu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/bin/bash | ||
| EESSI_VERSION="2023.06" | ||
| export LMOD_PAGER=cat | ||
|
|
||
| # initialize assert framework | ||
| if [ ! -d assert.sh ]; then | ||
| echo "assert.sh not cloned." | ||
| echo "" | ||
| echo "run \`git clone https://github.com/lehmannro/assert.sh.git\`" | ||
| exit 1 | ||
| fi | ||
| . assert.sh/assert.sh | ||
|
|
||
| SHELLS=$@ | ||
|
|
||
| for shell in ${SHELLS[@]}; do | ||
| echo = | awk 'NF += (OFS = $_) + 100' | ||
| echo RUNNING TESTS FOR SHELL: $shell | ||
| echo = | awk 'NF += (OFS = $_) + 100' | ||
|
|
||
| # TEST 1: Source Script and check Module Output | ||
| assert "$shell -c 'source init/lmod/$shell' 2>&1 " "EESSI/$EESSI_VERSION loaded successfully" | ||
| # TEST 2: Check if module overviews first section is the loaded EESSI module | ||
| MODULE_SECTIONS=($($shell -c "source init/lmod/$shell 2>/dev/null; module ov 2>&1 | grep -e '---'")) | ||
| PATTERN="/cvmfs/software\.eessi\.io/versions/$EESSI_VERSION/software/linux/x86_64/(intel/haswell|amd/zen3)/modules/all" | ||
| assert_raises 'echo "${MODULE_SECTIONS[1]}" | grep -E "$PATTERN"' | ||
| # TEST 3: Check if module overviews second section is the EESSI init module | ||
| assert "echo ${MODULE_SECTIONS[4]}" "/cvmfs/software.eessi.io/versions/$EESSI_VERSION/init/modules" | ||
| # Test 4: Load Python module and check version | ||
| command="$shell -c 'source init/lmod/$shell 2>/dev/null; module load Python/3.10.8-GCCcore-12.2.0; python --version'" | ||
| expected="Python 3.10.8" | ||
| assert "$command" "$expected" | ||
| # Test 5: Load Python module and check path | ||
| PYTHON_PATH=$($shell -c "source init/lmod/$shell 2>/dev/null; module load Python/3.10.8-GCCcore-12.2.0; which python") | ||
| PATTERN="/cvmfs/software\.eessi\.io/versions/$EESSI_VERSION/software/linux/x86_64/(intel/haswell|amd/zen3)/software/Python/3\.10\.8-GCCcore-12\.2\.0/bin/python" | ||
| echo "$PYTHON_PATH" | grep -E "$PATTERN" | ||
| assert_raises 'echo "$PYTHON_PATH" | grep -E "$PATTERN"' | ||
|
|
||
| #End Test Suite | ||
| assert_end "source_eessi_$shell" | ||
| done | ||
|
|
||
| ### EXCEPTION FOR CSH ### | ||
| echo -e "\033[33mWe don't now how to test csh correctly, PRs are Welcome.\033[0m" | ||
|
|
||
|
|
||
| # RESET PAGER | ||
| export LMOD_PAGER= | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions | ||
| name: Check for EESSI init shell scripts to load eessi software module in software.eessi.io | ||
| on: | ||
| push: | ||
| branches: [ "*-software.eessi.io" ] | ||
| pull_request: | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: read # to fetch code (actions/checkout) | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| EESSI_VERSION: | ||
| - 2023.06 | ||
| EESSI_SOFTWARE_SUBDIR_OVERRIDE: | ||
| - x86_64/intel/haswell | ||
| steps: | ||
| - name: Check out software-layer repository | ||
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
|
||
| - name: Mount EESSI CernVM-FS pilot repository | ||
| uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0 | ||
| with: | ||
| cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb | ||
| cvmfs_http_proxy: DIRECT | ||
| cvmfs_repositories: software.eessi.io | ||
|
|
||
| - name: Clone assert.sh script | ||
| run: git clone https://github.com/lehmannro/assert.sh.git | ||
|
|
||
| - name: Install missing shells | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install zsh ksh fish | ||
| echo "# INIT ZSH" > ~/.zshrc | ||
|
|
||
| - name: Run tests for available shells | ||
| run: | | ||
| .github/workflows/scripts/test_init_scripts.sh "bash" "zsh" "ksh" "fish" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Choose an EESSI version | ||
| EESSI_VERSION="${EESSI_VERSION:-2023.06}" | ||
| # 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 | ||
|
|
||
| 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:-"EESSI/$EESSI_VERSION"} | ||
| export LMOD_SYSTEM_DEFAULT_MODULES | ||
| module --initial_load --no_redirect restore | ||
| else | ||
| module refresh | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Choose an EESSI version | ||
| if (! $?EESSI_VERSION) then; set EESSI_VERSION = "2023.06"; 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 | ||
|
|
||
| if (! $?__Init_Default_Modules ) then | ||
| setenv __Init_Default_Modules 1; | ||
|
|
||
| ## ability to predefine elsewhere the default list | ||
| if (! $?LMOD_SYSTEM_DEFAULT_MODULES) then; setenv LMOD_SYSTEM_DEFAULT_MODULES "EESSI/$EESSI_VERSION"; endif | ||
| module --initial_load --no_redirect restore | ||
| else | ||
| module refresh | ||
| endif | ||
| #module load "$LMOD_SYSTEM_DEFAULT_MODULES" | ||
MaKaNu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Choose an EESSI version | ||
| set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06") | ||
| # 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 | ||
|
|
||
| if test -z "$__Init_Default_Modules" | ||
| export __Init_Default_Modules=1; | ||
|
|
||
| ## ability to predefine elsewhere the default list | ||
| set -x LMOD_SYSTEM_DEFAULT_MODULES (set -q LMOD_SYSTEM_DEFAULT_MODULE; and echo "$LMOD_SYSTEM_DEFAULT_MODULE"; or echo "EESSI/$EESSI_VERSION") | ||
| module --initial_load --no_redirect restore | ||
| else | ||
| module refresh | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Choose an EESSI version | ||
| EESSI_VERSION="${EESSI_VERSION:-2023.06}" | ||
| # 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 | ||
|
|
||
| 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:-"EESSI/$EESSI_VERSION"} | ||
| export LMOD_SYSTEM_DEFAULT_MODULES | ||
| module --initial_load --no_redirect restore | ||
| else | ||
| module refresh | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Choose an EESSI version | ||
| EESSI_VERSION="${EESSI_VERSION:-2023.06}" | ||
| # 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 | ||
|
|
||
| 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:-"EESSI/$EESSI_VERSION"} | ||
| export LMOD_SYSTEM_DEFAULT_MODULES | ||
| module --initial_load --no_redirect restore | ||
| else | ||
| module refresh | ||
| fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.