Skip to content

Commit 2530078

Browse files
authored
Dockerfile additions to workflow (#162)
* compilers.*: Added package-version field to data and schema * dep-image-*.yml: Added spack-config-version input, workflow now uses compiler-package-version * model-1-build.yml: Now uses spack-enable.bash instead of default setup-env.sh * Moved compilers.json fields in line with Dockerfile.base-spack ARGs * Updated variable names * Using 2021.2.0 compiler version
1 parent c071b11 commit 2530078

File tree

5 files changed

+36
-16
lines changed

5 files changed

+36
-16
lines changed

.github/workflows/dep-image-1-start.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ on:
77
required: true
88
type: string
99
default: "main"
10-
description: "Either a git tag or branch name for the ACCESS-NRI/spack-packages repository, which defaults to the main branch"
10+
description: "Either a git tag or branch name for the ACCESS-NRI/spack-packages repository"
11+
spack-config-version:
12+
required: true
13+
type: string
14+
default: "main"
15+
description: "Either a git tag or branch name for the ACCESS-NRI/spack-config repository"
1116
model:
1217
required: true
1318
type: string
@@ -50,10 +55,12 @@ jobs:
5055
compiler: ${{ fromJson(needs.generate-matrix.outputs.compilers) }}
5156
uses: access-nri/build-ci/.github/workflows/dep-image-2-build.yml@main
5257
with:
53-
compiler-name: ${{ matrix.compiler.name }}
54-
compiler-package: ${{ matrix.compiler.package }}
55-
compiler-version: ${{ matrix.compiler.version }}
58+
compiler-name: ${{ matrix.compiler.COMPILER_NAME }}
59+
compiler-version: ${{ matrix.compiler.COMPILER_VERSION }}
60+
compiler-pkg-name: ${{ matrix.compiler.COMPILER_PKG_NAME }}
61+
compiler-pkg-version: ${{ matrix.compiler.COMPILER_PKG_VERSION }}
5662
spack-packages-version: ${{ inputs.spack-packages-version }}
63+
spack-config-version: ${{ inputs.spack-config-version }}
5764
models: ${{ needs.generate-matrix.outputs.models }}
5865
permissions:
5966
packages: write

.github/workflows/dep-image-2-build.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ on:
55
spack-packages-version:
66
description: the tag/branch of the access-nri/spack-packages repo to use
77
type: string
8+
spack-config-version:
9+
description: the tag/branch of the access-nri/spack-config repo to use
10+
type: string
811
compiler-name:
912
description: the short name of the compiler
1013
type: string
11-
compiler-package:
14+
compiler-version:
15+
description: the spack-specific version of the compiler
16+
type: string
17+
compiler-pkg-name:
1218
description: the spack-specific package name of the compiler
1319
type: string
14-
compiler-version:
15-
description: the spack-specific package version of the compiler
20+
compiler-pkg-version:
21+
description: the spack-specific version of the compiler package
1622
type: string
23+
1724
models:
1825
description: a json-string array of all models to be built in a matrix strategy
1926
type: string
@@ -55,9 +62,11 @@ jobs:
5562
target: "ci"
5663
build-args: |
5764
SPACK_PACKAGES_REPO_VERSION=${{ inputs.spack-packages-version }}
65+
SPACK_CONFIG_REPO_VERSION=${{ inputs.spack-config-version }}
5866
COMPILER_NAME=${{ inputs.compiler-name }}
59-
COMPILER_PACKAGE=${{ inputs.compiler-package }}
6067
COMPILER_VERSION=${{ inputs.compiler-version }}
68+
COMPILER_PKG_NAME=${{ inputs.compiler-pkg-name }}
69+
COMPILER_PKG_VERSION=${{ inputs.compiler-pkg-version }}
6170
build-secrets: |
6271
S3_ACCESS_KEY_ID=${{ secrets.S3_ACCESS_KEY_ID }}
6372
S3_ACCESS_KEY_SECRET=${{ secrets.S3_ACCESS_KEY_SECRET }}

.github/workflows/model-1-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
103103
- name: Build ${{ env.PACKAGE_NAME }} via spack
104104
run: |
105-
. $SPACK_ROOT/share/spack/setup-env.sh
105+
. $SPACK_ROOT/../spack-config/spack-enable.bash
106106
spack load ${{ matrix.compiler.package }}@${{ matrix.compiler.version }}
107107
spack compiler find
108108
spack env activate ${{ env.PACKAGE_NAME }}

config/compilers.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[
22
{
3-
"name": "intel",
4-
"package": "intel-oneapi-compilers",
5-
"version": "2021.4.0"
3+
"COMPILER_NAME": "intel",
4+
"COMPILER_VERSION": "2021.2.0",
5+
"COMPILER_PKG_NAME": "intel-oneapi-compilers",
6+
"COMPILER_PKG_VERSION": "2021.2.0"
67
}
78
]

config/compilers.schema.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@
66
"items": {
77
"type": "object",
88
"properties": {
9-
"name": {
9+
"COMPILER_NAME": {
1010
"type": "string"
1111
},
12-
"package": {
12+
"COMPILER_VERSION": {
1313
"type": "string"
1414
},
15-
"version": {
15+
"COMPILER_PKG_NAME": {
16+
"type": "string"
17+
},
18+
"COMPILER_PKG_VERSION": {
1619
"type": "string"
1720
}
1821
},
19-
"required": [ "name", "package", "version" ],
22+
"required": [ "COMPILER_NAME", "COMPILER_VERSION", "COMPILER_PKG_NAME", "COMPILER_PKG_VERSION" ],
2023
"additionalProperties": false
2124
}
2225
}

0 commit comments

Comments
 (0)