-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Allow dependencies between specs in environments #49097
Description
Summary
This proposal aims at extending the current syntax for specs in environments, by allowing:
- A specific order of concretization among matrices
- The possibility of overriding configuration options per-matrix
Together with #45189, these two extensions should make it easier to bootstrap an entire stack in a single environment, starting from minimal requirements on the system.
Rationale
This extension should simplify a number of use cases, for instance:
aws-pclusterpipelines, that need to bootstrap compilers in N stepse4scan use different matrixes for different compilers / options in a single pipeline. This means we can potentially lumpe4s-rocm,e4s-oneapietc. in a single pipeline
Ideally, many workflows that are now using multiple environments, and manual boilerplate operations to connect them, can be unified in a single environment.
Description
From a user perspective, this should just add a few optional fields to matrices:
- The fields
idandneedscan be used to specify dependencies among parts of the same environment. - The
configurationfield can be used to override config option for that matrix only
An example spack.yaml might look like:
spack:
specs:
- group: gcc12
spec: gcc@12+binutils
- group: oneapi2024
needs:
- gcc12
spec: [email protected] %gcc@12
- group stack
needs:
- gcc12
- oneapi2024
matrix:
- [ gromacs, lammps]
- ["%oneapi"]
configuration:
packages:
fortran:
require: [email protected]
view: true
concretizer:
unify: trueRoughly, the rules for concretizing it would be as follows:
- If a matrix
idis needed by another matrix, then it will be concretized before that other matrix, and the concretized root specs will be available for "reuse" (regardless of filters that are applied to reuse). In the example abovegcc12is concretized beforeoneapi2024and the concretegcc@12+binutilsspec is available when concretizing[email protected] %gcc@12. - Matrixes / specs without an
idare considered to be part of a defaultidthat has no dependencies - Configuration overrides per matrix are used only when concretizing that matrix
The syntax used is taken from Github Actions syntax, so users would hopefully be familiar with it.
Additional information
For debugging purposes, we should be able to easily reproduce intermediate steps of concretization, e.g. try to concretize the oneapi2024 matrix and be able to inspect its input, output, ASP encoding etc.
General information
- I have searched the issues of this repo and believe this is not a duplicate