-
Notifications
You must be signed in to change notification settings - Fork 17
Support dash init shell with Lmod approach, make sure second initialsation gives expected EESSI version #182
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
Open
ocaisa
wants to merge
7
commits into
EESSI:main
Choose a base branch
from
ocaisa:lmod_init_tweaks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fd82b02
Support dash init shell with Lmod approach, make sure second initiali…
ocaisa 3791d0a
Also install `sh`
ocaisa af052b0
Add sh to CI properly
ocaisa e2d786d
Use . instead of source
ocaisa 5d897f0
Missed one
ocaisa 87a850e
Fix test case for csh
ocaisa e71d2c8
Apply suggestions from code review
ocaisa 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
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
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/usr/bin/env bash | ||
| #!/usr/bin/env sh | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script is meant to be sourced, so the shebang here is meaningless |
||
|
|
||
| # SPDX-License-Identifier: GPL-2.0-only | ||
| # Copyright (C) 2020-2026 EESSI contributors | ||
|
|
@@ -49,7 +49,12 @@ EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" | |
| # (Note: in the repository which is home to this file a template value __EESSI_VERSION_DEFAULT__ is present in | ||
| # the line below which is replaced within our deployment pipeline.) | ||
| EESSI_VERSION_DEFAULT="${__EESSI_VERSION_USED_FOR_INIT:-__EESSI_VERSION_DEFAULT__}" | ||
| EESSI_VERSION="${EESSI_VERSION:-${EESSI_VERSION_DEFAULT}}" | ||
| if [ -z "$__Init_EESSI_Default_Modules" ]; then | ||
| EESSI_VERSION="${EESSI_VERSION:-${EESSI_VERSION_DEFAULT}}" | ||
| else | ||
| # If we have already initialised and this is being called again, then we must want the specific version | ||
| EESSI_VERSION="__EESSI_VERSION_DEFAULT__" | ||
| fi | ||
| # On the first run we want to record the EESSI version used for init as an environment variable so that if a different | ||
| # version of this script is called (e.g, for a a different EESSI version) it retains a memory which EESSI | ||
| # version was actually used in the initialisation. This is useful as __Init_EESSI_Default_Modules used below will | ||
|
|
@@ -75,7 +80,7 @@ if [ -z "$__Init_EESSI_Default_Modules" ]; then | |
|
|
||
| # Lmod version in 2023.06 has a problem with newer Lmod caches, so let's stick to more recent Lmod | ||
| # (has no effect except on Lmod itself, and compatible caches are still created/supported by EESSI) | ||
| LMOD_EESSI_VERSION=${EESSI_VERSION/2023.06/2025.06} | ||
| LMOD_EESSI_VERSION=$(printf '%s\n' "$EESSI_VERSION" | sed 's/2023\.06/2025\.06/') | ||
|
|
||
| # Let's attempt a purge of any loaded modules as any environment variables currently set will survive EESSI initialisation | ||
| # (it's ok if the module command does not exist) | ||
|
|
@@ -96,10 +101,21 @@ if [ -z "$__Init_EESSI_Default_Modules" ]; then | |
| export EESSI_MODULE_UPDATE_PS1=1 | ||
| fi | ||
|
|
||
| # Figure out what shell we have | ||
| if [ -n "${BASH_VERSION-}" ]; then | ||
| shell=bash | ||
| elif [ -n "${ZSH_VERSION-}" ]; then | ||
| shell=zsh | ||
| elif [ -n "${KSH_VERSION-}" ]; then | ||
| shell=ksh | ||
| else | ||
| shell=sh | ||
| fi | ||
|
|
||
| # Path to top-level module tree | ||
| # - EESSI_EXTRA_MODULEPATH environment variable allows a site to append to MODULEPATH (lower priority than EESSI MODULEPATH) | ||
| export MODULEPATH="${EESSI_CVMFS_REPO}/init/modules${EESSI_EXTRA_MODULEPATH:+:$EESSI_EXTRA_MODULEPATH}" | ||
| . "${EESSI_CVMFS_REPO}/versions/${LMOD_EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash" | ||
| . "${EESSI_CVMFS_REPO}/versions/${LMOD_EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/${shell}" | ||
| module --initial_load --no_redirect restore | ||
|
|
||
| # After initialising, we now know the architecture(s) that was/were selected so let's report them | ||
|
|
||
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
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
This file was deleted.
Oops, something went wrong.
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 @@ | ||
| bash |
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 @@ | ||
| bash |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
@boegel All shells are covered via this script