forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve resilience of apptainer testing (chapel-lang#23543)
This PR takes two steps to improve nightly apptainer testing: 1. It checks for files before deleting them, so that a failure to `git clone` in one config does not stop the testing for all configs. 2. It adds a wait-and-retry loop to the `git clone` command. Reviewed by @bhavanijayakumaran - thanks!
- Loading branch information
Showing
2 changed files
with
36 additions
and
12 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
38 changes: 30 additions & 8 deletions
38
util/devel/test/vagrant/provision-scripts/chapel-update.sh
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 |
---|---|---|
@@ -1,10 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -d chapel ] | ||
then | ||
echo chapel directory already exists - updating | ||
cd chapel && git checkout main && git pull --ff-only && cd .. && echo UPDATED | ||
else | ||
echo cloning chapel | ||
git clone https://github.com/chapel-lang/chapel && echo CLONED | ||
fi | ||
for try in 1 2 3 4 5 | ||
do | ||
|
||
if [ -d chapel ] | ||
then | ||
echo chapel directory already exists - updating | ||
cd chapel && git checkout main && git pull --ff-only && cd .. && echo UPDATED | ||
else | ||
echo cloning chapel | ||
git clone https://github.com/chapel-lang/chapel && echo CLONED | ||
fi | ||
|
||
if [ $? -eq 0 ] | ||
then | ||
# OK, all done, exit with success | ||
exit 0 | ||
else | ||
echo "Error with git. Pausing for 30s." | ||
sleep 30 | ||
if [ -d chapel ] | ||
then | ||
echo "Deleting the chapel directory that failed update" | ||
rm -rf chapel | ||
fi | ||
fi | ||
|
||
done | ||
|
||
# if we got here, there was an error | ||
exit 1 |