Skip to content

Improve Spack and Ramble Refs#1882

Merged
cdunbar13 merged 1 commit into
GoogleCloudPlatform:developfrom
cdunbar13:spack-ref-fix
Oct 27, 2023
Merged

Improve Spack and Ramble Refs#1882
cdunbar13 merged 1 commit into
GoogleCloudPlatform:developfrom
cdunbar13:spack-ref-fix

Conversation

@cdunbar13

@cdunbar13 cdunbar13 commented Oct 25, 2023

Copy link
Copy Markdown
Collaborator

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 to git 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.

@cdunbar13 cdunbar13 added the release-module-improvements Added to release notes under the "Module Improvements" heading. label Oct 25, 2023
@cdunbar13 cdunbar13 requested a review from nick-stroud October 25, 2023 20:32
Comment thread community/modules/scripts/ramble-setup/templates/ramble_setup.yml.tftpl Outdated
@nick-stroud nick-stroud assigned cdunbar13 and unassigned nick-stroud Oct 27, 2023
@nick-stroud nick-stroud assigned cdunbar13 and unassigned nick-stroud Oct 27, 2023
@cdunbar13 cdunbar13 merged commit 29a9cff into GoogleCloudPlatform:develop Oct 27, 2023
@cdunbar13 cdunbar13 deleted the spack-ref-fix branch October 27, 2023 16:53
@mr0re1 mr0re1 mentioned this pull request Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-module-improvements Added to release notes under the "Module Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants