Improve Spack and Ramble Refs#1882
Merged
Merged
Conversation
nick-stroud
requested changes
Oct 25, 2023
5ec6c58 to
ae11fe5
Compare
nick-stroud
requested changes
Oct 27, 2023
985e055 to
da41362
Compare
nick-stroud
approved these changes
Oct 27, 2023
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/spackdirectory 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_refspecified: 1'55"Original templates (single command): 1'44"
After reverting back to two tasks (
git clone --branch refwith 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.