Github repository: https://github.com/JCSDA/spack-stack
Documentation: https://spack-stack.readthedocs.io/en/latest/
Table of Contents |
---|
https://docs.google.com/spreadsheets/d/1k3aMu8gkEsAZGJRUqYTx1iQG4xFnJGqe/edit#gid=220490890
If you are going to contribute to the spack-stack repository, development is done by forking the spack-stack repository. This section contains steps to fork spack-stack from https://github.com/JCSDA/spack-stack, make changes, and issue a PR.
git clone https://github.com/<your_username>/spack-stack.git
git remote rename origin <your_name>
. This can be verified by running git remote -v
git push <your_name> feature/<your_branch>
. Then open the PR request form in a bowser adding the necessary information and setting the base repository to JCSDA/spack-stack.For further reading on using github forks, checkout this site and this one too.
JCSDA is currently responsible for testing spack-stack environments on S4 and Discover. The documented instructions for building spack-stack on HPC platforms are very good but there are two things to take care of before starting (as noted in the instructions).
Make sure your environment is set properly. Follow the instructions in the spack-stack ReadTheDocs for setting up an environment. Note that the first section of module commands are to be used for both building new spack-environments (which is this task) and for using an existing spack-stack environment to build jedi-bundle and run skylab. You should skip the additional moudle commands that are only for building jedi-bundle and running skylab.
HPC Platform | Instructions for setting up the environment |
---|---|
S4 | https://spack-stack.readthedocs.io/en/latest/PreConfiguredSites.html#uw-univ-of-wisconsin-s4 |
Discover - SCU16 | https://spack-stack.readthedocs.io/en/latest/PreConfiguredSites.html#nasa-discover-scu16 |
Discover - SCU17 | https://spack-stack.readthedocs.io/en/latest/PreConfiguredSites.html#nasa-discover-scu17 |
Typically you will be testing feature branches that could have come from various developers. Each of these developers has their own fork of which will be marked on the PR, and you will need to gain access to those forks in your local clone. The way to do this is to add their forks to your remotes in your local clone. This can be done using a series of the "git remote add ..." command. Here's an example:
# Alex Richert (NOAA) and Dom (NRL) are two of the more active PR contributors git remote add alex https://github.com/AlexanderRichert-NOAA/spack-stack git remote add dom https://github.com/climbfuji/spack-stack ... # Check that you have these entered git remote -v # Update references to the other forks. Running the remote update # command below will pull in all the metadata to the other forks. git remote update -p # Check that you got the references to the other forks (note the use of # the -a option on the git branch command) git branch -avv |
Once you have the necessary remotes added, then you can checkout feature branches from other repos
# Using the remote link entered above, checkout the feature/cool-spack-thing from Dom's spack-stack fork git checkout dom/feature/cool-spack-thing # Make sure to update the submodules git submodule update |
Once the above steps are done, follow the documented instructions here: building spack-stack on HPC platforms. The ideal goal with the testing is to successfully complete the following steps:
Typically, getting all of these steps done is way too much work. I would settle for one of S4 or Discover SCU16 or Discover SCU17, with just one compiler. All of these possibilities are listed for your awareness with the idea that you can round robin between then when testing different feature branches.
Another way to trim down work, is to just verify the spack-stack build, and occasionally carry on through with the jedi-bundle and skylab testing.
Note that you don't need jedipara access to do this testing. You can build everything in your user area on S4 or Discover. To help manage that, both HPC platforms supply commands to show how much of your quota (disk space and number of files) is free.
HPC Platform | quota command |
---|---|
S4 | myquota |
Discover | showquota -h |
Occasionally, there is a need to add a handful of upgraded packages to an existing spack-stack release. spack-stack contains a feature called "chaining environments" which allows the rapid construction of such an "add-on" environment. The idea is to build a new environment that points to an existing environment of which you only have to add in the upgraded packages. The module files in the add-on environment then utilize the base environment's installation and module files for the packages that remain unchanged.
Recently the need for this came up for spack-stack-1.6.0 with the g2@3.5.1 and g2tmpl@1.13.0 upgraded packages. Note that spack-stack-1.6.0 was shipped with g2@3.4.5 and g2tmpl@1.12.0. Here is the spack-stack issue describing the desired upgrade: https://github.com/JCSDA/spack-stack/issues/1180. Note under this comment, a method for handling this particular request (on S4) was described here: https://github.com/JCSDA/spack-stack/issues/1180#issuecomment-2251378587. In this case, an add-on environment already existed so it wasn't necessary to create it and thus it was possible to simply add in the new packages, concretize, install, and update modules (ie, skip some of the steps in the chaining environments recipe).
Here are the steps taken to accomplish this task.
sudo -iu jedipara
module load miniconda/3.8-s4
cd /data/prod/jedi/spack-stack/spack-stack-1.6.0
source setup.sh
cd envs/upp-addon-env
spack env activate .
specs:
sectionspecs: - upp-env %intel ^g2tmpl@1.12.0 ^g2@3.4.5 - prod-util@2.1.1 %intel - ip %intel |
specs: - upp-env %intel ^g2tmpl@1.12.0 ^g2@3.4.5 - upp-env %intel ^g2tmpl@1.13.0 ^g2@3.5.1 - grib-util@1.3.0 %intel ^g2@3.4.5 - grib-util@1.3.0 %intel ^g2@3.5.1 - prod-util@2.1.1 %intel - ip %intel - ufs-weather-model-env %intel ^g2tmpl@1.12.0 ^g5@3.4.5 |
envrepo/packages
following what was done on Orionenvrepo
. envrepo
is a special place used by the chaining environment mechanism to hold extra methods for building the new versions we are trying to add in.spack-stack-1.6.0/envs/upp-addon-env/envrepo
files./data/prod/jedi/spack-stack/spack-stack-1.6.0/envs/upp-addon-env/envrepo`
directory by comparing it with the unpacked tar files.common/modules.yaml
modules.default.lmod.hierarchy
section, add in entries for g2virt
and g2tmplvirt
modules: default: ... lmod: ... hierarchy: - mpi - g2virt - g2tmplvirt |
spack concretize 2>&1 | tee log.concretize
spack.yaml
file abovegrep "==> Concretized " /data/prod/jedi/spack-stack/spack-stack-1.6.0/envs/upp-addon-env/log.concretize ==> Concretized grib-util@1.3.0%intel ^g2@3.4.5 ==> Concretized grib-util@1.3.0%intel ^g2@3.5.1 ==> Concretized ufs-weather-model-env%intel ^g2@3.4.5 ^g2tmpl@1.12.0 ==> Concretized upp-env%intel ^g2@3.4.5 ^g2tmpl@1.12.0 ==> Concretized upp-env%intel ^g2@3.5.1 ^g2tmpl@1.13.0 |
space install -v 2>&1 | tee log.install
spack module lmod refresh --upstream-modules
spack stack setup-meta-modules
This tasks typically comes about when a center wants to pull in bugfixes/updates in a spack-stack package. Ideally, there is enough time to follow the preferred steps which are:
Spack has a handy command (checksum) that will grab the tar file for a particular package version and return the SHA256 value by running a checksum on the tar file. The output is in the form of the python command needed to configure that package version in the package.py script. Here's an example of running the checksum command on the ecmwf-atlas package:
MacBook-Pro-5:unified-env.mymacos steveherbener$ spack checksum ecmwf-atlas 0.38.0 ==> Found 1 version of ecmwf-atlas ==> Fetching https://github.com/ecmwf/atlas/archive/0.38.0.tar.gz version("0.38.0", sha256="befe3bfc045bc0783126efb72ed55db9f205eaf176e1b8a2059eaaaaacc4880a") MacBook-Pro-5:unified-env.mymacos steveherbener$ spack checksum ecmwf-atlas 0.38.1 ==> Found 1 version of ecmwf-atlas ==> Fetching https://github.com/ecmwf/atlas/archive/0.38.1.tar.gz version("0.38.1", sha256="c6868deb483c1d6c241aae92f8af63f3351062c2611c9163e8a9bbf6c97a9798") |
Note that before running these commands you will need to check out the JCSDA spack-stack develop branch (as explained below) first and then run "source setup.sh" to get the environment set up properly.
To illustrate the above steps for upgrading a package version, an example of a prior upgrade to the ecmwf-atlas packages is used. These steps are captured in the following 3 PRs:
Walking through the upgrade steps from above:
# Set up remote references git remote rename origin <your-user-name> git remote add auth_spack https://github.com/spack/spack git remote add jcsda https://github.com/JCSDA/spack # Check that you have these entered git remote -v # Update references to the other forks. Running the remote update # command below will pull in all the metadata to the other forks. git remote update -p # Check that you got the references to the other forks (note the use of # the -a option on the git branch command) git branch -avv |
# Set up remote references git remote rename origin <your-user-name> git remote add jcsda https://github.com/JCSDA/spack-stack # Check that you have these entered git remote -v # Update references to the other forks. Running the remote update # command below will pull in all the metadata to the other forks. git remote update -p # Check that you got the references to the other forks (note the use of # the -a option on the git branch command) git branch -avv |
# Create feature branch for ecmwf-atlas upgrade cd <spack-fork> git checkout auth_spack/develop # take note of the commit hash for the authoritative branch git branch -vv # Create your feature branch, and check that it's commit hash matches # the authoritative develop branch commit hash git checkout -b feature/upgrade-atlas-0.38.x git branch -vv |
spack checksum
command to get the python commands needed for the new versions. See the example above.# Create feature branch for ecmwf-atlas upgrade cd <spack-fork> git checkout jcsda/spack-stack-dev # take note of the commit hash for the authoritative branch git branch -vv # Create your feature branch, and check that it's commit hash matches # the authoritative develop branch commit hash git checkout -b feature/upgrade-atlas-0.38.x git branch -vv |
git add
and git commit
commands in your spack-stack feature branch while your spack feature branch is checked out.# Create feature branch for ecmwf-atlas upgrade cd <spack-stack-fork> git checkout jcsda/develop # take note of the commit hash for the authoritative branch git branch -vv # Create your feature branch, and check that it's commit hash matches # the authoritative develop branch commit hash git checkout -b feature/upgrade-atlas-0.38.x git branch -vv |
common/packages.yaml
file is updated.If you install spack-stack as a release candidate (RC) on an HPC, it will save time to create a build cache to use when installing the actual release.
Prerequisites:
Procedure:
spack buildcache push -u /path/to/tmp-build-cache |
spack mirror add local-binary file:///path/to/tmp-build-cache/ spack buildcache update-index local-binary spack buildcache list spack install --verbose --no-check-signature 2>&1 | tee log.install.env-name.001 |