Skip to content

Commit

Permalink
Update cd-hpc.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
corentincarton authored Jul 23, 2024
1 parent 9afef3d commit 48c5ee7
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/cd-hpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ on:
description: 'Module name'
required: true
type: string
module-tag:
description: 'Module tag'
required: false
default: 'NOT_DEFINED'
type: string
pyflow-version:
description: 'PyFlow version'
required: false
default: 'master'
type: string
tracksuite-version:
description: 'TrackSuite version'
required: false
default: 'main'
type: string
push:
tags:
Expand All @@ -26,28 +33,24 @@ jobs:
troika_user: ${{ secrets.HPC_CI_SSH_USER }}
template: |
set -eux
python3_versions=("3.10.10-01" "3.11.8-01")
MODULE_VERSION=${{ github.event_name == 'workflow_dispatch' && inputs.module-name || github.ref_name }}
WELLIES_VERSION=${{ github.ref_name }}
PYFLOW_VERSION=${{ github.event_name == 'workflow_dispatch' && inputs.pyflow-version || '3.2.1' }}
TRACKSUITE_VERSION=${{ github.event_name == 'workflow_dispatch' && inputs.tracksuite-version || '0.3.3' }}
MODULE_TAG=${{ github.event_name == 'workflow_dispatch' && inputs.module-tag || 'default'}}
WELLIES_BRANCH=${{ github.ref_name }}
PYFLOW_BRANCH=${{ github.event_name == 'workflow_dispatch' && inputs.pyflow-version || 'master' }}
TRACKSUITE_BRANCH=${{ github.event_name == 'workflow_dispatch' && inputs.tracksuite-version || 'main' }}
PREFIX=/usr/local/apps/wellies/$MODULE_VERSION
rm -rf $PREFIX
mkdir -p $PREFIX
for version in "${python3_versions[@]}"
do
module load python3/$version
module load python3
PYTHONUSERBASE=$PREFIX pip3 install --user git+https://github.com/ecmwf/pyflow.git@$PYFLOW_VERSION
PYTHONUSERBASE=$PREFIX pip3 install --user git+https://github.com/ecmwf/tracksuite.git@$TRACKSUITE_VERSION
PYTHONUSERBASE=$PREFIX pip3 install --user git+https://github.com/ecmwf/pyflow-wellies.git@$WELLIES_VERSION
module unload python3
done
PYTHONUSERBASE=$PREFIX pip3 install --user git+https://github.com/ecmwf/pyflow.git@$PYFLOW_BRANCH
PYTHONUSERBASE=$PREFIX pip3 install --user git+https://github.com/ecmwf/tracksuite.git@$TRACKSUITE_BRANCH
PYTHONUSERBASE=$PREFIX pip3 install --user git+https://github.com/ecmwf/pyflow-wellies.git@$WELLIES_BRANCH
module unload python3
cat > $PREFIX/README.txt << EOF
-- [wellies] ($WELLIES_VERSION) [$WELLIES_VERSION]
Expand All @@ -58,6 +61,10 @@ jobs:
software-sync -s local -p wellies
module load modulemgr
modulemgr -v -f -m all sync wellies
if [ $MODULE_TAG != 'NOT_DEFINED' ]
then
modulemgr -f -o -m all tag wellies $MODULE_VERSION $MODULE_TAG
fi
sbatch_options: |
#SBATCH --job-name=build_wellies_module
#SBATCH --time=00:10:00
Expand Down

0 comments on commit 48c5ee7

Please sign in to comment.