Skip to content

Commit f2c418d

Browse files
authored
Merge pull request #36 from EESSI/ocaisa-patch-4
Switch to Lmod initialisation by default, and add capability to only mount the repositories
2 parents 482a647 + ff87db9 commit f2c418d

4 files changed

Lines changed: 57 additions & 13 deletions

File tree

.github/workflows/minimal-usage.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ jobs:
3030
shell: bash
3131
- name: Test available repos
3232
run: |
33+
# Make sure an EESSI module is loaded
34+
module list |& grep "EESSI/"
3335
ls /cvmfs/software.eessi.io
3436
ls /cvmfs/dev.eessi.io
3537
shell: bash
38+
39+
test_mount_only:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
43+
- uses: ./
44+
with:
45+
mount_cvmfs_only: 'true'
46+
init_direnv: 'false'
47+
- name: Test EESSI not initialised
48+
run: |
49+
if [[ -v EESSI_VERSION ]]; then
50+
echo "EESSI_VERSION should not be set as this indicates EESSI is initialised"
51+
exit 1
52+
fi
53+
# Make sure CVMFS is mounted, and EESSI available
54+
ls /cvmfs/software.eessi.io
55+
shell: bash

.github/workflows/minimal_usage_lmod_init.yml renamed to .github/workflows/minimal_usage_bash_init.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ubuntu-minimal_usage-lmod_init
1+
name: ubuntu-minimal_usage-bash_script_init
22
on:
33
schedule:
44
- cron: '0 0 * * *' # Runs once a day at midnight UTC
@@ -12,7 +12,7 @@ on:
1212
# Declare default permissions as read only.
1313
permissions: read-all
1414
jobs:
15-
minimal_usage:
15+
minimal_usage_bash_script:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
@@ -24,12 +24,17 @@ jobs:
2424
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525
- uses: ./
2626
with:
27-
use_eessi_module: true
27+
use_eessi_module: false
2828
init_direnv: false
2929
- name: Test EESSI
3030
run: |
3131
module avail
32-
module list |& grep "EESSI/"
32+
if ! module list |& grep -q "EESSI/"; then
33+
echo "EESSI module is NOT loaded"
34+
else
35+
echo "EESSI module is loaded but shouldn't be"
36+
exit 1
37+
fi
3338
shell: bash
3439
- name: Test available repos
3540
run: |

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@v6
4343
- uses: eessi/github-action-eessi@v3
44+
with:
45+
eessi_stack_version: '2025.06'
4446
- name: Test EESSI
4547
run: |
4648
module avail
@@ -65,7 +67,10 @@ jobs:
6567
## Optional Parameters
6668
The following parameters are supported:
6769
- `eessi_stack_version`: version of the EESSI stack to use (defaults to `2023.06`)
68-
- `eessi_config_package`: location of the EESSI CernVM-FS configuration package (defaults to `https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb`).
70+
- `eessi_repositories`: Comma separated list of EESSI repositories to make available (defaults to `software.eessi.io,dev.eessi.io`).
71+
- `use_eessi_module`: Use the Lmod method to initialise EESSI (defaults to `true`)
72+
- `mount_cvmfs_only`: Only mount the EESSI CernVM-FS repositories, do not initialise EESSI (defaults to `false`)
73+
- `init_direnv`: Initialise direnv for the repository (defaults to `true`)
6974
<!--For macOS this parameter is required (e.g., `https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.pkg`) -->
7075

7176
## Minimal Example

action.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ inputs:
1515
use_eessi_module:
1616
description: 'Use the EESSI module to initialise EESSI (rather than sourcing a bash script), valid values are true or false'
1717
required: false
18+
default: 'true'
19+
mount_cvmfs_only:
20+
description: 'Only mount CVMFS, do not initialise EESSI'
21+
required: false
1822
default: 'false'
1923
init_direnv:
2024
description: 'Enable direnv initialisation for the repository, valid values are true or false'
@@ -31,13 +35,27 @@ runs:
3135
cvmfs_http_proxy: DIRECT
3236
cvmfs_repositories: 'cvmfs-config.cern.ch,${{ inputs.eessi_repositories }}'
3337
- id: install-eessi
38+
shell: bash
39+
env:
40+
EESSI_STACK_VERSION: ${{ inputs.eessi_stack_version }}
41+
ALLOWED_VERSIONS: "2023.06 2025.06"
3442
run: |
3543
if [ "$RUNNER_OS" == "Linux" ]; then
3644
echo 'unset BASH_ENV' >> $HOME/env_config.export
37-
if [[ "${{ inputs.use_eessi_module }}" == "true" ]]; then
38-
echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/lmod/bash" >> $HOME/env_config.export
39-
else
40-
echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export
45+
if [[ "${{ inputs.mount_cvmfs_only }}" == "false" ]]; then
46+
[[ " $ALLOWED_VERSIONS " =~ " $EESSI_STACK_VERSION " ]] || {
47+
echo "Invalid eessi_stack_version: '$EESSI_STACK_VERSION'"
48+
echo "Allowed values: $ALLOWED_VERSIONS"
49+
exit 1
50+
}
51+
if [[ "${{ inputs.use_eessi_module }}" == "true" ]]; then
52+
# Make the EESSI module sticky so that it persists in case `module purge` is used
53+
# (while still allowing for a swap if needed)
54+
echo "export EESSI_MODULE_STICKY=1" >> $HOME/env_config.export
55+
echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/lmod/bash" >> $HOME/env_config.export
56+
else
57+
echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export
58+
fi
4159
fi
4260
# allow oversubscription for OpenMPI
4361
echo "export OMPI_MCA_rmaps_base_oversubscribe=1" >> $HOME/env_config.export
@@ -62,7 +80,3 @@ runs:
6280
# limactl start eessi || true
6381
# cat /Users/runner/.lima/eessi/ha.stderr.log
6482
fi
65-
shell: bash
66-
env:
67-
EESSI_STACK_VERSION: ${{ inputs.eessi_stack_version }}
68-

0 commit comments

Comments
 (0)