From a9feb62558600c711ab03b711d6a30ab110da65a Mon Sep 17 00:00:00 2001 From: ocaisa Date: Tue, 17 Jun 2025 14:58:13 +0200 Subject: [PATCH 1/6] Allow using Lmod initialisation for EESSI --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5ad3c03..35078a5 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,10 @@ inputs: description: 'Comma-separated list of fully qualified repository names that shall be mountable under /cvmfs.' required: false default: 'software.eessi.io,dev.eessi.io' + use_eessi_module: + description: 'Use the EESSI module to initialise EESSI (rather than sourcing a bash script), any non-empty value is true' + required: false + default: '' runs: using: "composite" @@ -26,7 +30,11 @@ runs: run: | if [ "$RUNNER_OS" == "Linux" ]; then echo 'unset BASH_ENV' >> $HOME/env_config.export - echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export + if [[ -n "${{ inputs.use_eessi_module }}" ]]; then + 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 # allow oversubscription for OpenMPI echo "export OMPI_MCA_rmaps_base_oversubscribe=1" >> $HOME/env_config.export sudo apt install -y direnv @@ -51,3 +59,4 @@ runs: shell: bash env: EESSI_STACK_VERSION: ${{ inputs.eessi_stack_version }} + From 338dd90b23c8f6ab4c55b74ee934ede93645f3f3 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Tue, 17 Jun 2025 15:03:41 +0200 Subject: [PATCH 2/6] Create `minimal_usage_lmod_init.yml` --- .github/workflows/minimal_usage_lmod_init.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/minimal_usage_lmod_init.yml diff --git a/.github/workflows/minimal_usage_lmod_init.yml b/.github/workflows/minimal_usage_lmod_init.yml new file mode 100644 index 0000000..84fa393 --- /dev/null +++ b/.github/workflows/minimal_usage_lmod_init.yml @@ -0,0 +1,38 @@ +name: ubuntu-minimal_usage +on: + schedule: + - cron: '0 0 * * *' # Runs once a day at midnight UTC + workflow_dispatch: # Allows manual triggering + push: + branches: + - main + pull_request: + branches: + - main +# Declare default permissions as read only. +permissions: read-all +jobs: + minimal_usage: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-24.04-arm + - ubuntu-24.04 + - ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: ./ + with: + use_eessi_module: true + - name: Test EESSI + run: | + direnv status + module avail + module list |& grep "EESSI/" + shell: bash + - name: Test available repos + run: | + ls /cvmfs/software.eessi.io + ls /cvmfs/dev.eessi.io + shell: bash From 3397210b38fc1b3d1dc76730f0f4dbf80d8825c3 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Tue, 17 Jun 2025 15:04:41 +0200 Subject: [PATCH 3/6] Update minimal_usage_lmod_init.yml --- .github/workflows/minimal_usage_lmod_init.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimal_usage_lmod_init.yml b/.github/workflows/minimal_usage_lmod_init.yml index 84fa393..8532ce2 100644 --- a/.github/workflows/minimal_usage_lmod_init.yml +++ b/.github/workflows/minimal_usage_lmod_init.yml @@ -1,4 +1,4 @@ -name: ubuntu-minimal_usage +name: ubuntu-minimal_usage-lmod_init on: schedule: - cron: '0 0 * * *' # Runs once a day at midnight UTC From 75e4e0362de0b295bcca8b5dbba0d20c8987bc9f Mon Sep 17 00:00:00 2001 From: ocaisa Date: Tue, 17 Jun 2025 15:07:15 +0200 Subject: [PATCH 4/6] Update minimal_usage_lmod_init.yml --- .github/workflows/minimal_usage_lmod_init.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/minimal_usage_lmod_init.yml b/.github/workflows/minimal_usage_lmod_init.yml index 8532ce2..49df70e 100644 --- a/.github/workflows/minimal_usage_lmod_init.yml +++ b/.github/workflows/minimal_usage_lmod_init.yml @@ -27,7 +27,6 @@ jobs: use_eessi_module: true - name: Test EESSI run: | - direnv status module avail module list |& grep "EESSI/" shell: bash From 35edf0907090ea7320bd6350f87512c2f3597def Mon Sep 17 00:00:00 2001 From: ocaisa Date: Tue, 17 Jun 2025 15:14:49 +0200 Subject: [PATCH 5/6] Update action.yml --- action.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index 35078a5..4135944 100644 --- a/action.yml +++ b/action.yml @@ -13,9 +13,13 @@ inputs: required: false default: 'software.eessi.io,dev.eessi.io' use_eessi_module: - description: 'Use the EESSI module to initialise EESSI (rather than sourcing a bash script), any non-empty value is true' + description: 'Use the EESSI module to initialise EESSI (rather than sourcing a bash script), valid values are true or false' required: false - default: '' + default: 'false' + init_direnv: + description: 'Enable direnv initialisation for the repository, valid values are true or false' + required: false + default: 'true' runs: using: "composite" @@ -30,21 +34,23 @@ runs: run: | if [ "$RUNNER_OS" == "Linux" ]; then echo 'unset BASH_ENV' >> $HOME/env_config.export - if [[ -n "${{ inputs.use_eessi_module }}" ]]; then + if [[ "${{ inputs.use_eessi_module }}" == "true" ]]; then 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 # allow oversubscription for OpenMPI echo "export OMPI_MCA_rmaps_base_oversubscribe=1" >> $HOME/env_config.export - sudo apt install -y direnv - echo 'eval "$(direnv export bash)"' >> $HOME/env_config.export - mkdir -p $HOME/direnv/ - echo "[whitelist]" >> $HOME/direnv/direnv.toml - echo "prefix = [ '$GITHUB_WORKSPACE' ]" >> $HOME/direnv/direnv.toml - cp $HOME/direnv/direnv.toml $HOME/direnv/config.toml + if [[ "${{ inputs.init_direnv }}" == "true" ]]; then + sudo apt install -y direnv + echo 'eval "$(direnv export bash)"' >> $HOME/env_config.export + mkdir -p $HOME/direnv/ + echo "[whitelist]" >> $HOME/direnv/direnv.toml + echo "prefix = [ '$GITHUB_WORKSPACE' ]" >> $HOME/direnv/direnv.toml + cp $HOME/direnv/direnv.toml $HOME/direnv/config.toml + echo "DIRENV_CONFIG=$HOME/direnv" >> $GITHUB_ENV + fi echo "BASH_ENV=$HOME/env_config.export" >> $GITHUB_ENV - echo "DIRENV_CONFIG=$HOME/direnv" >> $GITHUB_ENV elif [ "$RUNNER_OS" == "macOS" ]; then # EESSI on macOS requires lima so we get a Linux VM, see https://gitlab.com/eessi/support/-/issues/70 # (unfortunately this requires nested virtualisation in GitHub Actions which is not available with M1) From d22ac20bf3fac23f1db438ec8271c9954d969abf Mon Sep 17 00:00:00 2001 From: ocaisa Date: Tue, 17 Jun 2025 15:15:16 +0200 Subject: [PATCH 6/6] Update minimal_usage_lmod_init.yml --- .github/workflows/minimal_usage_lmod_init.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/minimal_usage_lmod_init.yml b/.github/workflows/minimal_usage_lmod_init.yml index 49df70e..62e45bf 100644 --- a/.github/workflows/minimal_usage_lmod_init.yml +++ b/.github/workflows/minimal_usage_lmod_init.yml @@ -25,6 +25,7 @@ jobs: - uses: ./ with: use_eessi_module: true + init_direnv: false - name: Test EESSI run: | module avail