From a612e6c4fbf77b75bc39580819e0e20b188a96a4 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 11:15:25 +1000 Subject: [PATCH 1/9] Remove Build CI 1.0 workflow --- .github/workflows/model-build-test-ci.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .github/workflows/model-build-test-ci.yml diff --git a/.github/workflows/model-build-test-ci.yml b/.github/workflows/model-build-test-ci.yml deleted file mode 100644 index eda2217..0000000 --- a/.github/workflows/model-build-test-ci.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Test model build - -on: - workflow_dispatch: - pull_request: - push: - branches: - - "master" - -jobs: - build: - name: Build ${{ github.repository }} via spack - uses: access-nri/build-ci/.github/workflows/model-1-build.yml@main - permissions: - packages: read From 33e76f109a69ccddba951656d0d40ba22a59e037 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 11:33:25 +1000 Subject: [PATCH 2/9] Add initial Build-CI 2.0 worklow and mainfests --- .github/build-ci/data/standard.json | 5 +++ .../manifests/intel-access-om2.spack.yaml.j2 | 39 +++++++++++++++++++ .../intel-libaccessom2.spack.yaml.j2 | 26 +++++++++++++ .github/workflows/ci.yml | 39 +++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 .github/build-ci/data/standard.json create mode 100644 .github/build-ci/manifests/intel-access-om2.spack.yaml.j2 create mode 100644 .github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 create mode 100644 .github/workflows/ci.yml diff --git a/.github/build-ci/data/standard.json b/.github/build-ci/data/standard.json new file mode 100644 index 0000000..2367aa0 --- /dev/null +++ b/.github/build-ci/data/standard.json @@ -0,0 +1,5 @@ +{ + "gcc_compiler": "gcc@13.2.0", + "intel_compiler": "intel@19.0.5.281", + "target": "x86_64" +} diff --git a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 new file mode 100644 index 0000000..2c69977 --- /dev/null +++ b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 @@ -0,0 +1,39 @@ +# Building libaccess-om2 in the context of the ACCESS-OM2 model +# Using the ACCESS-ESM1.6 spack.yaml from +# https://github.com/ACCESS-NRI/ACCESS-OM2/blob/d0b802422e172e9a4119055b77085f4c6c88be6e/spack.yaml +spack: + # add package specs to the `specs` list + specs: + - access-om2@git.2024.03.0=latest + packages: + cice5: + require: + - '@git.2023.10.19=access-om2' + mom5: + require: + - '@git.2023.11.09=access-om2' + libaccessom2: + require: + - '{{ ref }}=access-om2' + oasis3-mct: + require: + - '@git.2023.11.09=access-om2' + netcdf-c: + require: + - '@4.7.4' + netcdf-fortran: + require: + - '@4.5.2' + parallelio: + require: + - '@2.5.2' + openmpi: + require: + - '@4.0.2' + all: + require: + - '%intel@19.0.5.281' + - 'target=x86_64' + view: true + concretizer: + unify: true \ No newline at end of file diff --git a/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 b/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 new file mode 100644 index 0000000..50a180f --- /dev/null +++ b/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 @@ -0,0 +1,26 @@ +# Building OASIS3-mct stand-alone using access-esm1.5 spack version +spack: + specs: + - 'libaccessom2@git.{{ ref }}=access-om2' + packages: + oasis3-mct: + require: + - '@git.2023.11.09=access-om2' + openmpi: + require: + - '@4.0.2' + netcdf-c: + require: + - '@4.7.4' + netcdf-fortran: + require: + - '@4.5.2' + parallelio: + require: + - '@2.5.2' + all: + require: + - '%{{ intel_compiler }} target={{ target }}' + concretizer: + unify: false + view: false \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..291304f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: Build +on: + pull_request: + push: + branches: + - main +jobs: + pre-ci: + name: Pre-CI + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + + - name: Set up matrix + id: set-matrix + # Find all relevant files under .github/build-ci/manifests + # then output them as a JSON array (minus the last comma) + run: | + files=$(find .github/build-ci/manifests/ -iname '*.j2' -printf '"%p",') + echo "matrix=[${files%,}]" >> $GITHUB_OUTPUT + + ci: + name: CI + needs: pre-ci + strategy: + fail-fast: false + max-parallel: 5 + matrix: + file: ${{ fromJson(needs.pre-ci.outputs.matrix) }} + uses: access-nri/build-ci/.github/workflows/ci.yml@v2 + with: + spack-manifest-path: ${{ matrix.file }} + allow-ssh-into-spack-install: false # If true, PR author must ssh into instance to complete job + spack-manifest-data-path: .github/build-ci/data/standard.json + # spack-packages-ref: main + # spack-config-ref: main + # spack-ref: releases/v0.22 \ No newline at end of file From d2979fa837dac1154bc534236e967c29ffae6532 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 11:54:56 +1000 Subject: [PATCH 3/9] Fix git version ref --- .github/build-ci/manifests/intel-access-om2.spack.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 index 2c69977..ebaecdf 100644 --- a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 +++ b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 @@ -14,7 +14,7 @@ spack: - '@git.2023.11.09=access-om2' libaccessom2: require: - - '{{ ref }}=access-om2' + - '@git.{{ ref }}=access-om2' oasis3-mct: require: - '@git.2023.11.09=access-om2' From c74eb19ac9a41f0bf447a1b32f5a2fb4fde6cb81 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 12:09:54 +1000 Subject: [PATCH 4/9] Removed gitmodules. Modified gitignore to stop it picking up build-ci dir. --- .gitignore | 1 - .gitmodules | 0 2 files changed, 1 deletion(-) delete mode 100644 .gitmodules diff --git a/.gitignore b/.gitignore index 7170d46..e75fed9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ __pycache__ *.pyc .swo .cache -build* building-errors.log debug.root.01 debug.01.000000 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 From 80b1fb117a0ca29e4d89259bd18c6089a788e0be Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 12:10:41 +1000 Subject: [PATCH 5/9] Changed to the default intel compiler available in upstream CI image --- .github/build-ci/data/standard.json | 2 +- .github/build-ci/manifests/intel-access-om2.spack.yaml.j2 | 4 ++-- .github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/build-ci/data/standard.json b/.github/build-ci/data/standard.json index 2367aa0..b9251d4 100644 --- a/.github/build-ci/data/standard.json +++ b/.github/build-ci/data/standard.json @@ -1,5 +1,5 @@ { "gcc_compiler": "gcc@13.2.0", - "intel_compiler": "intel@19.0.5.281", + "intel_compiler": "intel@21.10.0", "target": "x86_64" } diff --git a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 index ebaecdf..941424d 100644 --- a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 +++ b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 @@ -32,8 +32,8 @@ spack: - '@4.0.2' all: require: - - '%intel@19.0.5.281' - - 'target=x86_64' + - '%{{ intel_compiler }}' + - 'target={{ target }}' view: true concretizer: unify: true \ No newline at end of file diff --git a/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 b/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 index 50a180f..aefab88 100644 --- a/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 +++ b/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 @@ -20,7 +20,8 @@ spack: - '@2.5.2' all: require: - - '%{{ intel_compiler }} target={{ target }}' + - '%{{ intel_compiler }}' + - 'target={{ target }}' concretizer: unify: false view: false \ No newline at end of file From 69daf7ce9b91f4d7b0c436f0676073916fefd8fa Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 12:28:17 +1000 Subject: [PATCH 6/9] Add gcc-runtime to manifests --- .github/build-ci/manifests/intel-access-om2.spack.yaml.j2 | 3 +++ .github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 index 941424d..09af71f 100644 --- a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 +++ b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 @@ -30,6 +30,9 @@ spack: openmpi: require: - '@4.0.2' + gcc-runtime: + require: + - '%gcc target={{ target }}' all: require: - '%{{ intel_compiler }}' diff --git a/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 b/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 index aefab88..897f108 100644 --- a/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 +++ b/.github/build-ci/manifests/intel-libaccessom2.spack.yaml.j2 @@ -18,6 +18,9 @@ spack: parallelio: require: - '@2.5.2' + gcc-runtime: + require: + - '%gcc target={{ target }}' all: require: - '%{{ intel_compiler }}' From 9e2d5e2ded60267363a94ba6c3783a932769530a Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 13:30:48 +1000 Subject: [PATCH 7/9] Change view and concretizer values Co-authored-by: Tommy Gatti --- .github/build-ci/manifests/intel-access-om2.spack.yaml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 index 09af71f..e1fdebc 100644 --- a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 +++ b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 @@ -37,6 +37,6 @@ spack: require: - '%{{ intel_compiler }}' - 'target={{ target }}' - view: true + view: false concretizer: - unify: true \ No newline at end of file + unify: false \ No newline at end of file From 6a2b111db1f48b11438e453250664df6813a10b0 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 13:32:04 +1000 Subject: [PATCH 8/9] Fix compiler version error. Co-authored-by: Tommy Gatti --- .github/build-ci/data/standard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/build-ci/data/standard.json b/.github/build-ci/data/standard.json index b9251d4..616c3c3 100644 --- a/.github/build-ci/data/standard.json +++ b/.github/build-ci/data/standard.json @@ -1,5 +1,5 @@ { "gcc_compiler": "gcc@13.2.0", - "intel_compiler": "intel@21.10.0", + "intel_compiler": "intel@2021.10.0", "target": "x86_64" } From 5dd790fb0e9449bcc0310ea5219ff2bf42ea82e2 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Tue, 5 Aug 2025 14:36:44 +1000 Subject: [PATCH 9/9] Remove ACCESS-OM2 build CI target --- .../manifests/intel-access-om2.spack.yaml.j2 | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/build-ci/manifests/intel-access-om2.spack.yaml.j2 diff --git a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 b/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 deleted file mode 100644 index e1fdebc..0000000 --- a/.github/build-ci/manifests/intel-access-om2.spack.yaml.j2 +++ /dev/null @@ -1,42 +0,0 @@ -# Building libaccess-om2 in the context of the ACCESS-OM2 model -# Using the ACCESS-ESM1.6 spack.yaml from -# https://github.com/ACCESS-NRI/ACCESS-OM2/blob/d0b802422e172e9a4119055b77085f4c6c88be6e/spack.yaml -spack: - # add package specs to the `specs` list - specs: - - access-om2@git.2024.03.0=latest - packages: - cice5: - require: - - '@git.2023.10.19=access-om2' - mom5: - require: - - '@git.2023.11.09=access-om2' - libaccessom2: - require: - - '@git.{{ ref }}=access-om2' - oasis3-mct: - require: - - '@git.2023.11.09=access-om2' - netcdf-c: - require: - - '@4.7.4' - netcdf-fortran: - require: - - '@4.5.2' - parallelio: - require: - - '@2.5.2' - openmpi: - require: - - '@4.0.2' - gcc-runtime: - require: - - '%gcc target={{ target }}' - all: - require: - - '%{{ intel_compiler }}' - - 'target={{ target }}' - view: false - concretizer: - unify: false \ No newline at end of file