Skip to content

Commit f2fd031

Browse files
committed
ci*.yml: Update to v1, manage spack-packages repos via spack repo update, update step names
1 parent a09416f commit f2fd031

3 files changed

Lines changed: 117 additions & 41 deletions

File tree

.github/workflows/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ This workflow handles building and running short CI tests on a given spack manif
1616
| `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"` |
1717
| `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"` |
1818
| `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"` |
19-
| `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"` |
19+
| `builtin-spack-packages-ref` | `string` (Git ref) | The branch, tag, or commit SHA of the `spack/spack-packages` repository to use | `false` | `"main"` | `"02125b01eb7c778c8d0ae0a02a260de474782e81"`, `"main"`, `"2025.01.000"` |
20+
| `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"` | `"02125b01eb7c778c8d0ae0a02a260de474782e81"`, `"main"`, `"2025.01.000"` |
2021
| `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` |
2122
| `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) |
2223
| `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"` |
@@ -44,7 +45,8 @@ This workflow handles building and running short CI tests on a given spack manif
4445
| `spec-concretization-graph` | `string` (multiline) | A visual representation of the dependencies and constraints of the spack manifest file installed | N/A |
4546
| `spack-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/spack` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
4647
| `spack-config-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/spack-config` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
47-
| `spack-packages-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/spack-packages` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
48+
| `builtin-spack-packages-sha` | `string` (Git commit SHA) | The SHA of the `spack/spack-packages` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
49+
| `access-spack-packages-sha` | `string` (Git commit SHA) | The SHA of the `ACCESS-NRI/access-spack-packages` repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
4850
| `sha` | `string` (Git commit SHA) | The SHA of the caller model component repository checked out | `"02125b01eb7c778c8d0ae0a02a260de474782e81"` |
4951
| `container-id` | `string` | The ID of the container where the spack packages have been installed | `"ohfn2ofy2h2uyfg2uyg3uyg3uh"` |
5052
| `spack-files-artifact-pattern` | `string` (glob) | Wildcard pattern to match all spack file artifacts across a matrix job | `'spack-files-*'` |
@@ -83,7 +85,8 @@ jobs:
8385
spack-manifest-data-path: .github/build/data/data.json
8486
spack-compiler-manifest-path: .github/build/compiler/intel.spack.yaml
8587
spack-ref: releases/v0.22
86-
spack-packages-ref: 2025.05.000
88+
builtin-spack-packages-ref: 2025.07.0
89+
access-spack-packages-ref: 2025.05.000
8790
spack-config-ref: 2025.10.001
8891
allow-ssh-into-spack-install: true
8992
secrets:

.github/workflows/ci-github-hosted.yml

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ on:
4949
description: |
5050
The branch, tag, or commit SHA of the access-nri/spack-config repository to use.
5151
For example: main, 2025.03.0, 7ey2uy2.
52-
spack-packages-ref:
52+
builtin-spack-packages-ref:
53+
required: false
54+
type: string
55+
default: main
56+
description: |
57+
The branch, tag, or commit SHA of the spack/spack-packages repository to use.
58+
For example: main, 2025.03.0, 7ey2uy2.
59+
access-spack-packages-ref:
5360
required: false
5461
type: string
5562
default: main
@@ -118,10 +125,14 @@ on:
118125
value: ${{ jobs.spack-install-and-test.outputs.spack-config-sha }}
119126
description: |
120127
The SHA of the spack-config repository checked out.
121-
spack-packages-sha:
122-
value: ${{ jobs.spack-install-and-test.outputs.spack-packages-sha }}
128+
builtin-spack-packages-sha:
129+
value: ${{ jobs.spack-install-and-test.outputs.builtin-spack-packages-sha }}
123130
description: |
124-
The SHA of the spack-packages repository checked out.
131+
The SHA of the builtin spack-packages repository checked out.
132+
access-spack-packages-sha:
133+
value: ${{ jobs.spack-install-and-test.outputs.access-spack-packages-sha }}
134+
description: |
135+
The SHA of the access-spack-packages repository checked out.
125136
sha:
126137
value: ${{ jobs.spack-install-and-test.outputs.sha }}
127138
description: |
@@ -173,7 +184,8 @@ jobs:
173184
spec-concretization-graph: ${{ steps.install.outputs.spec }}
174185
spack-sha: ${{ steps.spack-update.outputs.sha }}
175186
spack-config-sha: ${{ steps.spack-config-update.outputs.sha }}
176-
spack-packages-sha: ${{ steps.spack-packages-update.outputs.sha }}
187+
builtin-spack-packages-sha: ${{ steps.builtin-spack-packages-update.outputs.sha }}
188+
access-spack-packages-sha: ${{ steps.access-spack-packages-update.outputs.sha }}
177189
sha: ${{ steps.checkout.outputs.commit }}
178190
spack-files-artifact-pattern: ${{ steps.env.outputs.spack-files-artifact-pattern }}
179191
spack-files-artifact-url: ${{ steps.manifest-upload.outputs.artifact-url }}
@@ -185,13 +197,14 @@ jobs:
185197
short-container-id: ${{ steps.env.outputs.short-container-id }}
186198
# test-artifact-url: ${{ steps.test.outputs.artifact-url }}
187199
steps:
188-
- name: Export environment variables into GitHub Actions format
200+
- name: Init - Export environment variables into GitHub Actions format
189201
# Environment variables inside containers are not accessible in the `env` context,
190202
# a context which would be used in future conditional steps.
191203
# This step exports important container environment variables as outputs.
192204
# And yes, this loop echoes name-of-var=value-of-var!
193205
id: env
194206
run: |
207+
# FIXME: Determine if this list of vars is still required
195208
for var in SPACK_ROOT SPACK_CONFIG_DIR SPACK_REPO_VERSION SPACK_CONFIG_REPO_VERSION SPACK_PACKAGES_REPO_VERSION; do
196209
echo "$var=${!var}" >> $GITHUB_OUTPUT
197210
done
@@ -215,28 +228,21 @@ jobs:
215228
echo "container-id=$container_id" >> $GITHUB_OUTPUT
216229
echo "short-container-id=$short_container_id" >> $GITHUB_OUTPUT
217230
218-
- name: Update spack-package version
219-
id: spack-packages-update
220-
uses: access-nri/build-ci/.github/actions/git-checkout-updated-ref@v2
221-
with:
222-
repository-path: ${{ steps.env.outputs.SPACK_ROOT }}/../spack-packages
223-
ref: ${{ inputs.spack-packages-ref }}
224-
225-
- name: Update spack-config version
231+
- name: Update - spack-config version
226232
id: spack-config-update
227233
uses: access-nri/build-ci/.github/actions/git-checkout-updated-ref@v2
228234
with:
229235
repository-path: ${{ steps.env.outputs.SPACK_ROOT }}/../spack-config
230236
ref: ${{ inputs.spack-config-ref }}
231237

232-
- name: Update spack version
238+
- name: Update - spack version
233239
id: spack-update
234240
uses: access-nri/build-ci/.github/actions/git-checkout-updated-ref@v2
235241
with:
236242
repository-path: ${{ steps.env.outputs.SPACK_ROOT }}
237243
ref: ${{ inputs.spack-ref }}
238244

239-
- name: Relink spack-config to spack
245+
- name: Update - Relink spack-config to spack
240246
if: steps.spack-config-update.outputs.updated == 'true' || steps.spack-update.outputs.updated == 'true'
241247
# If there was a change in spack or spack-config, we should relink the config to spack.
242248
# Furthermore, if spack has been updated, we need to make sure we link to the correct vX config directory in spack-config.
@@ -259,7 +265,36 @@ jobs:
259265
260266
ln --symbolic --relative --verbose --force ${{ steps.env.outputs.SPACK_ROOT }}/../spack-config/${spack_branch}/ci-upstream/* ${{ steps.env.outputs.SPACK_ROOT }}/etc/spack/
261267
262-
- name: Spack - Initial Enable + Compiler Load
268+
- name: Spack - Initial Enable
269+
run: . ${{ steps.env.outputs.SPACK_ROOT }}/share/spack/setup-env.sh
270+
271+
- name: Spack - Get spack-packages repo locations
272+
id: spack-packages-locations
273+
run: |
274+
. ${{ steps.env.outputs.SPACK_ROOT }}/share/spack/setup-env.sh
275+
276+
echo "builtin=$(spack location --repo builtin)" >> $GITHUB_OUTPUT
277+
echo "access-spack-packages=$(spack location --repo access.nri)" >> $GITHUB_OUTPUT
278+
279+
- name: Update - builtin spack-package version
280+
id: builtin-spack-packages-update
281+
uses: access-nri/build-ci/.github/actions/spack-checkout-updated-ref@v2
282+
with:
283+
spack-packages-repository-name: builtin
284+
spack-packages-repository-path: ${{ steps.spack-packages-locations.outputs.builtin }}
285+
ref: ${{ inputs.builtin-spack-packages-ref }}
286+
spack-instance-root-path: ${{ steps.env.outputs.SPACK_ROOT }}
287+
288+
- name: Update - access-spack-package version
289+
id: access-spack-packages-update
290+
uses: access-nri/build-ci/.github/actions/spack-checkout-updated-ref@v2
291+
with:
292+
spack-packages-repository-name: access_spack_packages
293+
spack-packages-repository-path: ${{ steps.spack-packages-locations.outputs.access-spack-packages }}
294+
ref: ${{ inputs.access-spack-packages-ref }}
295+
spack-instance-root-path: ${{ steps.env.outputs.SPACK_ROOT }}
296+
297+
- name: Spack - Compiler Load
263298
run: |
264299
. ${{ steps.env.outputs.SPACK_ROOT }}/share/spack/setup-env.sh
265300
@@ -462,7 +497,8 @@ jobs:
462497
"spack_compiler_manifest_path": "${{ inputs.spack-compiler-manifest-path }}",
463498
"ref": "${{ inputs.ref }}",
464499
"spack_config_ref": "${{ inputs.spack-config-ref }}",
465-
"spack_packages_ref": "${{ inputs.spack-packages-ref }}",
500+
"builtin_spack_packages_ref": "${{ inputs.builtin-spack-packages-ref }}",
501+
"access_spack_packages_ref": "${{ inputs.access-spack-packages-ref }}",
466502
"spack_ref": "${{ inputs.spack-ref }}",
467503
"pytest_test_markers": "${{ inputs.pytest-test-markers }}",
468504
"allow_ssh_into_spack_install": "${{ inputs.allow-ssh-into-spack-install }}",
@@ -473,7 +509,8 @@ jobs:
473509
"spec_concretization_graph": $spec,
474510
"spack_sha": "${{ steps.spack-update.outputs.sha }}",
475511
"spack_config_sha": "${{ steps.spack-config-update.outputs.sha }}",
476-
"spack_packages_sha": "${{ steps.spack-packages-update.outputs.sha }}",
512+
"builtin_spack_packages_sha": "${{ steps.builtin-spack-packages-update.outputs.sha }}",
513+
"access_spack_packages_sha": "${{ steps.access-spack-packages-update.outputs.sha }}",
477514
"sha": "${{ steps.checkout.outputs.commit }}",
478515
"container_id": "${{ steps.env.outputs.container-id }}",
479516
"short_container_id": "${{ steps.env.outputs.short-container-id }}",

.github/workflows/ci.yml

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ on:
4949
description: |
5050
The branch, tag, or commit SHA of the access-nri/spack-config repository to use.
5151
For example: main, 2025.03.0, 7ey2uy2.
52-
spack-packages-ref:
52+
builtin-spack-packages-ref:
53+
required: false
54+
type: string
55+
default: main
56+
description: |
57+
The branch, tag, or commit SHA of the spack/spack-packages repository to use.
58+
For example: main, 2025.03.0, 7ey2uy2.
59+
access-spack-packages-ref:
5360
required: false
5461
type: string
5562
default: main
@@ -118,10 +125,14 @@ on:
118125
value: ${{ jobs.spack-install-and-test.outputs.spack-config-sha }}
119126
description: |
120127
The SHA of the spack-config repository checked out.
121-
spack-packages-sha:
122-
value: ${{ jobs.spack-install-and-test.outputs.spack-packages-sha }}
128+
builtin-spack-packages-sha:
129+
value: ${{ jobs.spack-install-and-test.outputs.builtin-spack-packages-sha }}
123130
description: |
124-
The SHA of the spack-packages repository checked out.
131+
The SHA of the builtin spack-packages repository checked out.
132+
access-spack-packages-sha:
133+
value: ${{ jobs.spack-install-and-test.outputs.access-spack-packages-sha }}
134+
description: |
135+
The SHA of the access-spack-packages repository checked out.
125136
sha:
126137
value: ${{ jobs.spack-install-and-test.outputs.sha }}
127138
description: |
@@ -180,7 +191,8 @@ jobs:
180191
spec-concretization-graph: ${{ steps.install.outputs.spec }}
181192
spack-sha: ${{ steps.spack-update.outputs.sha }}
182193
spack-config-sha: ${{ steps.spack-config-update.outputs.sha }}
183-
spack-packages-sha: ${{ steps.spack-packages-update.outputs.sha }}
194+
builtin-spack-packages-sha: ${{ steps.builtin-spack-packages-update.outputs.sha }}
195+
access-spack-packages-sha: ${{ steps.access-spack-packages-update.outputs.sha }}
184196
sha: ${{ steps.checkout.outputs.commit }}
185197
spack-files-artifact-pattern: ${{ steps.env.outputs.spack-files-artifact-pattern }}
186198
spack-files-artifact-url: ${{ steps.manifest-upload.outputs.artifact-url }}
@@ -192,7 +204,7 @@ jobs:
192204
short-container-id: ${{ steps.env.outputs.short-container-id }}
193205
# test-artifact-url: ${{ steps.test.outputs.artifact-url }}
194206
steps:
195-
- name: Export environment variables into GitHub Actions format
207+
- name: Init - Export environment variables into GitHub Actions format
196208
# Environment variables inside containers are not accessible in the `env` context,
197209
# a context which would be used in future conditional steps.
198210
# This step exports important container environment variables as outputs.
@@ -222,28 +234,21 @@ jobs:
222234
echo "container-id=$container_id" >> $GITHUB_OUTPUT
223235
echo "short-container-id=$short_container_id" >> $GITHUB_OUTPUT
224236
225-
- name: Update spack-package version
226-
id: spack-packages-update
227-
uses: access-nri/build-ci/.github/actions/git-checkout-updated-ref@v2
228-
with:
229-
repository-path: ${{ steps.env.outputs.SPACK_ROOT }}/../spack-packages
230-
ref: ${{ inputs.spack-packages-ref }}
231-
232-
- name: Update spack-config version
237+
- name: Update - spack-config version
233238
id: spack-config-update
234239
uses: access-nri/build-ci/.github/actions/git-checkout-updated-ref@v2
235240
with:
236241
repository-path: ${{ steps.env.outputs.SPACK_ROOT }}/../spack-config
237242
ref: ${{ inputs.spack-config-ref }}
238243

239-
- name: Update spack version
244+
- name: Update - spack version
240245
id: spack-update
241246
uses: access-nri/build-ci/.github/actions/git-checkout-updated-ref@v2
242247
with:
243248
repository-path: ${{ steps.env.outputs.SPACK_ROOT }}
244249
ref: ${{ inputs.spack-ref }}
245250

246-
- name: Relink spack-config to spack
251+
- name: Update - Relink spack-config to spack
247252
if: steps.spack-config-update.outputs.updated == 'true' || steps.spack-update.outputs.updated == 'true'
248253
# If there was a change in spack or spack-config, we should relink the config to spack.
249254
# Furthermore, if spack has been updated, we need to make sure we link to the correct vX config directory in spack-config.
@@ -266,7 +271,36 @@ jobs:
266271
267272
ln --symbolic --relative --verbose --force ${{ steps.env.outputs.SPACK_ROOT }}/../spack-config/${spack_branch}/ci-runner/* ${{ steps.env.outputs.SPACK_ROOT }}/etc/spack/
268273
269-
- name: Spack - Initial Enable + Compiler Load
274+
- name: Spack - Initial Enable
275+
run: . ${{ steps.env.outputs.SPACK_ROOT }}/share/spack/setup-env.sh
276+
277+
- name: Spack - Get spack-packages repo locations
278+
id: spack-packages-locations
279+
run: |
280+
. ${{ steps.env.outputs.SPACK_ROOT }}/share/spack/setup-env.sh
281+
282+
echo "builtin=$(spack location --repo builtin)" >> $GITHUB_OUTPUT
283+
echo "access-spack-packages=$(spack location --repo access.nri)" >> $GITHUB_OUTPUT
284+
285+
- name: Update - builtin spack-package version
286+
id: builtin-spack-packages-update
287+
uses: access-nri/build-ci/.github/actions/spack-checkout-updated-ref@v2
288+
with:
289+
spack-packages-repository-name: builtin
290+
spack-packages-repository-path: ${{ steps.spack-packages-locations.outputs.builtin }}
291+
ref: ${{ inputs.builtin-spack-packages-ref }}
292+
spack-instance-root-path: ${{ steps.env.outputs.SPACK_ROOT }}
293+
294+
- name: Update - access-spack-package version
295+
id: access-spack-packages-update
296+
uses: access-nri/build-ci/.github/actions/spack-checkout-updated-ref@v2
297+
with:
298+
spack-packages-repository-name: access_spack_packages
299+
spack-packages-repository-path: ${{ steps.spack-packages-locations.outputs.access-spack-packages }}
300+
ref: ${{ inputs.access-spack-packages-ref }}
301+
spack-instance-root-path: ${{ steps.env.outputs.SPACK_ROOT }}
302+
303+
- name: Spack - Compiler Load
270304
run: |
271305
. ${{ steps.env.outputs.SPACK_ROOT }}/share/spack/setup-env.sh
272306
@@ -469,7 +503,8 @@ jobs:
469503
"spack_compiler_manifest_path": "${{ inputs.spack-compiler-manifest-path }}",
470504
"ref": "${{ inputs.ref }}",
471505
"spack_config_ref": "${{ inputs.spack-config-ref }}",
472-
"spack_packages_ref": "${{ inputs.spack-packages-ref }}",
506+
"builtin_spack_packages_ref": "${{ inputs.builtin-spack-packages-ref }}",
507+
"access_spack_packages_ref": "${{ inputs.access-spack-packages-ref }}",
473508
"spack_ref": "${{ inputs.spack-ref }}",
474509
"pytest_test_markers": "${{ inputs.pytest-test-markers }}",
475510
"allow_ssh_into_spack_install": "${{ inputs.allow-ssh-into-spack-install }}",
@@ -480,7 +515,8 @@ jobs:
480515
"spec_concretization_graph": $spec,
481516
"spack_sha": "${{ steps.spack-update.outputs.sha }}",
482517
"spack_config_sha": "${{ steps.spack-config-update.outputs.sha }}",
483-
"spack_packages_sha": "${{ steps.spack-packages-update.outputs.sha }}",
518+
"builtin_spack_packages_sha": "${{ steps.builtin-spack-packages-update.outputs.sha }}",
519+
"access_spack_packages_sha": "${{ steps.access-spack-packages-update.outputs.sha }}",
484520
"sha": "${{ steps.checkout.outputs.commit }}",
485521
"container_id": "${{ steps.env.outputs.container-id }}",
486522
"short_container_id": "${{ steps.env.outputs.short-container-id }}",

0 commit comments

Comments
 (0)