Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit d8976ad

Browse files
iomaganarispramodk
andcommitted
Add branch selection for Neuron and Spack (#237)
- Added parameters for SPACK_BRANCH, NEURON_BRANCH and CORENEURON_BRANCH - Added logic to patch neuron spack recipe with the branch we want to test - Install +debug variant of NEURON - Export to the user the variable CORENEURON_BRANCH instead of sha1 - Also added this variable in the branches to build (needs testing) Co-authored-by: Pramod Kumbhar <[email protected]>
1 parent e4b75c1 commit d8976ad

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

tests/jenkins/Jenkinsfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ pipeline {
22
agent {
33
label 'bb5'
44
}
5+
parameters {
6+
string(name: 'CORENEURON_BRANCH', defaultValue: '',
7+
description: 'What branch of CoreNeuron to test.')
8+
string(name: 'SPACK_BRANCH', defaultValue: 'develop',
9+
description: 'Which branch of spack to use.')
10+
string(name: 'NEURON_BRANCH', defaultValue: '',
11+
description: 'Which branch of neuron to use. For master branch (neuron@develop) leave this parameter blank.')
12+
}
513
stages {
614

715
stage('install Spack'){
@@ -10,7 +18,7 @@ pipeline {
1018
}
1119
}
1220

13-
stage('spack install neuron@develop'){
21+
stage('spack install neuron+debug@develop'){
1422
steps {
1523
sh 'sh tests/jenkins/install_neuron.sh'
1624
}

tests/jenkins/install_neuron.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
#!/usr/bin/bash
22

3+
sed_apply() (
4+
f=$1
5+
sedexp=$2
6+
echo "PATCHING $f with '$sedexp'"
7+
(cd $(dirname $f) && git checkout "$(basename $f)") && sed -i "$sedexp" "$f"
8+
grep 'version(' "$f"
9+
)
10+
11+
patch_neuron() (
12+
if [ "$NEURON_BRANCH" ]; then
13+
pkg_file="${SPACK_ROOT}/var/spack/repos/builtin/packages/neuron/package.py"
14+
sedexp="/version.*tag=/d" # Drop tags
15+
sedexp="$sedexp; /version.*preferred=/d" # Drop preferred version
16+
sedexp="$sedexp; s#branch=[^)]*)#branch='$NEURON_BRANCH', preferred=True)#g" # replace branch
17+
sed_apply "$pkg_file" "$sedexp"
18+
fi
19+
)
20+
321
set -x
422
set -e
523

24+
export SPACK_ROOT="$WORKSPACE/BUILD_HOME/spack/"
625
export SPACK_INSTALL_PREFIX="${SPACK_INSTALL_PREFIX:-${WORKSPACE}/INSTALL_HOME}"
7-
source $WORKSPACE/BUILD_HOME/spack/share/spack/setup-env.sh
26+
source ${SPACK_ROOT}/share/spack/setup-env.sh
827
source /gpfs/bbp.cscs.ch/apps/hpc/jenkins/config/modules.sh
928
export PATH=$WORKSPACE/BUILD_HOME/spack/bin:/usr/bin:$PATH
1029
export MODULEPATH=$SPACK_INSTALL_PREFIX/modules/tcl/$(spack arch):$MODULEPATH
1130

1231
unset $(env|awk -F= '/^(PMI|SLURM)_/ {if ($1 != "SLURM_ACCOUNT") print $1}')
1332

14-
spack install neuron@develop
33+
patch_neuron
34+
35+
spack install neuron+debug@develop
1536
module av neuron

0 commit comments

Comments
 (0)