Skip to main content

EMCEnvChainer

unit tests

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 supported model applications at the head of their respective default branches (i.e., "develop"). Users may choose to use a given application's package configuration as a starting point (recommended in most cases), or create an environment from scratch.

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 based on the head of its default branch, then choose whether to customize the version/build options for each. The model applications currently supported are: UFS Weather Model, Global Workflow, GSI, UPP, UFS_UTILS, and AQM-utils. After the installation is complete, instructions are provided for accessing the stack. The newly created Spack environment, including installed packages, module files, and any needed custom Spack package recipes are placed in a single directory inside the directory where the utility is run.

To override the automatic platform detection, export the $SITE_OVERRIDE environment variable:

SITE_OVERRIDE=ursa emcenvchainer

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 or dependent of HDF5. There are deep internal Spack reasons for this, usually related to spuriously differing package hashes or obscure concretizer errors.

This problem can be straightforwardly worked around if you are using the model app-based approach to configuring your installation. On the package selection screen, packages may be locked to their existing upstream spec, that is, Spack will be forced to point to the upstream package rather than reconfiguring and rebuilding it. To lock the a package, highlight it and press l; the package label will update to show a 🔒 indicator with the spec and hash being used. Press l again to cycle to subsequent available upstream specs if there is more than one, and pressing 'l' again after that will unlock the package. To lock all packages to their first available upstream spec, press L, then use l to unlock only those packages you wish to allow Spack to reconfigure and rebuild.

There is little risk to locking 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 to reconfigure). If locking packages leads to hard conflicts, the concretization will fail.

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):

  1. 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).
  2. On a login node: Activate the Spack environment (. activate_spack_env.sh) and run spack fetch --missing to retrieve source code for the packages to be built.
  3. On a compute node: Run spack install. To run via interactive job on a compute node, first source activate_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

On the "Package Specification" screen for any package, you can check the "Develop with persistent source code directory ('spack develop')" checkbox. This will automatically run spack develop for the package after the environment is configured, creating a local source directory that you can modify before building.

See the Spack documentation for details on iterative code development through the use of spack develop.

Metadata

Release files for emcenvchainer 0.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emcenvchainer 0.4.7
File Size Uploaded Provenance Actions
emcenvchainer-0.4.7.tar.gz 103.8 kB With provenance Details for emcenvchainer-0.4.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for emcenvchainer 0.4.7
File Interpreter ABI Platform Actions
emcenvchainer-0.4.7-py3-none-any.whl Python 3 none any Details for emcenvchainer-0.4.7-py3-none-any.whl

Total release size: 155.9 kB

Release files / emcenvchainer-0.4.7.tar.gz

Download URL emcenvchainer-0.4.7.tar.gz
Size 103.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f80eb6a4a4be5400d7d4c42eb77d1a79e3b49484247f91270cc9b9a420388f72
BLAKE2b-256 checksum
How to use checksums
baaaf5c1edd5f1cdd9d9d6ec5227bac2c224dd16abecc306202f9393e0333685
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.

Transparency log

Release files / emcenvchainer-0.4.7-py3-none-any.whl

Download URL emcenvchainer-0.4.7-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42f9ba54ad8b731df1bfc87bf011c22e8e49fc3a58d7223ebbfaec52287d38ed
BLAKE2b-256 checksum
How to use checksums
bc2238395696bee40857389302d42e265bf3a29638113b6184eddf51713177f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.

Transparency log

Security for emcenvchainer 0.4.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for emcenvchainer-0.4.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page