Skip to content

Commit

Permalink
Merge pull request #21 from ocaisa/software.eessi.io
Browse files Browse the repository at this point in the history
Update action for `software.eessi.io`
  • Loading branch information
bedroge authored Dec 1, 2023
2 parents 58b50fd + 2ba1b7b commit 38f6233
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module purge
export FOO=foo
module load GROMACS
module load TensorFlow
4 changes: 2 additions & 2 deletions .github/workflows/minimal-usage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ubuntu
name: ubuntu-minimal_usage
on:
push:
branches:
Expand All @@ -9,7 +9,7 @@ on:
# Declare default permissions as read only.
permissions: read-all
jobs:
build:
minimal_usage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
name: ubuntu_gromacs
name: ubuntu_tensorflow
on:
push:
branches:
- main
pull_request:
branches:
- main
# Declare default permissions as read only.
permissions: read-all
jobs:
build:
tensorflow_usage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- uses: eessi/github-action-eessi@main
with:
eessi_stack_version: '2021.06'
eessi_stack_version: '2023.06'
- name: Test EESSI
run: |
# GROMACS module is loaded via .envrc
gmx --version
# TensorFlow module is loaded via .envrc
python -c "import tensorflow; print(tensorflow.__version__)"
shell: bash
- name: Test caching effect EESSI
- name: Test caching effect of EESSI
run: |
gmx --version
python -c "import tensorflow; print(tensorflow.__version__)"
shell: bash
- name: Test module load
run: |
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ module load CMake/3.20.1-GCCcore-10.3.0 # Load a dependency of my project (CMak
Another example of a `.envrc` file can be found in the [.envrc](https://github.com/EESSI/github-action-eessi/blob/main/.envrc) included with this repository.

## Instructions
You can use this GitHub Action in a workflow in your own repository with `uses: eessi/github-action-eessi@v2`.
You can use this GitHub Action in a workflow in your own repository with `uses: eessi/github-action-eessi@v3`.

A minimal job example for GitHub-hosted runners of type `ubuntu-latest`:
```yaml
jobs:
ubuntu-minimal:
runs-on: ubuntu-latest
steps:
- uses: eessi/github-action-eessi@v2
- uses: eessi/github-action-eessi@v3
- name: Test EESSI
run: |
module avail
Expand All @@ -44,7 +44,7 @@ jobs:

## Optional Parameters
The following parameters are supported:
- `eessi_stack_version`: version of the EESSI stack to use (defaults to `latest`)
- `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`).
<!--For macOS this parameter is required (e.g., `https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.pkg`) -->

Expand All @@ -58,7 +58,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: eessi/github-action-eessi@v2
- uses: eessi/github-action-eessi@v3
- name: Test EESSI
run: |
module avail
Expand All @@ -70,20 +70,20 @@ jobs:
This GitHub Action installs the [EESSI](https://eessi.github.io/docs/) software stack, making it available to subsequent `bash` commands. This means one can create
workflows such as:
```yaml
name: GROMACS usage
name: TensorFlow usage
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: eessi/github-action-eessi@v2
- uses: eessi/github-action-eessi@v3
- name: Test EESSI
run: |
module load GROMACS
gmx --version
module load TensorFlow
python -c "import tensorflow; print(tensorflow.__version__)"
shell: bash
```
where the `gmx` command was only available to run after the loading the necessary environment module `GROMACS`. Note that I have not given the version of `GROMACS` which means the latest available version will be loaded.
where the `tensorflow` python module was only available to run after the loading the necessary environment module `TensorFlow`. Note that I have not given the version of `TensorFlow` which means the latest available version will be loaded.

## Limitations

Expand Down
33 changes: 5 additions & 28 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,22 @@ inputs:
eessi_stack_version:
description: 'Version of the EESSI stack to configure'
required: false
default: 'latest'
eessi_config_package:
description: 'URL to the EESSI cvmfs config package to install'
required: false
default: 'https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb'
cvmfs_client_profile:
description: 'Choose a suitable proxy automatically if set to single.'
required: false
default: 'single'
cvmfs_quota_limit:
description: 'Soft-limit of the cache in Megabyte. Consult https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources before changing'
required: false
default: '15000'
cvmfs_use_cdn:
description: 'Change the stratum 1 endpoints to caching servers from Cloudflare.'
required: false
default: 'yes'

default: '2023.06'

runs:
using: "composite"
steps:
- uses: cvmfs-contrib/github-action-cvmfs@d4641d0d591c9a5c3be23835ced2fb648b44c04b # v3.1
with:
cvmfs_config_package: ${{ inputs.eessi_config_package }}
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
cvmfs_http_proxy: DIRECT
cvmfs_client_profile: ${{ inputs.cvmfs_client_profile }}
cvmfs_quota_limit: ${{ inputs.cvmfs_quota_limit }}
cvmfs_use_cdn: ${{ inputs.cvmfs_use_cdn }}
cvmfs_repositories: software.eessi.io
- id: install-eessi
run: |
echo "EESSI_SILENT=1" >> $GITHUB_ENV
if [ "${{ inputs.eessi_stack_version }}" == "latest" ]; then
echo "source /cvmfs/pilot.eessi-hpc.org/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export
else
echo "source /cvmfs/pilot.eessi-hpc.org/versions/$EESSI_STACK_VERSION/init/bash" >> $HOME/env_config.export
fi
sudo apt install -y direnv
echo 'unset BASH_ENV' >> $HOME/env_config.export
echo "source /cvmfs/software.eessi.io/versions/$EESSI_STACK_VERSION/init/bash" >> $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
Expand Down

0 comments on commit 38f6233

Please sign in to comment.