-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Introduce environment variables for controlling system auto-detection #2444
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2444 +/- ##
==========================================
+ Coverage 85.73% 85.76% +0.03%
==========================================
Files 57 57
Lines 10555 10580 +25
==========================================
+ Hits 9049 9074 +25
Misses 1506 1506
Continue to review full report at Codecov.
|
ekouts
left a comment
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 implementation looks fine to me, but we should document the option in docs/config_reference.rst and docs/manpage.rst.
|
I realize now you also have to update the documentation in Picking a system configuration section in |
vkarak
left a comment
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 don't think that controlling the method to retrieve the hostname can be part of the configuration. ReFrame uses the hostname to navigate through the configuration and eventually pick the right system subconfig. It's the exactly equivalent of passing --system: this cannot be part of the configuration. This means that you would need an environment variable to control the method, such as RFM_SYSTEM_AUTODETECT_METH=fqdn. Now the problem with that is that whatever we do we will be introducing a breaking behaviour. The current auto-detection works as follows:
- Search for
xthostname - If not found, use
fqdnto retrieve the hostname (in the past we have been usinghostname).
I agree that the auto-detection process should be controlled, but assuming that we use an environment variable as the above, what would be the default value? If it's fqdn we would break the auto-detection in Cray systems, if it's anything else, we would break the current behaviour. There are also aspects in auto-detection when you run in the cloud. See this for example, where they construct the system name from the instance information retrieved by a REST call. To support this, we would need to generalise the auto-detection mechanism a bit differently than how this PR tries to do it.
So perhaps we could simplify this PR by introducing three environment variables controlling the auto-detection though hostname:
RFM_AUTODETECT_METHOD=hostname
RFM_AUTODETECT_XTHOSTNAME=1 # (default)
RFM_AUTODETECT_FQDN=1 # default
The hostname autodetection method is the only supported method currently, but the other two variables control whether the xthostname will also be tried and whether the fqdn will be used instead of the hostname.
Does it make sense?
ekouts
left a comment
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 still have some small comments but in general lgtm.
|
I'm updating a bit the implementation: I have made our |
- Support defaults in ArgumentParser for environment variable-only options - Remove `get_hostname_cmd()` - Autodetection happens entirely in `_SiteConfig` - New method for setting the autodetection method in `_SiteConfig`.
Closes #2440