Spack v1.1 Upgrade

Background

Spack has been updated to version 1.1.1. The first 1.0 release was the first stable API.

As part of this transition the builtin spack packages are no longer included in the spack repo. It has been split out into a separate spack-packages repository with an accompanying spack-packages API that is versioned independently from spack.

As a result the ACCESS-NRI spack-packages repo was renamed access-spack-packages to avoid any possible confusion with the upstream spack-packages repo.

Transition to the latest spack package API required modifications to all spack packages. These changes were accumulated in the api-v2 branch, which was then made the default branch for the repo. The older ACCESS spack packages (the previous main branch) was moved to api-v1.

Migration Plan

The migration to v1.1.1 was tracked in this issue:

Details of Changes

access-spack-packages

  • Ported all existing packages to API V2 in the api-v2 branch.
  • Updated default branch to api-v2, so pull requests now default to api-v2.
  • Created api-v1 branch from current main.
  • Spack Package Recipes (SPRs) reside in a sub-directory of spack_repo/access/nri/packages/.

Personal Spack installs

If you previously followed these instructions to set up Spack v0.22, you will need to repeat the setup process below to install Spack v1.1.

Set up Spack for building ACCESS models

build-ci (Model Component Testing Infra)

  • spack v1.1.1 requires build-ci@v3
    • If you want to test using spack < v1, you need to use build-ci@v2
  • You can now specify versions for both the builtin (spack/spack-packages) and our own (access-spack-packages) repository, through the inputs.builtin-spack-packages-ref and access-spack-packages-ref. They will be set to sensible defaults otherwise.
  • The compilers are now part of toolchains. Rather than specifying the compiler package in spack.packages.all.require (eg. %intel@2021.10.0, we specify a toolchain. That looks like %access_COMPILER (eg. %access_intel/%access_gcc/%access_oneapi).

build-cd (Model Deployment Infra)

  • spack v1.1.1 requires build-cd@v8
    • If you want to deploy to spack < v1, you need to use build-cd@v7 or lower
  • The manifests look a bit different compared to the spack < v1 manifests:
    • The deployment name and version are specified in _name and _version reserved definitions, rather than in the spack.specs section. You no longer need to use @git.VERSION on the root spec.
    • Rather than specifying the compiler and version in spack.packages.all.require, we specify it as part of the spack.packages.LANGUAGE.require section, where language is one of c|cxx|fortran.
    • For MDRs with restricted packages, there is no longer a spack.config section specifying paths, etc. It is now taken care of in the config/versions.jsons custom-spack-scopes field.