-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Add configuration parameter to control the timeout of the git clone commands
#2225
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
[feat] Add configuration parameter to control the timeout of the git clone commands
#2225
Conversation
|
Can I test this patch? |
Codecov Report
@@ Coverage Diff @@
## master #2225 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 55 55
Lines 9746 9747 +1
=======================================
+ Hits 8337 8338 +1
Misses 1409 1409
Continue to review full report at Codecov.
|
jjotero
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.
Having this git timeout parameter feels a bit too specific for the config file. In theory, once #2166 is merged, one could create a very simple fixture that clones a repo with all the timeout requirements and so on.
This being said, I don't have that much of a strong opinion and I could live with this config option being added :)
|
@jjotero Yes, I agree with your overall comment. Once the fixtures become available, this will become more easier to manage. However, we still need to expose I thought of using this configurable |
|
@mahendrapaipuri I like the idea of having a config parameter for if timeout is not None:
try:
min_timeout = getattr(run_command, 'min_timeout')
except AttributeError:
min_timeout = rt.runtime().get_option('general/0/min_timeout')
run_command.min_timeout = min_timeout
except Exception:
min_timeout = 0
timeout = timeout if timeout > min_timeout else min_timeoutWhat do you think? In any case, I think it still makes sense to extend the |
|
@jjotero Yes, your suggestion sounds good and more generic. Why can't we do something more simpler like: As we define a default value for Also, in the slack conversion I had with @vkarak he told |
|
@mahendrapaipuri your option requires the runtime to be present in order to call this In any case, circular imports prevent us from doing this (😭), so I guess the |
|
@jjotero Fair enough. Anyways, if I am not wrong, this Another possibility is to use a global |
jjotero
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'm not too worried on whether that timeout gets used elsewhere or not. This could change in the future, who knows. My concern was simply that I wasn't sure if it made sense from a conceptual point of view to have the git option in the config file. And considering all the other options, this is certainly the one that makes more sense to me 👍
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 have just a minor comment regarding the PR as is. On the discussion that you had, I don't think that the fixtures would address this same issue, unless you call git_repo_clone() explicitly, but ReFrame calls that implicitly when sourcesdir refers to a Git repo. So this option practically controls that. Regarding setting the run command timeout globally, I would be against, not only because the utility package should not depend on the runtime, but also because it could have more obscure side effects in the future. I prefer specific options. For example, we used to have a timeout in the past for the sbatch command; I wouldn't want to have this controlled by a very generic option, but rather from a specific scheduler backend option.
|
Hello @mahendrapaipuri, Thank you for updating! Cheers! There are no PEP8 issues in this Pull Request!Do see the ReFrame Coding Style Guide Comment last updated at 2021-10-22 20:49:44 UTC |
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've also added an associated environment variable RFM_GIT_CLONE_TIMEOUT.
git clone timeout config parametergit clone commands
Fixes #2218