-
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
Merged
CodeGat
merged 21 commits into
spack-v1-migration
from
spack-v1-migration-reserved-defs
Jan 16, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
aee7ddb
Rename action from get-spack-root-spec to get-spack-manifest, return …
CodeGat 9fa540a
cd.yml: Use get-spack-manifest, rework job names
CodeGat baf97d8
ci-comment.yml: Use get-spack-manifest, simplify update and commit of…
CodeGat a45ab2f
deploy-1-setup.yml: Use get-spack-manifest, remove check on root spec…
CodeGat 65da3e5
deploy-2-start.yml: Remove unused manifest information
CodeGat 6dfad3a
fix: Add manifest path to action
CodeGat a93709c
Update modules.py, prerelease.py to use reserved defs _name and _version
CodeGat 99e8982
Update tests
CodeGat 964b3ce
Make reserved definitions flow-style for module injection too
CodeGat efb67fd
Remove references to RootSpecs, use ReservedDefinitions.get("name"), …
CodeGat faef9fe
Update pkg_repo_url logic to use spack.repo.PATH.get_pkg_class()
CodeGat e246aae
getter.py fixes from code review
CodeGat 24caa9d
Update test input manifest formatting
CodeGat 5a1c869
Add back manifest info step
CodeGat 72f0579
Update pre/release injections to handle multiple specs, simplify cust…
CodeGat 79f4fdd
Change release injection --packages from space-sep to comma-sep, as c…
CodeGat 6b97808
Update tests
CodeGat ee72d1b
Explicitly disallow multi-spec Releases
CodeGat 16fc6c6
get-spack-manifest: call the getter.py script
CodeGat 5a1c7e3
Import yaml representers from own class
CodeGat 1f0d0a4
Small fixes
CodeGat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Get Spack Manifest Information | ||
|
|
||
| Action that returns information about a Spack manifest file. | ||
|
|
||
| ## Inputs | ||
|
|
||
| > [!NOTE] | ||
| > Action assumes that an appropriate repository is checked out prior to invocation | ||
|
|
||
| | Name | Type | Description | Required | Default | Example | | ||
| | ---- | ---- | ----------- | -------- | ------- | ------- | | ||
| | `spack-manifest-path` | `string` | The path to the spack manifest file | `false` | `"./spack.yaml"` | `"./some/other.spack.yaml"` | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Type | Description | Example | | ||
| | ---- | ---- | ----------- | ------- | | ||
| | `deployment-name` | `string` | The name of the deployment as specified in the reserved definition `_name` | `access-om2` | | ||
| | `deployment-version` | `string` | The version of the deployment as specified in the reserved definition `_version` | `2025.11.000` | | ||
|
|
||
| ## Example | ||
|
|
||
| ```yaml | ||
| # ... | ||
| jobs: | ||
| manifest: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - id: spec | ||
| uses: access-nri/build-cd/.github/actions/get-spack-manifest@vX # for some version `vX` | ||
| with: | ||
| spack-manifest-path: ./spack.yaml | ||
|
|
||
| - run: | | ||
| echo "Deploying ${{ steps.spec.outputs.deployment-name }} at ${{ steps.spec.outputs.deployment-version }}" | ||
| ``` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Get Spack Manifest Information | ||
| description: Action that returns information about a Spack manifest file | ||
| author: Tommy Gatti | ||
| inputs: | ||
| spack-manifest-path: | ||
| required: false | ||
| default: ./spack.yaml | ||
| description: The path to the spack manifest file | ||
| outputs: | ||
| deployment-name: | ||
| description: | | ||
| The name of the deployment as specified in the reserved definition _name, in the spack manifest file. | ||
| value: ${{ steps.defs.outputs.name }} | ||
| deployment-version: | ||
| description: | | ||
| The version of the deployment as specified in the reserved definition _version, in the spack manifest file. | ||
| value: ${{ steps.defs.outputs.version }} | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Clone build-cd script location | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: access-nri/build-cd | ||
| path: ${{ github.workspace }}/getter-script | ||
|
|
||
| - name: Get Current Directory | ||
| id: script | ||
| # We need to store the current working directory so we can re-construct the inputs.spack-manifest-path, as we run | ||
| # the script from the build-cd directory | ||
| shell: bash | ||
| run: | | ||
| pwd=$(pwd) | ||
| echo "Action PWD: $pwd" | ||
| echo "pwd=$pwd" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Get reserved definitions | ||
| id: defs | ||
| env: | ||
| PYTHONPATH: ${{ github.workspace }}/getter-script | ||
| shell: python | ||
| run: | | ||
| from scripts.spack_manifest.getter import ReservedDefinitions | ||
| import os | ||
|
|
||
| defs = ReservedDefinitions.from_file("${{ steps.script.outputs.pwd }}/${{ inputs.spack-manifest-path }}") | ||
| name = defs.get("name") | ||
| version = defs.get("version") | ||
|
|
||
| with open(os.environ['GITHUB_OUTPUT'], 'a') as o: | ||
| o.write(f"name={name}\n") | ||
| o.write(f"version={version}\n") | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.