Deprecate use of ec['parallel'] and fix updating the template value#3842
Deprecate use of ec['parallel'] and fix updating the template value#3842Flamefire wants to merge 3 commits intoeasybuilders:developfrom
Conversation
39f2ce7 to
314c12f
Compare
|
Makes sense in general, but haven't reviewed this in detail yet (I'm wondering whether we can avoid the @Flamefire Have you looked into the impact that this will have on both easyblocks (where I have a feeling that the way this is done currently is too "hard" of a change, we should do it in a way that just results in a warning when |
This PR is exactly that: NOTHING is broken by that. I took exceptionally great care to make sure of that which requires the
This will continue to work as before as that value will be stored in
They will also work exactly as before with a deprecation warning that |
| # Storage for parallel property. Mark as unset initially | ||
| self._parallel = None | ||
| # Legacy value, remove with EasyBuild 5.0 | ||
| self._config['parallelLegacy'] = [None, '', ('', )] |
There was a problem hiding this comment.
Not a big fan of this, since this opens the door to letting easyblocks use self.cfg['paralleLegacy']...
Can we avoid parking this in the self._config dictionary, and use self._parallel_legacy instead?
If not, we should rename 'paralleLegacy' to something more obscure that better signals that it's an internal thing (like '_parallel_legacy')
There was a problem hiding this comment.
Can we avoid parking this in the self._config dictionary, and use self._parallel_legacy instead?
Not really as it needs to be in the EC instance not the EB instance. Played around with it a bit and this was the best solution to keep the change as transparent and backwards compatible as possible.
But yes we can rename it although I chose paralleLegacy to be already obscure enough to not be used.
There was a problem hiding this comment.
I did the requested change after the latest rebase using self._config['_parallelLegacy']
34b2be0 to
eb94c51
Compare
|
@boegel What was the issue here? Anything remaining? |
eb94c51 to
eb56eca
Compare
eb56eca to
bda01a5
Compare
|
Finally all green. |
b0e05d3 to
bf6b637
Compare
|
@boegel *ping |
bf6b637 to
5dc1a02
Compare
d9c091b to
0f19be2
Compare
ec['parallel'] currently doubles as an EC option and as the storage for the calculated parallelism set by the EasyBlock. This makes it hard to reason about especially as maxparallel has pretty much the same effect. Also changes to ec['parallel'] done by e.g. easyblocks (or the set_parallel method) are not reflected by the template `%(parallel)s` Solution: Introduce a property which on write updates the template and some magic to mirror the effect of the now deprecated ec['parallel']
Migrate from `self.cfg['parallel']` to `self.cfg.parallel`
0f19be2 to
b7c7706
Compare
|
@Flamefire This can be closed in favor of #4580, right? |
|
If there won't be another 4.x then yes. |
ec['parallel'] currently doubles as an EC option and as the storage for the calculated parallelism set by the EasyBlock.
This makes it hard to reason about especially as maxparallel has pretty much the same effect. Also changes to ec['parallel'] done by e.g. easyblocks (or the set_parallel method) are not reflected by the template
%(parallel)sSolution: Introduce a property which on write updates the template and some magic to mirror the effect of the now deprecated ec['parallel']
Additional change I'd like to do: Treat
parallel = False(legacy) asmaxparallel =1socfg.parallelis always a numberRequires easybuilders/easybuild-easyconfigs#19374 to avoid deprecation warnings
See #3811 (comment) for the motivation