diff --git a/conda/bootstrap.py b/conda/bootstrap.py index 617e02a88c..423f22e8f9 100755 --- a/conda/bootstrap.py +++ b/conda/bootstrap.py @@ -16,6 +16,7 @@ from mache import MachineInfo from mache import discover_machine as mache_discover_machine from mache.spack import get_spack_script, make_spack_env +from packaging import version from shared import ( check_call, get_conda_base, @@ -209,7 +210,9 @@ def get_env_setup(args, config, machine, compiler, mpi, env_type, source_path, check_supported('petsc', machine, compiler, mpi, source_path) if env_type == 'dev': - spack_env = f'dev_compass_{compass_version}{env_suffix}' + ver = version.parse(compass_version) + release_version = '.'.join(str(vr) for vr in ver.release) + spack_env = f'dev_compass_{release_version}{env_suffix}' elif env_type == 'test_release': spack_env = f'test_compass_{compass_version}{env_suffix}' else: diff --git a/conda/configure_compass_env.py b/conda/configure_compass_env.py index 00d3fb8487..ae4e7516bd 100755 --- a/conda/configure_compass_env.py +++ b/conda/configure_compass_env.py @@ -44,7 +44,7 @@ def setup_install_env(env_name, activate_base, use_local, logger, recreate, channels = '--use-local' else: channels = '' - packages = f'progressbar2 jinja2 {mache}' + packages = f'jinja2 {mache} packaging progressbar2' if recreate or not os.path.exists(env_path): print('Setting up a conda environment for installing compass\n') commands = f'{activate_base} && ' \ diff --git a/docs/developers_guide/deploying_spack.rst b/docs/developers_guide/deploying_spack.rst index 1ea685a3e6..1ed947dcec 100644 --- a/docs/developers_guide/deploying_spack.rst +++ b/docs/developers_guide/deploying_spack.rst @@ -24,6 +24,10 @@ If system modules change in E3SM, we try to stay in sync: * mkl (or other linear algebra libs) +When we update the mache version in compass, we also need to bump the compass +version (typically either the major or the minor version) and then re-deploy +shared spack environments on each supported machine. + Spack ----- @@ -39,6 +43,9 @@ Spack is for libraries used by MPAS and tools that need system MPI: * Netlib LAPACK +When we update the versions of any of these libraries in compass, we also need +to bump the compass version (typically either the major or the minor version) +and then re-deploy shared spack environments on each supported machine. Conda ----- @@ -48,6 +55,10 @@ that don’t need system MPI. Conda environments aren’t shared between developers because the compass you’re developing is part of the conda environment. +When we update the constraints on conda dependencies, we also need to bump the +compass alpha, beta or rc version. We do not need to re-deploy spack +environments on share machines because they remain unaffected. + Mache ===== @@ -127,14 +138,18 @@ by compass. Here, we will use ```` as a stand-in for the fork of mache to use (e.g. ``E3SM-Project/mache``) and ```` as the stand-in for a branch on that fork (e.g. ``main``). -We also need to make sure there is a spack branch for the version of mache. -This is a branch off of the develop branch on +We also need to make sure there is a spack branch for the version of compass. +The spack branch is a branch off of the develop branch on `E3SM’s spack repo `_ that has any -updates to packages required for this version of mache and compass. The -spack branch will omit any alpha, beta or rc suffix on the mache version -because it is intended to be the spack branch we will use once the ``mache`` -release happens. In this example, we will work with the branch +updates to packages required for this version of mache. The remote branch +is named after the release version of mache (omitting any alpha, beta or rc +suffix because it is intended to be the spack branch we will use once the +``mache`` release happens). In this example, we will work with the branch `spack_for_mache_1.12.0 `_. +The local clone is instead named after the compass version (again any omitting +alpha, beta or rc) plus the compiler and MPI library because we have discovered +two users cannot make modifications to the same git clone. Giving each clone +of the spack branch a unique name ensures that they are independent. Here's how to get a branch of compass we're testing (``simplify_local_mache`` in this case) as a local worktree: @@ -280,7 +295,7 @@ Here is an example: --recreate Troubleshooting spack ------------------------------- +--------------------- If you encounter an error like: .. code-block:: none