A template repository for the deployment of spack-based software
Note
Feel free to replace this README with information on the repository once the TODOs have been ticked off.
Relevant branch protections should be set up on main and other important branches.
There are a few secrets and variables that must be set at the repository level.
CONFIG_VERSIONS_SCHEMA_VERSION: Version of theconfig/versions.jsonschema used in this repositorySPACK_YAML_SCHEMA_VERSION: Version of the ACCESS-NRI-stylespack.yamlschema used in this repositoryRELEASE_DEPLOYMENT_TARGETS: Space-separated list of deployment targets when doing release deployments. These are often the names of keys under thedeploymentkey ofbuild-cdsconfig/settings.json, such asGadiorSetonix. As noted below, it is the same as the GitHub Environment name. For example:Gadi SetonixPRERELEASE_DEPLOYMENT_TARGETS: Space-separated list of deployment targets when doing prerelease deployments, similar to the above. For example:Gadi Setonix- note the lack of aPrereleasespecifier!
GitHub Environments are sets of variables and secrets that are used specifically to deploy software, and hence have more security requirements for their use.
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.
In order to deploy to a given deployment target:
- Environments with the name of the deployment target and the type must be created in this repository and have the associated secrets/variables set (see below)
- There must be a
PrereleaseEnvironment associated with theReleaseEnvironment. For example, if we are deploying toSUPERCOMPUTER, we require Environments with the namesSUPERCOMPUTER Release,SUPERCOMPUTER Prerelease.
When setting the environment up, remember to require sign off by a member of ACCESS-NRI when deploying as a Release.
Regarding the secrets and variables that must be created:
HOST: The deployment location SSH HostHOST_DATA: The deployment location SSH Host for data transfer (may be the same asHOST)SSH_KEY: A SSH Key that allows access to the aboveHOST/HOST_DATAUSER: A Username to login to the aboveHOST/HOST_DATA
DEPLOYED_MODULES_DIR: Directory that will contain the modules created during the installation of the model. This can be virtual modules created by a.modulercfile in the directory.DEPLOYMENT_TARGET: Name of the deployment target. It is exported to the deployment target and used for variations inspack.yamlbuild processes - seen most prominently in mutually-exclusive 'when' clauses likespack.definitions[].when = env['DEPLOYMENT_TARGET'] == 'gadi'. Also used for logging purposes.SPACK_INSTALLS_ROOT_LOCATION: Path to the directory that contains all versions of a deployment ofspack. For example, if/some/apps/spackis theSPACK_INSTALLS_ROOT_LOCATION, that directory will contain directories like0.20,0.21,0.22, which in turn contain an install ofspack,spack-packagesandspack-configSPACK_YAML_LOCATION: Path to a directory that will contain thespack.yamlfrom this repository during deployment- (Optional)
SPACK_INSTALL_ADDITIONAL_ARGS: Additional flags outside of--fresh --fail-fastto add to thespack installcommand. For advanced users who need to tailor the installation options in their repository.
- In
ci.ymlandcd.yml, theinputs.*-schema-versionforuses: access-nri/build-cdentrypoint workflows must be filled in with valid versions taken fromACCESS-NRI/schema. .github/CODEOWNERScan require reviews from users or teams for specific manifests, if required.
.spackmust be given a version. For example, it will clone the associatedreleases/vVERSIONbranch ofACCESS-NRI/spackif you give itVERSION..spack-packagesshould also have a CalVer-compliant tag as the version. See the associated repo for a list of available tags.
Important
Unlike Model Deployment Repositories (and the template they are based on), you can have multiple spack.yaml manifests in one repository. Just remember to demarcate them by directory name - eg. TOOL1/spack.yaml, TOOL2/spack.yaml, etc.