Deploying a new spack environment
Compass now deploys environments through ./deploy.py, backed by
mache.deploy. Compared with pixi dependency updates, Spack updates are
heavier-weight because the resulting environments are often shared on
supported machines and build times can be substantial.
Use this page when you need to update or redeploy the shared Spack-backed Compass stack on supported HPC systems.
What lives where?
The main deployment inputs in this repository are:
deploy.pyThe repository entry point for deployment.
deploy/pins.cfgVersion pins for pixi, Spack and shared dependencies.
deploy/config.yaml.j2Deployment behavior and runtime settings consumed by
mache.deploy.deploy/spack.yaml.j2The Compass-specific list of Spack specs to deploy.
deploy/hooks.pyCompass-specific deployment hooks for machine defaults and optional Albany support.
Machine-specific Spack environment templates now live in mache, not in this repository.
Testing a Spack deployment
Before touching any shared location, do a test deployment in a scratch or user-owned Spack path.
Basic test deployment
On a supported machine, run something like:
SCRATCH_SPACK=<path_to_test_spack>
./deploy.py --deploy-spack --spack-path ${SCRATCH_SPACK} \
--compiler intel intel gnu --mpi openmpi impi openmpi --recreate
Adjust --compiler and --mpi to match the machine you are testing.
Useful flags
--deploy-spackBuild or update the supported Spack library and software environments.
--spack-path <path>Use a test Spack checkout and install location instead of the shared one.
--compiler <compiler...>and--mpi <mpi...>Select the toolchain combinations to test.
--recreateStart from a clean deployment for this run.
--with-albanyDeploy the Albany-enabled Spack library environment in addition to the default one.
If you need a non-default temporary directory for Spack builds, set
spack.tmpdir in deploy/config.yaml.j2 before running deployment.
Testing against a mache branch
When Compass changes depend on unreleased mache updates, test with a fork
and branch explicitly:
SCRATCH_SPACK=<path_to_test_spack>
./deploy.py --mache-fork <fork> --mache-branch <branch> \
--deploy-spack --spack-path ${SCRATCH_SPACK} \
--compiler intel intel gnu --mpi openmpi impi openmpi --recreate
This keeps the Compass deployment workflow the same while swapping in the
requested mache branch during bootstrap and deployment.
Albany deployments
If you are testing MALI workflows that require Albany, add
--with-albany:
SCRATCH_SPACK=<path_to_test_spack>
./deploy.py --deploy-spack --spack-path ${SCRATCH_SPACK} \
--compiler gnu --mpi openmpi --with-albany --recreate
Albany support is restricted to the machine/compiler/MPI combinations allowed by the deployment hooks and machine configuration.
Validating the deployment
After deployment completes:
source the generated load script for the toolchain you want to validate
build the appropriate MPAS component with the matching make target
set up and run the relevant Compass suites or test cases
confirm the generated work directories contain
load_compass_env.shand that sourcing it activates the intended environment
The Quick Start for Developers page and the machine pages under Supported Machines remain the main references for build targets and day-to-day usage once deployment has succeeded.
Troubleshooting Spack deployment
If a Spack deployment fails part way through and suggests clearing caches, the usual recovery step is:
source <spack_path>/share/spack/setup-env.sh
spack clean -m
Then rerun ./deploy.py with the same arguments.
If deployment is failing because the wrong architecture or operating system is being inferred for a new machine template, use:
source <spack_path>/share/spack/setup-env.sh
spack arch -o
spack arch -g
and update the corresponding machine support in mache.
If a machine requires a local mirror or site-specific workaround for one of the
Spack packages, coordinate that change with the machine maintainers and keep
the Compass pins in deploy/pins.cfg aligned with whatever is available at
the site.