-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spack module rebuild pipelines for Incline and Deception (#40)
* enable module rebuild for incline and deception [incline-rebuild] [deception-rebuild] * update perms for SPACK_INSTALL dir [deception-rebuild] [incline-rebuild] * remove chmod command [deception-rebuild] * send correct exit code [deception-rebuild] * try with SPACK_GIT_TOKEN added [deception-rebuild] * Update deception spack built tcl modules - [deception-test] * do not run ascent tests on PNNL rebuild pipelines [deception-rebuild] [incline-rebuild] * Update deception spack built tcl modules - [deception-test] * Update incline spack built tcl modules - [incline-test] --------- Co-authored-by: spack-auto-module <[email protected]>
- Loading branch information
1 parent
f7ecbf5
commit fa76fba
Showing
9 changed files
with
212 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,14 @@ include: | |
- &default | ||
when: always | ||
# -- | ||
# Only run when the commit **DOES NOT** contains "[deception-rebuild]" | ||
- &rule_no_deception_rebuild | ||
if: '$CI_COMMIT_TITLE =~ /\[deception-rebuild\]/' | ||
when: never | ||
# Only run when the commit **DOES NOT** contains "[incline-rebuild]" | ||
- &rule_no_incline_rebuild | ||
if: '$CI_COMMIT_TITLE =~ /\[incline-rebuild\]/' | ||
when: never | ||
# Only run when the commit **DOES NOT** contains "[deception-test]" | ||
- &rule_no_deception_test | ||
if: '$CI_COMMIT_TITLE =~ /\[deception-test\]/' | ||
|
@@ -77,6 +85,14 @@ stages: | |
paths: | ||
- partition | ||
|
||
.module_rebuild: | ||
needs: [] | ||
retry: 1 | ||
stage: build | ||
extends: | ||
- .pnnl_tags_template | ||
- .pnnl_module_script_template | ||
|
||
.pnnl_after_script_template: | ||
after_script: | ||
- | | ||
|
@@ -162,6 +178,82 @@ stages: | |
rm "$WORKDIR/jobid_${jobid}" | ||
exit $res | ||
.pnnl_module_script_template: | ||
script: | ||
- | | ||
set -x | ||
# Configure git before making changes | ||
git checkout -b ${CI_COMMIT_REF_NAME} | ||
export WORKDIR="$HOME/gitlab/${CI_PIPELINE_ID}/${WORKDIR_SUFFIX}" | ||
mkdir -p "$WORKDIR" | ||
cp -r . "$WORKDIR" | ||
cd "$WORKDIR" | ||
# jobid used in pnnl_after_script_template to cancel job if cancelled or | ||
# timed out by gitlab through the UI | ||
jobid=$(sbatch $WORKDIR/buildsystem/spack/$MY_CLUSTER/install.sh) | ||
export jobid=$(echo $jobid | cut -f4 -d ' ') | ||
# Unique jobid filename for this job | ||
echo $jobid > "$WORKDIR/jobid_${jobid}" | ||
# This is hard coded into sbatch script | ||
outfile=spack_install.$jobid.output | ||
[ -f $outfile ] && rm $outfile | ||
touch $outfile | ||
tail -f $outfile & | ||
tailpid=$! | ||
res=1 | ||
while :; | ||
do | ||
if [[ "$(awk 'BEGIN{i=0}/BUILD_STATUS/{i++}END{print i}' $outfile)" != "0" ]]; then | ||
kill $tailpid | ||
echo 'Last tail of build $outfile:' | ||
tail -n 200 $outfile | ||
res=$(grep BUILD_STATUS $outfile | tail -n 1 | cut -f2 -d':') | ||
break | ||
fi | ||
sleep 60 | ||
done | ||
|
||
if [ "$res" -ne "0" ]; then | ||
echo "Finished batch job with exit code: $res" | ||
rm "$WORKDIR/jobid_${jobid}" | ||
rm -rf $WORKDIR | ||
set +x | ||
# We want to exit early if the spack build didn't succeed. | ||
exit $res; | ||
fi | ||
|
||
# Modules are in /buildsystem/spack/$MY_CLUSTER/modules | ||
# Assuming MY_CLUSTER is lower case | ||
git add ./buildsystem/spack/${MY_CLUSTER}/modules/* | ||
|
||
# Have to configure username to be able to add commits | ||
git config user.name "spack-auto-module" | ||
git config user.email "[email protected]" | ||
|
||
# Add commit to MR branch - message can be changed | ||
git commit -m "Update ${MY_CLUSTER} spack built tcl modules - [${MY_CLUSTER}-test]" | ||
|
||
# Re-target GitHub as our remote | ||
git remote set-url origin https://gitlab-ci-token:${SPACK_GIT_TOKEN}@github.com/ORNL/ReSolve.git | ||
|
||
# Do a rebase incase another pipeline has pushed since build started | ||
git pull --rebase origin ${CI_COMMIT_REF_NAME} | ||
git push origin ${CI_COMMIT_REF_NAME} | ||
|
||
rm -rf $WORKDIR | ||
set +x | ||
exit $res | ||
|
||
.report-job: | ||
retry: 1 | ||
image: mrnonz/alpine-git-curl:alpine3.16 | ||
|
@@ -253,6 +345,8 @@ stages: | |
|
||
.deception: | ||
rules: | ||
- *rule_no_deception_rebuild | ||
- *rule_no_incline_rebuild | ||
- *rule_yes_deception_test | ||
- *rule_no_incline_test | ||
- *default | ||
|
@@ -263,6 +357,8 @@ stages: | |
|
||
.incline: | ||
rules: | ||
- *rule_no_deception_rebuild | ||
- *rule_no_incline_rebuild | ||
- *rule_no_deception_test | ||
- *rule_yes_incline_test | ||
- *default | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters