Skip to content

Commit 15b7ccc

Browse files
CodeGatbschroeterpenguianccarougeWhyborn
committed
Initial deployment (#6)
* Add initial spack.yaml based on ACCESS-NRI/ACCESS-rAM3@8206dad * Update compiler to intel 2021.10.0 * Update versions.json * Update spack.yaml * Updated README * Updated cd.yml to include `permissions.pull-requests:write` --------- Co-authored-by: Ben Schroeter <benjschroeter@gmail.com> Co-authored-by: Paul Leopardi <paul.leopardi@anu.edu.au> Co-authored-by: Claire Carouge <claire.carouge@anu.edu.au> Co-authored-by: Claire Carouge <ccarouge@users.noreply.github.com> Co-authored-by: Lachlan Whyborn <lachlan.s.whyborn@gmail.com>
1 parent 5a11db8 commit 15b7ccc

4 files changed

Lines changed: 72 additions & 79 deletions

File tree

.github/workflows/cd.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ jobs:
1818
config-packages-schema-version: 1-0-0
1919
permissions:
2020
contents: write
21+
# Required because later workflows also handle on.pull_request trigger
22+
pull-requests: write
2123
secrets: inherit

README.md

Lines changed: 28 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,45 @@
1-
# model-deployment-template
1+
# ACCESS-AM3
22

3-
A template repository for the deployment of `spack`-based models.
3+
## About the model
4+
The ACCESS-AM model is an atmosphere-land climate model for the biogeophysics and biogeochemistry. ACCESS-AM3 forms part of the ACCESS-ESM3 Earth system model.
45

5-
> [!NOTE]
6-
> Feel free to replace this README with information on the model once the TODOs have been ticked off.
6+
## Support
77

8-
## Things TODO to get your model deployed
8+
Any questions about ACCESS-NRI releases of ACCESS-AM3 should be done through the [ACCESS-Hive Forum](https://forum.access-hive.org.au/). See the [ACCESS Help and Support topic](https://forum.access-hive.org.au/t/access-help-and-support/908) for details on how to do this.
99

10-
### Settings
10+
### Build
1111

12-
#### Repository Settings
12+
ACCESS-NRI is using [spack](https://spack.io), a build from source package manager designed for use with high performance computing. This repository contains a [spack environment](https://spack.readthedocs.io/en/latest/environments.html) definition file ([`spack.yaml`](https://github.com/ACCESS-NRI/ACCESS-AM3/blob/main/spack.yaml)) that defines all the essential components of the ACCESS-AM3 model, including exact versions.
1313

14-
Branch protections should be set up on `main` and the special `backport/*.*` branches, which are used for backporting of fixes to major releases (the `YEAR.MONTH` portion of the `YEAR.MONTH.MINOR` version) of models.
14+
Spack automatically builds all the components and their dependencies, producing model component executables. Spack already contains support for compiling thousands of common software packages. Spack packages for the components in ACCESS-AM3 are defined in the [spack packages repository](https://github.com/ACCESS-NRI/spack_packages/).
1515

16-
#### Repository Secrets/Variables
16+
ACCESS-AM3 is built and deployed automatically to `gadi` on NCI (see below). However it is possible to use spack to compile the model using the `spack.yaml` environment file in this repository. To do so follow the [instructions on the ACCESS-Hive Forum for modifying and building an ACCESS model's source code](https://docs.access-hive.org.au/models/run-a-model/build_a_model/).
1717

18-
There are a few secrets and variables that must be set at the repository level.
18+
Then clone this repository and run the following commands on `gadi`:
1919

20-
##### Repository Secrets
20+
```bash
21+
spack env create access-am3 spack.yaml
22+
spack env activate -p access-am3
23+
spack install
24+
```
2125

22-
* `BUILD_DB_CONNECTION_STR`: A postgresql connection url to the release provenance database
23-
* `GH_COMMIT_CHECK_TOKEN`: GitHub Token that allows workflows to run based on workflow-authored commits (in the case where a user uses `!bump` commands in PRs that bumps the version of the model)
26+
to create a spack environment called `access-am3` and build all the ACCESS-AM3 components, the locations of which can be found using `spack find --paths`.
2427

25-
##### Repository Variables
28+
### Deployment
2629

27-
* `BUILD_DB_PACKAGES`: List of `spack` packages that are model components that will be uploaded to the release provenance database
28-
* `NAME`: which corresponds to the model name - which is usually the repository name
29-
* `CONFIG_VERSIONS_SCHEMA_VERSION`: Version of the [`config/versions.json` schema](https://github.com/ACCESS-NRI/schema/tree/main/au.org.access-nri/model/deployment/config/versions) used in this repository
30-
* `SPACK_YAML_SCHEMA_VERSION`: Version of the [ACCESS-NRI-style `spack.yaml` schema](https://github.com/ACCESS-NRI/schema/tree/main/au.org.access-nri/model/spack/environment/deployment) used in this repository
30+
ACCESS-AM3 is deployed automatically when a new version of the [`spack.yaml`](https://github.com/ACCESS-NRI/ACCESS-AM3/blob/main/spack.yaml) file is committed to `main` or a dedicated `backport/VERSION` branch. All the ACCESS-AM3 components are built using `spack` on `gadi` and installed under the [`vk83`](https://my.nci.org.au/mancini/project/vk83) project in `/g/data/vk83`. It is necessary to be a member of [`vk83`](https://my.nci.org.au/mancini/project/vk83/join) project to use ACCESS-NRI deployments of ACCESS-AM3.
3131

32-
#### Environment Secrets/Variables
32+
The deployment process also creates a GitHub release with the same tag. All releases are available under the [Releases page](https://github.com/ACCESS-NRI/ACCESS-AM3/releases). Each release has a changelog and meta-data with detailed information about the build and deployment, including:
3333

34-
GitHub Environments are sets of variables and secrets that are used specifically to deploy software, and hence have more security requirements for their use.
34+
- paths on `gadi` to all executables built in the deployment process (`spack.location`)
35+
- a `spack.lock` file, which is a complete build provenance document, listing all the components that were built and their dependencies, versions, compiler version, build flags and build architecture
36+
- the environment `spack.yaml` file used for deployment
3537

36-
Currently, we have two Environments per deployment target - one for `Release` and one for `Prerelease`. Our current list of deployment targets and Environments can be found in this [deployment configuration file in `build-cd`](https://github.com/ACCESS-NRI/build-cd/blob/main/config/deployment-environment.json).
38+
Additionally the deployment creates environment modulefiles, the [standard method for deploying software on `gadi`](https://opus.nci.org.au/display/Help/Environment+Modules). To view available ACCESS-AM3 versions on `gadi`:
3739

38-
In order to deploy to a given deployment target:
40+
```bash
41+
module use /g/data/vk83/modules
42+
module avail access-am3
43+
```
3944

40-
* Environments with the name of the deployment target must be created _in this repository_ and have the associated secrets/variables set ([see below](#environment-secrets))
41-
* There must be a `Prerelease` Environment associated with the `Release` Environment. For example, if we are deploying to `SUPERCOMPUTER`, we require Environments with the names `SUPERCOMPUTER`, `SUPERCOMPUTER Prerelease`.
42-
43-
When setting the environment up, remember to require sign off by a member of ACCESS-NRI when deploying as a `Release`.
44-
45-
Regarding the secrets and variables that must be created:
46-
47-
##### Environment Secrets
48-
49-
* `HOST`: The deployment location SSH Host
50-
* `HOST_DATA`: The deployment location SSH Host for data transfer (may be the same as `HOST`)
51-
* `SSH_KEY`: A SSH Key that allows access to the above `HOST`/`HOST_DATA`
52-
* `USER`: A Username to login to the above `HOST`/`HOST_DATA`
53-
54-
##### Environment Variables
55-
56-
* `DEPLOYMENT_TARGET`: Name of the deployment target for logging purposes
57-
* `SPACK_INSTALLS_ROOT_LOCATION`: Path to the directory that contains all versions of a deployment of `spack`. For example, if `/some/apps/spack` is the `SPACK_INSTALLS_ROOT_LOCATION`, that directory will contain directories like `0.20`, `0.21`, `0.22`, which in turn contain an install of `spack`, `spack-packages` and `spack-config`
58-
* `SPACK_YAML_LOCATION`: Path to a directory that will contain the `spack.yaml` from this repository during deployment
59-
* (Optional) `SPACK_INSTALL_PARALLEL_JOBS`: Explicit number of parallel jobs for the installation of the given model. Must be either of the form `--jobs N` or unset (for the default `--jobs 16`).
60-
61-
### File Modifications
62-
63-
#### In `.github/workflows`
64-
65-
* Reminder that these workflows use `vars.NAME` (as well as inherit the above environment secrets) and hence these must be set.
66-
* If the name of the root SBD for the model (in [`spack-packages`](https://github.com/ACCESS-NRI/spack-packages/tree/main/packages)) is different from the model name (for example, `ACCESS-ESM1.5`s root SBD is `access-esm1p5`), you must uncomment and set the `jobs.[pr-ci|pr-comment].with.root-sbd` line to the appropriate SBD name.
67-
68-
#### In `config/versions.json`
69-
70-
* `.spack` must be given a version. For example, it will clone the associated `releases/VERSION` branch of `ACCESS-NRI/spack` if you give it `VERSION`.
71-
* `.spack-packages` should also have a CalVer-compliant tag as the version. See the [associated repo](https://github.com/ACCESS-NRI/spack-packages/tags) for a list of available tags.
72-
73-
#### In `spack.yaml`
74-
75-
There are a few TODOs for the `spack.yaml`:
76-
77-
* `spack.specs`: Set the root SBD as the only element of `spack.specs`. This must also have an `@git.YEAR.MONTH.MINOR` version as it is the version of the entire deployment (and indeed will be a tag in this repository).
78-
* `spack.packages.*`: In this section, you can specify the versions and variants of dependencies. Note that the first element of the `spack.packages.*.require` must be only a version. Variants and other configuration can be done on subsequent lines.
79-
* `spack.packages.all`: Can set configuration for all packages. For example, the compiler used, or the target architecture.
80-
* `spack.modules.default.tcl.include`: List of package names that will be explicitly included and available to `module load`.
81-
* `spack.modules.default.tcl.projections`: For included modules, you must set the name of the module to be the same as the `spack.packages.*.require[0]` version, without the `@git.`.
45+
For users of ACCESS-AM3 model configurations released by ACCESS-NRI, the exact location of the ACCESS-AM3 model executables is not required. Model configurations will be updated with new model components when necessary.

config/versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://github.com/ACCESS-NRI/schema/blob/main/au.org.access-nri/model/deployment/config/versions/3-0-0.json",
2+
"$schema": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/deployment/config/versions/3-0-0.json",
33
"spack": "0.22",
4-
"spack-packages": "SOME_SPECIFIC_TAG"
4+
"spack-packages": "2025.09.004"
55
}

spack.yaml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,50 @@
44
# configuration settings.
55
spack:
66
specs:
7-
# TODO: Replace the MODEL and VERSION.
8-
# The root SBD for the model and overall version of the deployment:
9-
# - MODEL@git.VERSION
7+
- access-am3@git.2025.10.000
108
packages:
11-
# TODO: Specify versions and variants of dependencies where required
12-
# Specification of dependency versions and variants goes here.
13-
# CI/CD requires that the first element of the require is only a version:
14-
# openmpi:
15-
# require:
16-
# - '@4.0.2'
9+
# Direct dependencies
10+
um:
11+
require:
12+
- '@13.1'
13+
- model="vn13p1-am"
14+
- jules_ref="2025.08.0"
15+
- um_ref="2025.08.0"
16+
17+
# Indirect dependencies
18+
netcdf-c:
19+
require:
20+
- '@4.9.2'
21+
22+
netcdf-fortran:
23+
require:
24+
- '@4.5.2'
25+
26+
fcm:
27+
require:
28+
- '@2021.05.0'
29+
# TODO: Generalize this Gadi-specific variant for spack.yaml
30+
- 'site=nci-gadi'
31+
32+
gcom:
33+
require:
34+
- '@7.9'
35+
36+
openmpi:
37+
require:
38+
- '@4.1.7'
1739

1840
# Specifications that apply to all packages
1941
all:
20-
# TODO: Specify compiler/targets for all packages
21-
# require:
22-
# - '%intel@19.0.5.281'
23-
# - 'target=x86_64'
42+
require:
43+
- '%intel@2021.10.0'
44+
- target=x86_64_v4
2445
view: true
2546
concretizer:
2647
unify: true
48+
config:
49+
install_tree:
50+
root: $spack/../restricted/ukmo/release
51+
source_cache: $spack/../restricted/ukmo/source_cache
52+
build_stage:
53+
- $TMPDIR/restricted/spack-stage

0 commit comments

Comments
 (0)