This repository contains:
- Spack configuration files required by the Spack instance(s) maintained by ACCESS-NRI on Gadi and ACCESS-NRI's CI Docker image.
- The deprecated
common-v0.2xdirectory contains the required configuration files for older Spack 0.2x versions and should not be used directly. - For clarity, from Spack v1.1 onwards, we have removed symlinks in the versioned directory (e.g.
v1.1) by storing the entire file. - Read the
v1.1/include/user/include.yamlfile to understand the configuration and directory hierarchy. Filev1.1/include/admin/include.yamldescribes the configuration used by the Pre-release and Release Spack instances.
- The deprecated
-
A regular user on Gadi does not need to clone this repository. Simply follow the instructions in How to use Spack on Gadi for building ACCESS models.
-
The default
install_treeis/g/data/$PROJECT/$USER/spack/1.1/release.
The shared Spack instance contains a read-only access-spack-packages repository. If there is a need to modify a Spack Package Recipe (SPR) or choose an older version of the repository, simply add an editable Spack repository by using spack repo add. Run spack repo list to see all the enabled repositories in order of highest precedence to lowest precedence.
This option will isolate the new editable access-spack-packages repository by only adding it to a single Spack environment, after cloning the repository inside the same directory as the spack.yaml file. Other Spack environments will be completely unaffected.
After activating the Spack environment (spack env activate -p -d <path-to-spack-environment-directory>), change the working directory to the Spack environment directory:
spack cd -e
Warning
The Spack environment may be preconfigured with an editable access-spack-packages repository. This can be verified by running ls -d package-repos/access-spack-packages and confirming whether the directory already exists.
After verifying that there is no editable access-spack-packages repository, run:
git clone https://github.com/ACCESS-NRI/access-spack-packages
spack repo add access-spack-packages/spack_repo/access/nri
By running the following commands, Spack will choose to use the editable access-spack-packages repository with all Spack environments and when an environment is not activated:
cd /g/data/$PROJECT/$USER/spack/1.1
git clone https://github.com/ACCESS-NRI/access-spack-packages
spack repo add --scope=access.nri.gadi.user access-spack-packages/spack_repo/access/nri
Immediately after creating an editable access-spack-packages repository, and before changing the current directory, run:
git -C access-spack-packages switch -c <spack_packages_version> <spack_packages_version>
Run spack repo list to identify the name of the repository.
cd $(spack location --repo <name-of-repository>)
git fetch origin
git reset --hard origin/<current-branch-name>
Spack will use a pre-built upstream package rather than rebuild it. If there is a need to force the rebuilding of the source package, upstreams can be disabled by running:
mkdir -p /g/data/$PROJECT/$USER/spack/1.1/spack-user-configspack config --scope=access.nri.gadi.user edit upstreamsand insertupstreams:: {}
To re-enable upstreams, run: spack config --scope=access.nri.gadi.user edit upstreams and delete upstreams:: {}.
git clone https://github.com/ACCESS-NRI/spack.git --branch access/releases/v1.1-admin
git clone https://github.com/ACCESS-NRI/spack-config.git
. spack/share/spack/setup-env.sh
export SPACK_USER_CACHE_PATH="$SPACK_ROOT/../spack-admin-cache"
spack bootstrap now
git clone https://github.com/ACCESS-NRI/spack.git --branch access/releases/v1.1
git clone https://github.com/ACCESS-NRI/spack-config.git
. spack/share/spack/setup-env.sh
export SPACK_USER_CACHE_PATH="/g/data/$PROJECT/$USER/spack/$SPACK_VERSION/spack-user-cache"
spack repo update
Do not run spack bootstrap now as the service user because it create temporary and permanent files in /g/data/$PROJECT/$USER/spack/$SPACK_VERSION.
git -C spack fetch --all -Pp
git -C spack reset --hard origin/access/releases/v1.1
git -C spack-config pull
. spack/share/spack/setup-env.sh
spack repo update
- A user on Gadi shall NOT need to run
git cloneto use Spack. - The CI Spack architecture/configuration shall be based on the Gadi architecture/configuration to ensure additional testing coverage.
-
Gadi service user
- Responsible for Pre-release and Release
-
Gadi regular user
- Modify and build Model Deployment Repository
-
Gadi advanced user
- Modify Spack Package Recipes
-
Build-ci
- Upstream Docker image
- Runner Docker image
-
Using Spack v1.1's include.yaml mechanism allows defining tiered configuration directories with a common directory for both Gadi and CI.
-
Using Spack v1.1's include.yaml mechanism choose a
spack-configdirectory based on thehostnameof the system. -
Define an
upstreamfor the Gadi user and CI runner to speed up builds.
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ Upstream / Admin User ┊
┊ --------------------- ┊
┊ ┊
┊ $spack/.. ┊
┊ ├── access-spack-packages ┊
┊ ├── bootstrap ┊
┊ ├── cache ┊
┊ ├── environments ┊
┊ ├── intel ┊
┊ ├── release ┊
┊ ├── release/modules ┊
┊ ├── sourcecache ┊
┊ ├── spack ┊
┊ ├── spack-admin-cache ┊
┊ ├── spack-admin-config ┊
┊ ├── spack-config ┊
┊ └── spack-packages ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
|
V
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ Downstream / Regular User ┊
┊ ------------------------- ┊
┊ ┊
┊ /g/data/$PROJECT/$USER/spack/1.1 ┊
┊ ├── bootstrap ┊
┊ ├── cache ┊
┊ ├── environments ┊
┊ ├── release ┊
┊ ├── release/modules ┊
┊ ├── sourcecache ┊
┊ ├── spack-user-cache ┊
┊ └── spack-user-config ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
- Use Spack scopes to differentiate between the configuration of an
upstreamand adownstream. Scopes in highest to lowest precedence order:
- name: "access.nri.gadi.user"
path: "/g/data/$PROJECT/$USER/spack/1.1/spack-user-config"
optional: true
when: '"gadi.nci.org.au" in hostname'
╭╌╌╌╌╌╌╌╮
┊ empty ┊
╰╌╌╌╌╌╌╌╯
- name: "access.nri.ci.user"
path: "$spack/../runner/spack-user-config"
optional: true
when: '"gadi.nci.org.au" not in hostname'
╭╌╌╌╌╌╌╌╮
┊ empty ┊
╰╌╌╌╌╌╌╌╯
- name: "access.nri.gadi.downstream"
path: "$spack/../spack-config/v1.1/gadi/downstream"
when: '"gadi.nci.org.au" in hostname'
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ v1.1/gadi/downstream ┊
┊ ├── bootstrap.yaml ┊
┊ ├── config.yaml ┊
┊ ├── modules.yaml ┊
┊ └── upstreams.yaml ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
- name: "access.nri.ci.downstream"
path: "$spack/../spack-config/v1.1/ci/downstream"
when: '"gadi.nci.org.au" not in hostname'
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ v1.1/ci/downstream ┊
┊ ├── bootstrap.yaml ┊
┊ ├── config.yaml ┊
┊ ├── modules.yaml ┊
┊ └── upstreams.yaml ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
- name: "access.nri.gadi"
path: "$spack/../spack-config/v1.1/gadi"
when: '"gadi.nci.org.au" in hostname'
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ v1.1/gadi ┊
┊ ├── modules.yaml ┊
┊ └── packages.yaml ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
- name: "access.nri.defaults"
path: "$spack/../spack-config/v1.1"
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ v1.1 ┊
┊ ├── bootstrap.yaml ┊
┊ ├── concretizer.yaml ┊
┊ ├── config.yaml ┊
┊ ├── modules.yaml ┊
┊ ├── packages.yaml ┊
┊ ├── repos.yaml ┊
┊ ├── toolchains.yaml ┊
┊ └── upstreams.yaml ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
- name: "access.nri.admin"
path: "$spack/../spack-admin-config"
optional: true
╭╌╌╌╌╌╌╌╮
┊ empty ┊
╰╌╌╌╌╌╌╌╯
- name: "access.nri.gadi"
path: "$spack/../spack-config/v1.1/gadi"
when: '"gadi.nci.org.au" in hostname'
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ v1.1/gadi ┊
┊ ├── modules.yaml ┊
┊ └── packages.yaml ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
- name: "access.nri.defaults"
path: "$spack/../spack-config/v1.1"
╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┊ v1.1 ┊
┊ ├── bootstrap.yaml ┊
┊ ├── concretizer.yaml ┊
┊ ├── config.yaml ┊
┊ ├── modules.yaml ┊
┊ ├── packages.yaml ┊
┊ ├── repos.yaml ┊
┊ ├── toolchains.yaml ┊
┊ └── upstreams.yaml ┊
╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯