Skip to content

Commit 4bd9362

Browse files
authored
Merge pull request #2 from ACCESS-NRI/1-initial-spack-yaml
Initial `spack.yaml`
2 parents 793811b + 4b39587 commit 4bd9362

File tree

3 files changed

+51
-105
lines changed

3 files changed

+51
-105
lines changed

README.md

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,3 @@
1-
# model-deployment-template
1+
# ACCESS-RAM3
22

3-
A template repository for the deployment of `spack`-based models.
4-
5-
> [!NOTE]
6-
> Feel free to replace this README with information on the model once the TODOs have been ticked off.
7-
8-
## Things TODO to get your model deployed
9-
10-
### Settings
11-
12-
#### Repository Settings
13-
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.
15-
16-
#### Repository Secrets/Variables
17-
18-
There is only one variable in `vars` that needs to be set:
19-
20-
* `NAME`: which corresponds to the model name - which is usually the repository name.
21-
22-
#### Environment Secrets/Variables
23-
24-
GitHub Environments are sets of variables and secrets that are used specifically to deploy software, and hence have more security requirements for their use.
25-
26-
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).
27-
28-
In order to deploy to a given deployment target:
29-
30-
* Environments with the name of the deployment target must be created _in this repository_ and have the associated secrets/variables set ([see below](#secrets))
31-
* 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`.
32-
33-
When setting the environment up, remember to require sign off by a member of ACCESS-NRI when deploying as a `Release`.
34-
35-
Regarding the secrets and variables that must be created:
36-
37-
##### Secrets
38-
39-
* `HOST`: The deployment location SSH Host
40-
* `HOST_DATA`: The deployment location SSH Host for data transfer (may be the same as `HOST`)
41-
* `SSH_KEY`: A SSH Key that allows access to the above `HOST`/`HOST_DATA`
42-
* `USER`: A Username to login to the above `HOST`/`HOST_DATA`
43-
44-
##### Variables
45-
46-
* `DEPLOYMENT_TARGET`: Name of the deployment target for logging purposes
47-
* `SPACK_LOCATION`: Path to the `spack` installation on the deployment target that will be used to install the model
48-
* `SPACK_PACKAGES_LOCATION`: Path to the [ACCESS-NRI/spack-packages](https://github.com/ACCESS-NRI/spack-packages) repository on the deployment target that will be used to source package definitions
49-
* `SPACK_CONFIG_LOCATION`: Path to the [ACCESS-NRI/spack-config](https://github.com/ACCESS-NRI/spack-config) repository on the deployment target that will be used to source default spack configuration
50-
* `SPACK_RELEASE_LOCATION`: Path to a directory that will hold the created model package binaries
51-
* `SPACK_YAML_LOCATION`: Path to a directory that will contain the `spack.yaml` from this repository during deployment
52-
* (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`).
53-
54-
### File Modifications
55-
56-
#### In `.github/workflows`
57-
58-
* Reminder that these workflows use `vars.NAME` (as well as inherit the above environment secrets) and hence these must be set.
59-
* 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.
60-
61-
#### In `config/versions.json`
62-
63-
* `.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`.
64-
* `.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.
65-
* `.spack-config` should also have a CalVer-compliant tag as the version. See the [associated repo](https://github.com/ACCESS-NRI/spack-config/tags) for a list of available tags.
66-
67-
#### In `spack.yaml`
68-
69-
There are a few TODOs for the `spack.yaml`:
70-
71-
* `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).
72-
* `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.
73-
* `spack.packages.all`: Can set configuration for all packages. For example, the compiler used, or the target architecture.
74-
* `spack.modules.default.tcl.include`: List of package names that will be explicitly included and available to `module load`.
75-
* `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.`.
3+
The ACCESS Regional Nesting Suite repository.

config/versions.json

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

spack.yaml

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,45 @@
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-
7+
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.0'
13+
14+
# Indirect dependencies
15+
eccodes:
16+
require:
17+
- '@2.34.0'
18+
19+
netcdf-c:
20+
require:
21+
- '@4.9.2'
22+
23+
netcdf-fortran:
24+
require:
25+
- '@4.5.2'
26+
27+
fcm:
28+
require:
29+
- '@2021.05.0'
30+
# TODO: Generalize this Gadi-specific variant for spack.yaml
31+
- 'site=nci-gadi'
32+
33+
gcom:
34+
require:
35+
- '@7.8'
36+
37+
openmpi:
38+
require:
39+
- '@4.1.5'
1740

1841
# Specifications that apply to all packages
1942
all:
20-
# TODO: Specify compiler/targets for all packages
21-
# compiler: [[email protected].5.281]
22-
# target: [x86_64]
43+
require:
44+
- '%[email protected].3.199'
45+
- target=x86_64_v4
2346
view: true
2447
concretizer:
2548
unify: true
@@ -33,10 +56,9 @@ spack:
3356
tcl:
3457
hash_length: 0
3558
include:
36-
# Explicitly, which packages are accessible as modules
37-
# TODO: Add packages that will be included as modules
38-
# - MODEL
39-
hide_implicits: true
59+
- access-ram3
60+
- um
61+
exclude_implicits: true
4062
all:
4163
autoload: direct
4264
conflict:
@@ -45,16 +67,12 @@ spack:
4567
set:
4668
'SPACK_{name}_ROOT': '{prefix}'
4769
projections:
48-
# TODO: Add explicit projections for modules that will be found with `module load`.
49-
# Naming scheme for the above included modules.
50-
# These projection versions must be the same as the
51-
# `spack.packages.*.require[0]` version but without the `@git.`.
52-
# Ex. `require` version `@git.2024.04.21` -> projection `2024.04.21`.
5370
all: '{name}/{version}'
54-
# MODEL: '{name}/VERSION'
55-
# config:
56-
# overridden spack configurations, if needed
57-
# mirrors:
58-
# overridden spack package tarball directories, if needed
59-
# repos:
60-
# overridden repo sources, if needed
71+
access-ram3: '{name}/2024.08.0'
72+
um: '{name}/13.0'
73+
config:
74+
install_tree:
75+
root: $spack/../restricted/ukmo/release
76+
source_cache: $spack/../restricted/ukmo/source_cache
77+
build_stage:
78+
- $TMPDIR/restricted/spack-stage

0 commit comments

Comments
 (0)