Utilising spack in a shared environment

spack has the ability to “chain” spack installs:

https://spack.readthedocs.io/en/latest/chain.html

This is a way users can utilise a central spack install with many pre-built packages, but still be able to build their own software in their own spack directory.

This is a detailed write-up of how to do this in an Azure multi-user HPC environment:

Caveat:

install_tree must point to the opt/spack directory inside of the Spack base directory.

Chaining may not be an appropriate solution if the install_tree points to a directory outside the Spack base directory.