A TUI utility for creating test installations using Spack environment chaining
Project description
EMCEnvChainer
The EMCEnvChainer utility allows NOAA developers to build their own copies of packages (i.e., model app dependencies) on top of existing spack-stack installations. It does so using Spack's environment chaining feature. Only the specifically requested package(s) and corresponding dependents need to be rebuilt, therefore as much of the existing installation as possible is reused, thereby reducing overall installation time and minimizing configuration differences (versions, build options) between the base (upstream) and user-built software stacks.
The utility will automatically identify which platform (RDHPCS systems + Acorn) it is running on, and identify available base spack-stack installations, including the ones associated with the UFS Weather Model head of develop.
Installation & basic usage
To use the utility, install it, invoke the emcenvchainer command, and follow the prompts:
pip3 install emcenvchainer
emcenvchainer
You may choose a spack-stack installation and select individual packages to incorporate into your installation, or you may choose a model application to automatically obtain the list of dependencies, then choose whether to customize the version/build options for each. Currently only UFS Weather Model (head of develop) is supported. After the installation is complete, instructions are provided for accessing the stack.
[!NOTE] The Lmod module files and spack-stack metamodules for accessing the base and user packages are installed in a single location in the user's space. Therefore, when setting
$MODULEPATHfor your application, it should not include the original spack-stack installation, only the one associated with the newly built Spack environment.
To override the automatic platform detection, export the $SITE_OVERRIDE environment variable:
SITE_OVERRIDE=ursa emcenvchainer
[!IMPORTANT] Compatibility for xterm must be enabled in your terminal (PuTTY, Tectia/sshg3, SecureCRT) or the utility will immediately fail with an error.
Add'l usage & troubleshooting
Spack won't use some of the existing packages
Occasionally Spack will not use existing packages from the upstream environment even when it ostensibly should. For instance, the concretization output may show that it intends to perform a fresh build of HDF5 and its dependents even though we are only requesting a new version of Scotch, which is not in any way a dependency of HDF5. There are deep internal Spack reasons for this, usually related to spuriously differing package hashes.
This problem can be straightforwardly worked around if you are using the model app-based approach to configuring your installation (i.e., selecting a model-based configuration on the "Select Installation Source" screen). In that case, identify any such problematic packages that should not be rebuilt (HDF5, in the aforementioned example), select them from the checklist, and at the bottom of the "Package Specification" screen, select one of the existing package configurations. There is little risk to doing this to any and all packages, as long as they are not packages that need building, i.e., package versions you have requested or dependents of packages you have selected (i.e., if you wish to build a new HDF5 version, you cannot reuse the existing NetCDF packages because they depend on HDF5). The only case where this will certainly fail is if it leads to version conflicts. If the versions and build options are otherwise acceptable, you may of course choose to allow Spack to rebuild even some packages that do not need rebuilding.
If you are selecting individual packages for inclusion from the upstream environment (i.e., you selected a spack-stack environment directly on the "Select Installation Source" screen), then when you add a package that you do not wish to rebuild, add "/hash123" to the "Variants" field on the "Package Specification" screen, where you have determined the package hash "/hash123" in the base (upstream) spack-stack installation.
I want to modify the Spack environment before installing
The utility can be halted at any time using Ctrl-c. At any time after the Spack environment configuration has been written (spack.yaml+various other files), you may stop the utility, activate the environment by sourcing activate_spack_env.sh, and modify the environment before running spack install. For example, to add a new package constraint:
$ cd <Spack env directory>
$ . activate_spack_env.sh
$ spack config add 'packages:hdf5:require:+szip' # or manually edit config files
$ spack concretize
$ spack install
I want to install additional packages
At any point after the Spack environment configuration (spack.yaml+various other files) has been written, you may modify the environment, including to add more packages. The simplest approach is to add new packages after the initial installation is complete. For example, if you have already run an installation based on the UFS Weather Model dependencies, the following steps can be used to add the MET and METplus packages:
$ cd <Spack env directory>
$ . activate_spack_env.sh
$ spack install --add met metplus
# if modules have not already been automatically generated:
$ spack module lmod refresh
I'm getting angry emails from sys admins for running large builds on login nodes
This utility does not currently support building under batch schedulers (SLURM, PBS Pro, etc.). To avoid angry emails, such as on the MSU systems (Orion & Hercules):
- On a login node: Run the utility until after the concretization step but before initiating the installation itself (i.e., Ctrl-c when the concretization output is displayed).
- On a login node: Activate the Spack environment (
. activate_spack_env.sh) and runspack fetch --missingto retrieve source code for the packages to be built. - On a compute node: Run
spack install. To run via interactive job on a compute node, first sourceactivate_spack_env.sh. With SLURM (RDHPCS machines):
srun --account=myacctname --partition=dev --time=01:00:00 --nodes=1 --cpus-per-task=6 --pty --export=ALL $(which spack) install -p1 -j6
With PBS Pro (Acorn):
qsub -A MYACCT-DEV -q dev -l walltime=01:00:00,select=1:ncpus=6 -I -V -- $(which spack) install -p1 -j6
I want to make my own source code modifications to one or more packages
This functionality is not directly available with this utility. To achieve this effect, follow the above instructions under "I want to modify the Spack environment before installing" (i.e., halt the utility after spack.yaml is generated but prior to concretization), and modify the environment by running spack develop mypkg@develop, then run the concretization and installation steps as shown. See also the Spack documentation for details on pointing Spack to a local, modified copy of a package's source code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file emcenvchainer-0.3.3.tar.gz.
File metadata
- Download URL: emcenvchainer-0.3.3.tar.gz
- Upload date:
- Size: 89.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c371f222b40f79526aefc36aaa807200c5cc434a3169b846ad4ad952c37d8a30
|
|
| MD5 |
a62c94c521e0a2bf154a8b746760d6ed
|
|
| BLAKE2b-256 |
c1cbd5b7992b28aaf8bdf882c938ffacf81ffc075c25431921914e28e875cc7f
|
Provenance
The following attestation bundles were made for emcenvchainer-0.3.3.tar.gz:
Publisher:
publish_pypi.yml on AlexanderRichert-NOAA/EMCEnvChainer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emcenvchainer-0.3.3.tar.gz -
Subject digest:
c371f222b40f79526aefc36aaa807200c5cc434a3169b846ad4ad952c37d8a30 - Sigstore transparency entry: 1075913773
- Sigstore integration time:
-
Permalink:
AlexanderRichert-NOAA/EMCEnvChainer@9e22302a8267f79329dd327a870d47bc22aa8373 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/AlexanderRichert-NOAA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@9e22302a8267f79329dd327a870d47bc22aa8373 -
Trigger Event:
release
-
Statement type:
File details
Details for the file emcenvchainer-0.3.3-py3-none-any.whl.
File metadata
- Download URL: emcenvchainer-0.3.3-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d021505fb71d84749fd1ddfd542e9f68787622c28db6e33fd2929ce34e00dd5
|
|
| MD5 |
a725e6b2b245d3108658958c22366e5e
|
|
| BLAKE2b-256 |
d82cea3538172ef2013fdaf2deced82f3ac8b494854041d7e424c7bc463ead07
|
Provenance
The following attestation bundles were made for emcenvchainer-0.3.3-py3-none-any.whl:
Publisher:
publish_pypi.yml on AlexanderRichert-NOAA/EMCEnvChainer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emcenvchainer-0.3.3-py3-none-any.whl -
Subject digest:
2d021505fb71d84749fd1ddfd542e9f68787622c28db6e33fd2929ce34e00dd5 - Sigstore transparency entry: 1075913788
- Sigstore integration time:
-
Permalink:
AlexanderRichert-NOAA/EMCEnvChainer@9e22302a8267f79329dd327a870d47bc22aa8373 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/AlexanderRichert-NOAA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@9e22302a8267f79329dd327a870d47bc22aa8373 -
Trigger Event:
release
-
Statement type: