Assign priorities to configuration scopes#48420
Conversation
2b17111 to
8c0cc36
Compare
|
Failure in pipelines is unrelated, and due to system errors: |
psakievich
left a comment
There was a problem hiding this comment.
I've looked over the code and the concept seems sound to me. The idea of stack like behavior within a given priority is a more robust design. It also seems truer to our description of how configs will work with the users. I'm still mulling a bit about the defaults selected but not to the point of wanting to hold up a merge. Thanks @alalazo for taking the time to shore up this design.
|
I don't see any code change in bootstrap 🤔 what about bootstrapping to /tmp instead of ~/.spack/bootstrap? |
|
@haampie There shouldn't be any change to bootstrap. The bootstrap store is specified in another place, so if you want to modify it from the command line you should: $ spack -c bootstrap:root:/tmp spec zlibeven though the simpler way to do it is: $ spack bootstrap root /tmpAnyhow, I'm not aiming at changing any bootstrap semantic in this PR. |
|
@haampie I think this PR is approved by reviewers, but there are some unresolved conversations by you. Just wanna make sure it didn't fall off the radar. |
|
@wdconinc This was supposed to wait a bit, so #46792 (which later became #48784) could be merged. I think it's now clear that the blocking PR needs more time to be merged than originally foreseen. Also, I now see I need to "fix" hep pipelines generation here. On Unfortunately, we rely on the bug being fixed to get it, so it seems we are using |
This commit removes the "unify:false" in higher priority custom scopes, and makes the unification strategy explicit in each pipeline.
b16a1e8 to
4a5a12d
Compare
@alalazo If you want, we can switch the hep pipeline to Alternatively, I was trying to move those hep pipelines closer to |
|
@wdconinc I just pushed the fix in the last commit, just waiting to see pipelines ✔️ We can change the unification strategy in a following PR. |
|
So are we waiting on #48784 or not? I guess I'm a little lost on that. I'll just keep approving for now...😅 |
|
@kwryankrattiger see the pipeline changes here -- I think they'll be less relevant if we use less |
It has been on my list to convert all of the stacks to include configs instead of using -C. It has been a source of more confusion than convenience and the original idea for dynamic scopes has proven to be better expressed through includes or using "config add". |
|
I missed one thing here: we also set a few default images with We didn't see failures in CI here cause there was nothing to rebuild 😞 I'll submit a fix asap. EDIT: Looking further into this I noticed that what we document in the code is different from what we have in docs here. The bug in the issue remains a bug, but the correct priority of |
All the build jobs in pipelines are apparently relying on the bug that was fixed. The issue was not caught in the PR because generation jobs were fine, and there was nothing to rebuild. Reverting to fix pipelines in a new PR. This reverts commit 3ad99d7.
Currently, environments can end up with higher priority than `-C` custom
config scopes and `-c` command line arguments sometimes. This shouldn't
happen -- those explicit CLI scopes should override active environments.
Up to now configuration behaved like a stack, where scopes could be only be
pushed at the top. This PR allows to assign priorities to scopes, and ensures
that scopes of lower priorities are always "below" scopes of higher priorities.
When scopes have the same priority, what matters is the insertion order.
Modifications:
- [x] Add a mapping that iterates over keys according to priorities set when
adding the key/value pair
- [x] Use that mapping to allow assigning priorities to configuration scopes
- [x] Assign different priorities for different kind of scopes, to fix a bug, and
add a regression test
- [x] Simplify `Configuration` constructor
- [x] Remove `Configuration.pop_scope`
- [x] Remove `unify:false` from custom `-C` scope in pipelines
On the last modification: on `develop`, pipelines are relying on the environment
being able to override `-C` scopes, which is a bug. After this fix, we need to be
explicit about the unification strategy in each stack, and remove the blanket
`unify:false` from the highest priority scope
Signed-off-by: Massimiliano Culpo <[email protected]>
All the build jobs in pipelines are apparently relying on the bug that was fixed. The issue was not caught in the PR because generation jobs were fine, and there was nothing to rebuild. Reverting to fix pipelines in a new PR. This reverts commit 3ad99d7.
fixes #48414
Currently, environments can end up with higher priority than
-Ccustom config scopes and-ccommand line arguments sometimes. This shouldn't happen -- those explicit CLI scopes should override active environments.Up to now configuration behaved like a stack, where scopes could be only be pushed at the top. This PR allows to assign priorities to scopes, and ensures that scopes of lower priorities are always "below" scopes of higher priorities.
When scopes have the same priority, what matters is the insertion order.
Modifications:
Configurationconstructor f1d0371Configuration.pop_scope61dd2f2unify:falsefrom custom-Cscope in pipelines 4a5a12d Ondevelop, pipelines are relying on the environment being able to override-Cscopes, which is a bug. After this fix, we need to be explicit about the unification strategy in each stack, and remove the blanket unify:false from the highest priority scope