Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should allow users of the Spack and Ramble modules to use commit hashes as refs for the version they procure.
This was accomplished by ignoring errors on a bad
git clone --branch
, collecting the return code, and if it's not equal to 0, then it attempting to clone the repo and reset the repo to the ref.Tested by deploying a modified hpc-slurm-gromacs blueprint. The tests varied the spack_ref field with
spack_ref: v0.19.0
,spack_ref: 45accfa
, and without a ref specified.After creation I checked
/sw/spack
directory to make sure that the branch matched the ref. All three matched with the ref that was selected.Additionally I recorded the time to run the clone:
spack_ref: v0.19.0
: 1'46"spack_ref: 45accfa
: 1'49"no
spack_ref
specified: 1'55"Original templates (single command): 1'44"
After reverting back to two tasks (
git clone --branch ref
with fail-through togit clone ... && git checkout ref
, testing was done the same as above and the run times were not significantly different.An unknown ref was also tested to ensure that the script failed during the second clone, which was successful.