From cbc4b03de115d190c09d2e3db9930e379a723ad6 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 6 May 2026 16:18:42 +0200 Subject: [PATCH 1/9] Switch to Lmod initialisation by default To be consistent with https://gitlab.com/eessi/gitlab-eessi (and allow more flexiblity) --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index a015f66..7bac570 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: use_eessi_module: description: 'Use the EESSI module to initialise EESSI (rather than sourcing a bash script), valid values are true or false' required: false - default: 'false' + default: 'true' init_direnv: description: 'Enable direnv initialisation for the repository, valid values are true or false' required: false From 263773880c0ee585330cd0790f9db91617b05f96 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 6 May 2026 16:21:30 +0200 Subject: [PATCH 2/9] Update action.yml --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 7bac570..44f1a44 100644 --- a/action.yml +++ b/action.yml @@ -35,6 +35,9 @@ runs: if [ "$RUNNER_OS" == "Linux" ]; then echo 'unset BASH_ENV' >> $HOME/env_config.export if [[ "${{ inputs.use_eessi_module }}" == "true" ]]; then + # Make the EESSI module sticky so that it persists in case `module purge` is used + # (while still allowing for a swap if needed) + echo "export EESSI_MODULE_STICKY=1" >> $HOME/env_config.export echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/lmod/bash" >> $HOME/env_config.export else echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export From 0d6e5f658ca1beee4b4fd7995baf4cab5590267c Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 6 May 2026 16:40:18 +0200 Subject: [PATCH 3/9] Add capability to only mount EESSI --- .github/workflows/minimal-usage.yml | 15 +++++++++++++++ action.yml | 20 +++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/minimal-usage.yml b/.github/workflows/minimal-usage.yml index 16a0788..4c3e644 100644 --- a/.github/workflows/minimal-usage.yml +++ b/.github/workflows/minimal-usage.yml @@ -33,3 +33,18 @@ jobs: ls /cvmfs/software.eessi.io ls /cvmfs/dev.eessi.io shell: bash + + test_mount_only: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: ./ + - name: Test EESSI not initialised + run: | + if [[ -v EESSI_VERSION ]]; then + echo "EESSI_VERSION should not be set as this indicates EESSI is initialised" + exit 1 + fi + # Make sure CVMFS is mounted, and EESSI available + ls /cvmfs/software.eessi.io + shell: bash diff --git a/action.yml b/action.yml index 44f1a44..d0ba311 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,10 @@ inputs: description: 'Use the EESSI module to initialise EESSI (rather than sourcing a bash script), valid values are true or false' required: false default: 'true' + mount_cvmfs_only: + description: 'Only mount CVMFS, do not initialise EESSI' + required: false + default: 'false' init_direnv: description: 'Enable direnv initialisation for the repository, valid values are true or false' required: false @@ -34,13 +38,15 @@ runs: run: | if [ "$RUNNER_OS" == "Linux" ]; then echo 'unset BASH_ENV' >> $HOME/env_config.export - if [[ "${{ inputs.use_eessi_module }}" == "true" ]]; then - # Make the EESSI module sticky so that it persists in case `module purge` is used - # (while still allowing for a swap if needed) - echo "export EESSI_MODULE_STICKY=1" >> $HOME/env_config.export - echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/lmod/bash" >> $HOME/env_config.export - else - echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export + if [[ "${{ inputs.mount_cvmfs_only }}" == "false" ]]; then + if [[ "${{ inputs.use_eessi_module }}" == "true" ]]; then + # Make the EESSI module sticky so that it persists in case `module purge` is used + # (while still allowing for a swap if needed) + echo "export EESSI_MODULE_STICKY=1" >> $HOME/env_config.export + echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/lmod/bash" >> $HOME/env_config.export + else + echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export + fi fi # allow oversubscription for OpenMPI echo "export OMPI_MCA_rmaps_base_oversubscribe=1" >> $HOME/env_config.export From f4307ac9969d763724dc4cc10b00df5efbc9f3ff Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 6 May 2026 16:44:59 +0200 Subject: [PATCH 4/9] Use the correct option for mount only --- .github/workflows/minimal-usage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/minimal-usage.yml b/.github/workflows/minimal-usage.yml index 4c3e644..1756738 100644 --- a/.github/workflows/minimal-usage.yml +++ b/.github/workflows/minimal-usage.yml @@ -39,6 +39,9 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./ + with: + mount_cvmfs_only: 'true' + init_direnv: 'false' - name: Test EESSI not initialised run: | if [[ -v EESSI_VERSION ]]; then From 4a68365279cdd246cabf6ee1b30d9ecea2a2bfb5 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 6 May 2026 17:06:50 +0200 Subject: [PATCH 5/9] Add options to README.md --- README.md | 7 ++++++- action.yml | 12 +++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7401333..68a9a8f 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ jobs: steps: - uses: actions/checkout@v6 - uses: eessi/github-action-eessi@v3 + with: + eessi_stack_version: '2025.06' - name: Test EESSI run: | module avail @@ -65,7 +67,10 @@ jobs: ## Optional Parameters The following parameters are supported: - `eessi_stack_version`: version of the EESSI stack to use (defaults to `2023.06`) -- `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`). +- `eessi_repositories`: Comma separated list of EESSI repositories to make available (defaults to `software.eessi.io,dev.eessi.io`). +- `use_eessi_module`: Use the Lmod method to initialise EESSI (defaults to `true`) +- `mount_cvmfs_only`: Only mount the EESSI CernVM-FS repositories, do not initialise EESSI (defaults to `false`) +- `init_direnv`: Initialise direnv for the repository (defaults to `true`) ## Minimal Example diff --git a/action.yml b/action.yml index d0ba311..4fcc64f 100644 --- a/action.yml +++ b/action.yml @@ -35,10 +35,19 @@ runs: cvmfs_http_proxy: DIRECT cvmfs_repositories: 'cvmfs-config.cern.ch,${{ inputs.eessi_repositories }}' - id: install-eessi + shell: bash + env: + EESSI_STACK_VERSION: ${{ inputs.eessi_stack_version }} + ALLOWED_VERSIONS: "2023.06 2025.06" run: | if [ "$RUNNER_OS" == "Linux" ]; then echo 'unset BASH_ENV' >> $HOME/env_config.export if [[ "${{ inputs.mount_cvmfs_only }}" == "false" ]]; then + [[ " $ALLOWED_VERSIONS " =~ " $EESSI_STACK_VERSION " ]] || { + echo "Invalid eessi_stack_version: '$EESSI_STACK_VERSION'" + echo "Allowed values: $ALLOWED_VERSIONS" + exit 1 + } if [[ "${{ inputs.use_eessi_module }}" == "true" ]]; then # Make the EESSI module sticky so that it persists in case `module purge` is used # (while still allowing for a swap if needed) @@ -72,6 +81,3 @@ runs: # cat /Users/runner/.lima/eessi/ha.stderr.log fi shell: bash - env: - EESSI_STACK_VERSION: ${{ inputs.eessi_stack_version }} - From 3584c8f672967b2d07e6980386a66459a23e89f3 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 6 May 2026 17:09:51 +0200 Subject: [PATCH 6/9] Forgot to cut a line --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index 4fcc64f..8507083 100644 --- a/action.yml +++ b/action.yml @@ -80,4 +80,3 @@ runs: # limactl start eessi || true # cat /Users/runner/.lima/eessi/ha.stderr.log fi - shell: bash From 2080d20061a99b4e56482fbf3c7e8fb420c6deb6 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 6 May 2026 17:13:27 +0200 Subject: [PATCH 7/9] Test bash script initialisation explictly --- ...inimal_usage_lmod_init.yml => minimal_usage_bash_init.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{minimal_usage_lmod_init.yml => minimal_usage_bash_init.yml} (91%) diff --git a/.github/workflows/minimal_usage_lmod_init.yml b/.github/workflows/minimal_usage_bash_init.yml similarity index 91% rename from .github/workflows/minimal_usage_lmod_init.yml rename to .github/workflows/minimal_usage_bash_init.yml index 7adb970..ca07ad2 100644 --- a/.github/workflows/minimal_usage_lmod_init.yml +++ b/.github/workflows/minimal_usage_bash_init.yml @@ -1,4 +1,4 @@ -name: ubuntu-minimal_usage-lmod_init +name: ubuntu-minimal_usage-bash_script_init on: schedule: - cron: '0 0 * * *' # Runs once a day at midnight UTC @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./ with: - use_eessi_module: true + use_eessi_module: false init_direnv: false - name: Test EESSI run: | From 7e16928518da45fa759ef9b9a2c37f8f84a88e24 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 6 May 2026 17:17:24 +0200 Subject: [PATCH 8/9] Add checks for EESSI modules --- .github/workflows/minimal-usage.yml | 2 ++ .github/workflows/minimal_usage_bash_init.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/minimal-usage.yml b/.github/workflows/minimal-usage.yml index 1756738..694db84 100644 --- a/.github/workflows/minimal-usage.yml +++ b/.github/workflows/minimal-usage.yml @@ -30,6 +30,8 @@ jobs: shell: bash - name: Test available repos run: | + # Make sure an EESSI module is loaded + module list |& grep "EESSI/" ls /cvmfs/software.eessi.io ls /cvmfs/dev.eessi.io shell: bash diff --git a/.github/workflows/minimal_usage_bash_init.yml b/.github/workflows/minimal_usage_bash_init.yml index ca07ad2..8c756c0 100644 --- a/.github/workflows/minimal_usage_bash_init.yml +++ b/.github/workflows/minimal_usage_bash_init.yml @@ -29,7 +29,7 @@ jobs: - name: Test EESSI run: | module avail - module list |& grep "EESSI/" + module list |& grep -q "EESSI/" shell: bash - name: Test available repos run: | From ff87db93fdb55a00fc35a95bb0e9d0fa0addda48 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 6 May 2026 17:26:43 +0200 Subject: [PATCH 9/9] Fix the check --- .github/workflows/minimal_usage_bash_init.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/minimal_usage_bash_init.yml b/.github/workflows/minimal_usage_bash_init.yml index 8c756c0..bc925a7 100644 --- a/.github/workflows/minimal_usage_bash_init.yml +++ b/.github/workflows/minimal_usage_bash_init.yml @@ -12,7 +12,7 @@ on: # Declare default permissions as read only. permissions: read-all jobs: - minimal_usage: + minimal_usage_bash_script: runs-on: ${{ matrix.os }} strategy: matrix: @@ -29,7 +29,12 @@ jobs: - name: Test EESSI run: | module avail - module list |& grep -q "EESSI/" + if ! module list |& grep -q "EESSI/"; then + echo "EESSI module is NOT loaded" + else + echo "EESSI module is loaded but shouldn't be" + exit 1 + fi shell: bash - name: Test available repos run: |