Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
21cdda9
Add new spack-checkout-updated-ref action for spack-managed package r…
CodeGat Oct 31, 2025
cd6cdbd
Update .gitignore to ignore build secrets
CodeGat Nov 3, 2025
0039903
Dockerfile: Update to spack v1, additional fixes
CodeGat Nov 3, 2025
9fa6bad
ci*.yml: Update to v1, manage spack-packages repos via `spack repo up…
CodeGat Nov 3, 2025
cd0aa27
Update compilers for dev and prod to `intel-oneapi-compilers-classic@…
CodeGat Nov 3, 2025
6466d22
compose.[dev|prod].yaml: Added OCI buildcache build secrets, updated …
CodeGat Nov 3, 2025
74282de
Update default access-spack-packages-ref to `api-v2`, spack-ref to `r…
CodeGat Nov 3, 2025
0496cef
Update inter-workflow refs to `v3`
CodeGat Nov 3, 2025
7b7d34a
fix: Update spack-checkout-updated-refs get-git-ref-info action to us…
CodeGat Nov 4, 2025
cad4fbe
fix: fetch repository history to get SHA for the new ref, force updat…
CodeGat Nov 11, 2025
fde9574
Added specific versions for the compose.prod.yaml
CodeGat Nov 11, 2025
2ef704f
fix: update builtin-spack-packages-ref to develop
CodeGat Nov 12, 2025
c1d2bb7
fix: Check that spack is an acceptable version for build-ci@v3, updat…
CodeGat Nov 11, 2025
c7fe733
tools: Added mass-pr-create.sh script
CodeGat Nov 17, 2025
59255bb
Update Dockerfile to make secrets optional, move tmate install to end…
CodeGat Nov 23, 2025
e4357ac
Update default SPACK_VERSION to `v1.1`
CodeGat Nov 23, 2025
a20caaf
Updated compose files to v1.1
CodeGat Nov 28, 2025
5fe9577
Update default spack-ref to releases/v1.1
CodeGat Dec 1, 2025
7a00b7e
Update scope to site rather than user,
CodeGat Dec 1, 2025
62ad825
Continue creating logs even if one spec failed to install
CodeGat Dec 2, 2025
057acb6
Add spack concretize --fresh --force pre install
CodeGat Dec 2, 2025
a582fcc
Use updated v1 volume instead v1.0
CodeGat Dec 4, 2025
43ef5da
Update guidance regarding default spack ref
CodeGat Dec 8, 2025
2acb571
Remove --fresh concretization
CodeGat Dec 8, 2025
9225ee9
ci*.yml: Don't explicitly load compilers
CodeGat Dec 8, 2025
c0fef23
Add back commented targets for prod/dev image packages
CodeGat Dec 8, 2025
e1aa3f3
Update prod image names
CodeGat Dec 8, 2025
e4ba85d
Remove redundant if
CodeGat Dec 8, 2025
f731479
Remove confusing sleep step in spack-checkout-updated-ref example
CodeGat Dec 8, 2025
2d077fc
Update .github/actions/spack-checkout-updated-ref/README.md
CodeGat Dec 8, 2025
cacd818
Update workflow input/output examples
CodeGat Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/actions/spack-checkout-updated-ref/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Update Existing Repo and Checkout Ref

Action that updates an existing repository, and checks out the updated ref.

## Inputs

| Name | Type | Description | Required | Default | Example |
| ---- | ---- | ----------- | -------- | ------- | ------- |
| `spack-packages-repository-name` | `string` | The name of the repository used by spack to update and checkout the ref (given in the spack config file `repos.yaml`) | `true` | N/A | `"builtin"` |
| `spack-packages-repository-path` | `string` (path) | The path to the repository to update and check out the ref | `true` | N/A | `"/root/.spack/package_repos/fncqgg4/repos/spack_repo/builtin"` |
| `ref` | `string` (git branch, tag or sha) | The git ref to check out | `true` | N/A | `"main"` or `"v1"` or `"f8r73g3"` |
| `spack-instance-root-path` | `string` (path) | The path to the spack instance root, used to setup the spack environment | `true` | N/A | `"/opt/spack"` |
An example [`repos.yaml` file](https://github.com/ACCESS-NRI/spack-config/blob/main/common-api-v2/repos.yaml) as referenced above.
## Outputs

| Name | Type | Description | Example |
| ---- | ---- | ----------- | ------- |
| `sha` | `string` (sha) | The SHA of the checked out ref | `"5a1cdc4e4617fcd6ba1cccf1cd0432b5631983be"` |
| `updated` | `string` (boolean) | Whether there was actually an update to the ref | `"true"` or `"false"` |

## Examples

### Simple

```yaml
# ...
jobs:
update-repo:
runs-on: ubuntu-latest
env:
SPACK_ROOT: /opt/spack
steps:
- id: repo
run: |
. ${{ env.SPACK_ROOT }}/share/spack/setup-env.sh
echo "path=$(spack location --repo builtin)" >> $GITHUB_OUTPUT

- id: update
uses: ./.github/actions/spack-checkout-updated-ref
with:
spack-packages-repository-name: builtin
spack-packages-repository-path: ${{ steps.repo.outputs.path }}
ref: develop
spack-instance-root-path: ${{ env.SPACK_ROOT }}

- run: echo "The builtin spack-packages repo was updated to ${{ steps.update.outputs.sha }}"
```
72 changes: 72 additions & 0 deletions .github/actions/spack-checkout-updated-ref/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Checkout Ref Via Spack
description: Updates and checks out a given ref for an existing spack-packages repository via spack
inputs:
spack-packages-repository-name:
description: |
The spack name of the repository to update and check out the ref.
This is the repos.NAME key in spacks repos.yaml config file - eg. builtin
required: true
spack-packages-repository-path:
description: The path to the repository to update and check out the ref
required: true
ref:
description: The git ref to check out
required: true
spack-instance-root-path:
description: The path to the spack instance root, used to setup the spack environment
required: true
outputs:
sha:
description: 'The SHA of the checked out ref'
value: ${{ steps.ref-sha.outputs.sha }}
updated:
description: 'Whether the repository was updated'
value: ${{ steps.post-update.outputs.updated }}
runs:
using: composite
steps:
- name: Get initial SHA
id: initial
shell: bash
run: |
sha=$(git -C ${{ inputs.spack-packages-repository-path }} rev-parse HEAD^{})
echo "${{ inputs.spack-packages-repository-name }} Initial SHA: $sha"

echo "sha=$sha" >> $GITHUB_OUTPUT

- name: Fetch latest for repo
shell: bash
run: git -C ${{ inputs.spack-packages-repository-path }} fetch --force --tags

- name: Get SHA for ref
id: ref-sha
uses: access-nri/actions/.github/actions/get-git-ref-info@main
with:
repository-path: ${{ inputs.spack-packages-repository-path }}
ref: ${{ inputs.ref }}

- name: Update ref via Spack
shell: bash
id: update
continue-on-error: true
run: |
. ${{ inputs.spack-instance-root-path }}/share/spack/setup-env.sh
spack repo update ${{ inputs.spack-packages-repository-name }} --commit ${{ steps.ref-sha.outputs.sha }}

- name: Force Update ref via Git if Failure
if: steps.update.outcome == 'failure'
shell: bash
# FIXME: If there is ever a spack repo update --force option, use that for the above command and delete this step
run: git -C ${{ inputs.spack-packages-repository-path }} checkout --force ${{ steps.ref-sha.outputs.sha }}

- name: Check if updated
id: post-update
shell: bash
run: |
if [ "${{ steps.initial.outputs.sha }}" != "${{ steps.ref-sha.outputs.sha }}" ]; then
echo "Repository was updated from ${{ steps.initial.outputs.sha }} to ${{ inputs.ref }} (${{ steps.ref-sha.outputs.sha }})"
echo "updated=true" >> $GITHUB_OUTPUT
else
echo "Repository was not updated, stayed at ${{ inputs.ref }} (${{ steps.initial.outputs.sha }})"
echo "updated=false" >> $GITHUB_OUTPUT
fi
29 changes: 16 additions & 13 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ This workflow handles building and running short CI tests on a given spack manif
| `spack-manifest-data-path`| `string` (Path relative to component repository root) | File path in the caller model component repository that contains jinja data to fill in to the spack manifest jinja template given by `inputs.spack-manifest-path`. This doesn't include the pull request ref (`{{ pr }}`), which is filled in automatically | `false` | N/A | `".github/build/data/template-data.json"` |
| `spack-compiler-manifest-path` | `string` (Path relative to component repository root) | A file path in the caller model component repository that contains the spack manifest to install local compilers not in the upstream | `false` | N/A | `".github/build/compilers/intel-2021.11.0.spack.yml"` |
| `spack-manifest-data-pairs` | `string` | An optional, multi-line string of space-separated key-value pairs to fill in `inputs.spack-manifest-path`. This is useful for filling in template values created dynamically by earlier jobs needed by this workflow. This doesn't include `{{ ref }}`, which is filled in automatically. | `false` | N/A | `"package mom5`(newline)`compiler intel"` |
| `ref` | `string` (Git ref) | The branch, tag, or commit SHA of the caller model component repository | `false` | `github.event.pull_request.head.sha` for PRs, `github.sha` otherwise | `"02125b01eb7c778c8d0ae0a02a260de474782e81"`, `"main"`, `"2025.01.000"` |
| `ref` | `string` (Git ref) | The branch, tag, or commit SHA of the caller model component repository | `false` | `github.event.pull_request.head.sha` for PRs, `github.sha` otherwise | `"c0fef23fc1e69d3a31ec18fd8b7102acdf95f651"`, `"main"`, `"2025.01.000"` |
| `spack-config-ref` | `string` (Git ref) | The branch, tag, or commit SHA of the access-nri/spack-config repository to use | `false` | `"main"` | `"02125b01eb7c778c8d0ae0a02a260de474782e81"`, `"main"`, `"2025.01.000"` |
| `spack-packages-ref` | `string` (Git ref) | The branch, tag, or commit SHA of the access-nri/spack-packages repository to use | `false` | `"main"` | `"02125b01eb7c778c8d0ae0a02a260de474782e81"`, `"main"`, `"2025.01.000"` |
| `builtin-spack-packages-ref` | `string` (Git ref) | The branch, tag, or commit SHA of the `spack/spack-packages` repository to use | `false` | `"main"` | `"f7314790111ec43cf9cff60421c155b922c349ad"`, `"main"`, `"2025.01.000"` |
| `access-spack-packages-ref` | `string` (Git ref) | The branch, tag, or commit SHA of the `access-nri/access-spack-packages` repository to use | `false` | `"main"` | `"e4ba85db0be4a9b9493cf7581623f9997b9404a5"`, `"main"`, `"2025.01.000"` |
| `allow-ssh-into-spack-install` | `boolean` | Enable the actor of the workflow to SSH into the container where the spack packages have been installed. This is useful for gathering post-install information before the container is destroyed. This will also make the workflow wait until the actor SSHs into the container, or it times out, before continuing | `false` | `false` | `true`, `false` |
| `container-image-version` | `string` (Docker version ref) | The version of the container image to use for the runner. Can be either a `:TAG` or a `@sha256:SHA`. | `false` | `":rocky"` | `':8.9'` (tag), `'@sha256:1234...'` (SHA) |
| `spack-oci-buildcache-url` | `string` (OCI URL) | The URL to an oci-backed buildcache, available in spack >= v1.0. OCI-backed buildcaches are the only option for GitHub-hosted CI, and can be used as a backup for self-hosted CI's runner buildcache | `false` | N/A | `"oci://ghcr.io/ACCESS-NRI/build-ci-buildcache"`, `"oci://ghcr.io/ORG/IMAGE"` |
Expand All @@ -43,9 +44,10 @@ This workflow handles building and running short CI tests on a given spack manif
| ---- | ---- | ----------- | ------- |
| `spec-concretization-graph` | `string` (multiline) | A visual representation of the dependencies and constraints of the spack manifest file installed | N/A |
| `spack-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/spack` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
| `spack-config-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/spack-config` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
| `spack-packages-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/spack-packages` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
| `sha` | `string` (Git commit SHA) | The SHA of the caller model component repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
| `spack-config-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/spack-config` repository checked out | `"c0fef23fc1e69d3a31ec18fd8b7102acdf95f651"` |
| `builtin-spack-packages-sha` | `string` (Git commit SHA) | The SHA of the `spack/spack-packages` repository checked out | `"9225ee95da5c6e212a80d933db8aca44271417a3"` |
| `access-spack-packages-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/access-spack-packages` repository checked out | `"2acb57187fc75c0fc83c898d1dd47bdaced2fca9"` |
| `sha` | `string` (Git commit SHA) | The SHA of the caller model component repository checked out | `"43ef5da423028a9a25133884e6e402900e87a3ce"` |
| `container-id` | `string` | The ID of the container where the spack packages have been installed | `"ohfn2ofy2h2uyfg2uyg3uyg3uh"` |
| `spack-files-artifact-pattern` | `string` (glob) | Wildcard pattern to match all spack file artifacts across a matrix job | `'spack-files-*'` |
| `spack-files-artifact-url` | `string` (URL) | The URL of the spack manifest and lock files artifact | `"https://github.com/ACCESS-NRI/MOM5/actions/runs/15890554355/artifacts/3406449135"` |
Expand All @@ -67,7 +69,7 @@ This workflow handles building and running short CI tests on a given spack manif
```yaml
jobs:
test:
uses: access-nri/build-ci/.github/workflows/ci.yml@v2
uses: access-nri/build-ci/.github/workflows/ci.yml@v3
with:
spack-manifest-path: .github/build/spack.yaml.j2
```
Expand All @@ -77,13 +79,14 @@ jobs:
```yaml
jobs:
test:
uses: access-nri/build-ci/.github/workflows/ci.yml@v2
uses: access-nri/build-ci/.github/workflows/ci.yml@v3
with:
spack-manifest-path: .github/build/spack.yaml.j2
spack-manifest-data-path: .github/build/data/data.json
spack-compiler-manifest-path: .github/build/compiler/intel.spack.yaml
spack-ref: releases/v0.22
spack-packages-ref: 2025.05.000
builtin-spack-packages-ref: 2025.07.0
Comment thread
aidanheerdegen marked this conversation as resolved.
access-spack-packages-ref: 2025.05.000
spack-config-ref: 2025.10.001
allow-ssh-into-spack-install: true
secrets:
Expand All @@ -106,7 +109,7 @@ jobs:
- .github/build/one.spack.yaml.j2
- .github/build/two.spack.yaml.j2
- .github/build/three.spack.yaml.j2
uses: access-nri/build-ci/.github/workflows/ci.yml@v2
uses: access-nri/build-ci/.github/workflows/ci.yml@v3
with:
spack-manifest-path: ${{ matrix.manifest }}
```
Expand All @@ -126,7 +129,7 @@ jobs:
compiler: .github/build/compiler/intel.spack.yaml
- manifest: .github/build/two.spack.yaml.j2
compiler: .github/build/compiler/gcc.spack.yaml
uses: access-nri/build-ci/.github/workflows/ci.yml@v2
uses: access-nri/build-ci/.github/workflows/ci.yml@v3
with:
spack-manifest-path: ${{ matrix.values.manifest }}
spack-compiler-manifest-path: ${{ matrix.values.compiler }}
Expand All @@ -144,7 +147,7 @@ jobs:
# This would be a combination of all defined manifest/compilers (eg, 4 jobs)
manifest: [".github/build/one.spack.yaml.j2", ".github/build/two.spack.yaml.j2"]
compiler: [".github/build/compiler/intel.spack.yaml", ".github/build/compiler/gcc.spack.yaml"]
uses: access-nri/build-ci/.github/workflows/ci.yml@v2
uses: access-nri/build-ci/.github/workflows/ci.yml@v3
with:
spack-manifest-path: ${{ matrix.values.manifest }}
spack-compiler-manifest-path: ${{ matrix.values.compiler }}
Expand Down Expand Up @@ -174,7 +177,7 @@ The jinja data file (and the jinja-templatable spack manifest) can be much more
Alternatively, you can supply a newline-separated list of space-separated template-value pairs through `inputs.spack-manifest-data-pairs`, which are more useful if you are supplying data to this workflow through `need`ed job outputs. For example:

```yaml
uses: access-nri/build-ci/.github/workflows/ci.yml@v2
uses: access-nri/build-ci/.github/workflows/ci.yml@v3
with:
spack-manifest-path: .github/build-ci/manifests/spack.yaml.j2
spack-manifest-data-pairs: |-
Expand Down Expand Up @@ -229,7 +232,7 @@ jobs:
file:
- .github/build-ci/manifests/some.spack.yaml.j2
- .github/build-ci/manifests/another.spack.yaml.j2
uses: access-nri/build-ci/.github/workflows/ci.yaml@v2
uses: access-nri/build-ci/.github/workflows/ci.yaml@v3
with:
spack-manifest-path: ${{ matrix.file }}

Expand Down
Loading