Skip to content

Commit ced232f

Browse files
authored
Merge pull request #347 from xylar/add-releasing-docs
Add docs on updating Conda and Spack dependencies
2 parents 8b477f6 + 6ee143f commit ced232f

19 files changed

+1579
-486
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# How Conda and Spack Work Together in Polaris
2+
3+
Polaris uses a hybrid approach that combines Conda and Spack to build
4+
and deploy a comprehensive software environment for analysis and diagnostics.
5+
This page explains the motivation for this strategy, how the components
6+
interact, and the shared infrastructure that supports Polaris and related
7+
projects (e.g. [E3SM-Unified](https://docs.e3sm.org/e3sm-unified/main/releasing/release-workflow.html)).
8+
9+
---
10+
11+
## Why Combine Conda and Spack?
12+
13+
Each tool solves a different part of the problem:
14+
15+
### ✅ Conda
16+
17+
* Excellent for managing Python packages and their dependencies
18+
* Supports rapid installation and reproducibility
19+
* Compatible with conda-forge and custom channels
20+
* User-friendly interface, especially for scientists and developers
21+
22+
### ✅ Spack
23+
24+
* Designed for building performance-sensitive HPC software
25+
* Allows fine-grained control over compilers, MPI implementations, and system
26+
libraries
27+
* Better suited for tools written in Fortran/C/C++ with MPI dependencies
28+
29+
### ❗ The Challenge
30+
31+
Neither system alone is sufficient:
32+
33+
* Conda cannot reliably build or run MPI-based binaries across multiple nodes
34+
on HPC systems.
35+
* Spack lacks strong support for modern Python environments and is generally
36+
harder to use for scientists accustomed to Conda-based workflows.
37+
38+
---
39+
40+
## Architecture: How They Work Together
41+
42+
Polaris environments:
43+
44+
1. Use **Conda** to install the core Python tools and lightweight dependencies
45+
2. Rely on **Spack** to build performance-critical tools outside Conda as
46+
well as libraries required for build E3SM components to be tested in Polaris
47+
3. Are bundled into a single workflow that ensures compatibility across both
48+
49+
System-specific setup scripts ensure both components are activated correctly.
50+
51+
For MPI-based tools:
52+
53+
* The tools are built with Spack using system compilers and MPI
54+
* Users automatically access these builds when running on compute nodes
55+
56+
---
57+
58+
## Shared Infrastructure
59+
60+
Polaris, E3SM-Unified, and Compass all rely on the same key components:
61+
62+
* [`mache`](https://github.com/E3SM-Project/mache): A configuration library
63+
for detecting machine-specific settings (modules, compilers, paths)
64+
* [E3SM's Spack fork](https://github.com/E3SM-Project/spack): Centralized
65+
control over package versions and build settings
66+
* Conda: Used consistently to install `mache`, lightweight tools, and Python
67+
dependencies
68+
69+
This shared foundation ensures reproducibility and consistency across
70+
workflows, testbeds, and developer tools in the E3SM ecosystem. `mache` also
71+
helps to ensure that libraries used by E3SM components come from the
72+
same system module in Polaris as they do in E3SM. In cases where libraries
73+
are built with Spack, `mache` ensures that the compilers and MPI libraries
74+
used to build them are the same as will be used to build the components
75+
themselves.
76+
77+
---
78+
79+
## Summary
80+
81+
The hybrid Conda + Spack model in Polaris balances ease of use with HPC
82+
performance. While more complex to maintain, it provides flexibility,
83+
compatibility, and performance across diverse systems. Shared infrastructure
84+
(like `mache` and E3SM's Spack fork) reduces duplication across projects and
85+
streamlines the release process.
86+
87+
---
88+
89+
## Future Alternatives
90+
91+
As complexity grows, other strategies may be worth evaluating:
92+
93+
### Option: **E4S (Extreme-scale Scientific Software Stack)**
94+
95+
* Spack-based stack of curated HPC tools
96+
* E4S environments aim to replace the need for manual Spack+Conda integration
97+
* May offer better long-term sustainability, but lacks Python focus today
98+
99+
🔗 [Explore E4S](https://e4s.io)
100+
101+
### Other Approaches (less suitable currently):
102+
103+
* Pure Spack builds (harder for Python workflows)
104+
* Pure Conda builds (harder for HPC performance tools and likely can't provide
105+
libraries needed to build E3SM components)
106+
* Containers (portability gains, but complex for HPC integration)
107+
108+
---
109+
110+
## Summary
111+
112+
The hybrid Conda + Spack model in Polaris balances ease of use with HPC
113+
performance. While more complex to maintain, it provides flexibility,
114+
compatibility, and performance across diverse systems. Shared infrastructure
115+
(like `mache` and E3SM's Spack fork) reduces duplication across projects and
116+
streamlines the release process.

0 commit comments

Comments
 (0)