-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow hiding toolchains (REVIEW) #1683
Conversation
Automatic reply from Jenkins: Can I test this? |
Jenkins: ok to test |
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2899/console for more details). This pull request is now ready for review/testing. Please try and find someone who can tackle this; contact @boegel if you're not sure what to do. |
+1 on this! |
@boegel Could you please take a quick look at this and let me know what is missing? I still don't know where to test this in the unit tests. As far as I can see, there is no test for |
@@ -108,6 +108,7 @@ def __init__(self, name=None, version=None, mns=None, class_constants=None, tcde | |||
|
|||
# toolchain instances are created before initiating build options sometimes, e.g. for --list-toolchains | |||
self.dry_run = build_option('extended_dry_run', default=False) | |||
self.hide_deps = build_option('hide_deps', default=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use an empty list as a fallback here (not as default value for the build option, that's something else)
so:
self.hide_deps = build_option('hide_deps', default=None) or []
@geimer: there is a test for However, I'm not sure this is the right approach here... With the current proposed changes, a hidden toolchain can only be used if the toolchain name is listed in Shouldn't there be a more explicit way of using a hidden toolchain as well? toolchain = {'name': 'foss', 'version': '2016a', 'hidden': True} Or even through the module naming scheme somehow (maybe that's already possible though, and it doesn't need any changes in the framework, not sure). I think we need to double check that we're covering all bases here, since there are also multiple ways in which a dependency can be listed as hidden ( |
@boegel: Thanks, I'll take a look at the tests in
I'd like to avoid this approach, as it would require users to touch all easyconfigs that use this toolchain. What would be the advantage?
How does the naming scheme fit into the picture???
|
@geimer: you're right about the relation between With your current approach, hiding a toolchain can only be done via I wouldn't like having to touch all the easyconfigs either, but it is a good way of making very sure the toolchain will always be installed hidden, regardless of the EasyBuild configuration that is in place (similar to So, I'm wondering whether supporting with something like |
Personally, I found it painful to use |
@boegel: Components such as The more I think about it, the more I'm inclined to say that the whole |
I agree that supporting On a similar note, I ran into an issue yesterday that our back-end has no |
@geimer this is still WIP, right, since you're planning to add support for marking a toolchain as Are you planning to make the robot hidden-aware in this PR too, i.e. make it able to always fall back to checking for a hidden module too? Maybe it's better to do that in a separate PR? |
@boegel: I believe the parts that are already done in this PR are ready for review. That said, I got lost while investigating how things are passed from the option parsing to the easyconfig tweaking to address |
@@ -1252,6 +1252,8 @@ def process_easyconfig(path, build_specs=None, validate=True, parse_only=False, | |||
dep = ec.toolchain.as_dict() | |||
_log.debug("Adding toolchain %s as dependency for app %s." % (dep, name)) | |||
easyconfig['dependencies'].append(dep) | |||
if dep['hidden']: | |||
easyconfig['hiddendependencies'].append(dep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geimer: I don't think this is required? I even think we should not do this, since it may have unwanted side-effects...
I'm working on another PR to your branch, where this is removed, but I figured I should double-check with you first why this was added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boegel: To be honest, I don't remember. I almost believe that this is a leftover from some hacking and got committed incidentally...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boegel: Maybe to create a correct module load
statement for the hidden module in the modulefile? Cross-checking it right now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I checked where hiddendependencies
is used, and it's not used to determine the module name to use.
I dropped this in geimer#9, I'm fairly sure it's not needed at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boegel: I tried various things and couldn't reproduce a situation where is needed. So, yes, let's drop it.
add tests w.r.t. hiding toolchains (+ minor style fixes)
@boegel: Does it make sense to rename the |
@geimer: sure, I think it makes sense... Although we should keep |
@boegel: WIP, stay tuned... Is there any way to also deprecate the |
@boegel Do we need to extend |
`NAME_VERSION_DICT` to `TOOLCHAIN_DICT` - Provide `to_name_version_dict` compatibility wrapper printing deprecation warning - Adjusted unit tests to use new function names
@boegel Please take another look at my last commit which does the renaming/deprecation. The two questions from the previous comments still hold, though. |
|
||
return res | ||
|
||
|
||
def to_name_version_dict(spec): | ||
"""Deprecated in favor of to_toolchain_dict.""" | ||
_log.deprecated("to_name_version_dict; use to_toolchain_dict instead.", '2.9') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the version number indicates when the warning will be transformed into an error, so use 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boegel: Are you sure? The output I get when modifying one of the unit tests is
DEPRECATED (since v2.9) functionality used: to_name_version_dict; use to_toolchain_dict instead.; see http://easybuild.readthedocs.org/en/latest/Deprecated-functionality.html for more information
This suggests that it is the version since when it is deprecated, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as soon as you include a log.deprecated
message, you're deprecating something
the version indicates when the deprecation warning becomes a deprecation error, so it should be 3.0
@geimer: I wouldn't worry about deprecating also enhancing |
Going in, thanks @geimer! |
Ah crap, there are conflicts with current @geimer: can you look into that? If not, I'll tackle it myself with a wrapper PR later this week. |
sync with develop & resolve conflicts
Fix for #1682
Unit tests still succeed (since there is no functional change if
--hide-deps
is not used) and the example mentioned in #1682 works like a charm, both a dry-run and an actual build.One or the other unit test should probably use the
--hide-deps
option, though I don't have a clear idea yet where this would be most effective.Edit: After a discussion during an EB conf call (cfr. https://github.com/hpcugent/easybuild/wiki/Conference-call-notes-20160706), the approach taken has slightly changed. This PR will tackle
--hide-toolchains=foo,bar
command-line option (as well as env var and config file parameter)toolchain
easyconfig parameter to handlehidden
key (as outlined in Allow hiding toolchains (REVIEW) #1683 (comment))To be done in a separate PR:
hidden
parameter in--try-toolchain
option