-
Notifications
You must be signed in to change notification settings - Fork 1
Spack V1 Migration Feature: Reserved Spack Definitions #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: spack-v1-migration
Are you sure you want to change the base?
Conversation
d9694d0 to
857bbd2
Compare
|
This looks about ready to go! |
aidanheerdegen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An initial pass, but might need a peer-review to ask some more questions.
scripts/spack_manifest/getter.py
Outdated
| # {'something': ['else']} | ||
| # ]} | ||
| # Into a much easier to parse: | ||
| # ['name': 'access-om2', 'version': '2025.02.100'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # ['name': 'access-om2', 'version': '2025.02.100'] | |
| # [{'name': 'access-om2'}, {'version': '2025.02.100'}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of which, why an array of single key/value dicts, and not just a dict with multiple key/value pairs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, they actually were dict[str, Any] anyway! Done in b60c71d
scripts/spack_manifest/getter.py
Outdated
| # A bit of a strange case, but in future we may want to handle other reserved | ||
| # definitions as lists rather than single strings | ||
| case "name" | "version" | _: | ||
| reserved_definitions[reserved_name_no_underscore] = ( | ||
| reserved_value_list[0] | ||
| ) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the other case isn't being handled currently why bother with this logic? Could just mention in a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, done in b60c71d
scripts/spack_manifest/getter.py
Outdated
| if len(package_spec.get("require", {})) != 0 and package_spec["require"][ | ||
| 0 | ||
| ].startswith("@"): | ||
| packages_with_versions_defined.append(package_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know if this was an automatice code-formatter, but that is horrendous line breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, black. Done in b60c71d
| - _name: [access-om2] | ||
| - _version: [2024.03.0] | ||
| specs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has different indentation to the spack.yaml input. Don't know if this is relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't affect the tests, but it's good to be consistent - done in 984b2d3
| # add package specs to the `specs` list | ||
| definitions: | ||
| - _name: ["access-om2"] | ||
| - _version: ["2024.03.0"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we support/test for reserved definitions other than than _name and _version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't test for them yet, since _name and _version are the only two I can think of so far.
3da2716 to
a685e21
Compare
…only deployment-[name|version]
…remove --keep-root-spec-intact flag
e871355 to
db7e3db
Compare
|
After the rebase onto |
Update reserved defs getter return value, remove case statement, revert autoformatter
Closes #330
Will be merged into #326
Background
Root specs are very meaningful in our infrastructure. This comes with a few downsides, mostly in the cases where we have multiple specs in the speclist, or regular users want to use prerelease manifests in their own instances but can't due to prerelease-specific modifications of the root spec.
In this PR, we move away from important information being in the
.spack.specs[0]field, and instead use reserved, dummy definitions at the top of the file:This means that speclists can be free from infra-specific information, and they are open to future modification.
The PR
get-spack-root-specaction to the more aptget-spack-manifestdeployment-{name|version}outputs, equivalent to.spack.definitions[]._{name|version}[0]fields.get-spack-root-specaction toget-spack-manifestTesting
Testing Details in this collapsed section
Unit Tests
Done via
pytest, all pass.MDR Testing
Done for regular MDRs in ACCESS-NRI/ACCESS-TEST#60
Prerelease (Draft)
Success, see https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/19916256065
Prerelease (Ready For Review)
Success, see https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/20013811438
Prerelease (
!redeploy)Expected failure, since the schema version updates are not yet on the
mainbranch (since comment triggers are technically in the context of themainbranch). But, the only points of difference (The status setting in https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/20014778511/job/57390074093 and https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/20014778511/job/57390091047) succeeded as expected.Software Deployment Repository Testing
Done for Software Deployment Repostiories in ACCESS-NRI/system-tools#19
Prerelease (Draft)
Succeeded, see https://github.com/ACCESS-NRI/system-tools/actions/runs/20151461268?pr=19
Prerelease (Ready For Review)
Succeeded. see https://github.com/ACCESS-NRI/system-tools/actions/runs/20217336546?pr=19
Prerelease (
!redeploy)Expected failure, since the schema version updates are not yet on the
mainbranch (since comment triggers are technically in the context of themainbranch). But, the only points of difference (The status setting in https://github.com/ACCESS-NRI/system-tools/actions/runs/20217823516/job/58033899157 and https://github.com/ACCESS-NRI/system-tools/actions/runs/20217823516/job/58033912451) succeeded as expected.