-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add pod_creation_wait_interal #2813
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,10 +213,15 @@ def poll_interval(self): | |
"""How often to poll Kubernetes for job status, in seconds.""" | ||
return self.__DEFAULT_POLL_INTERVAL | ||
|
||
@property | ||
def pod_creation_wait_interal(self): | ||
"""Delay for initial pod creation for just submitted job""" | ||
return 5 | ||
|
||
def __track_job(self): | ||
"""Poll job status while active""" | ||
while not self.__verify_job_has_started(): | ||
time.sleep(self.__DEFAULT_POLL_INTERVAL) | ||
time.sleep(self.poll_interval) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe you have a formatting bug on L287 of this patch. You want to use '%s' instead of '{}' and '%' instead of comma to be stylistically consistent with the rest of the file. I too am running into this one while running one of our more established pipelines btw. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, i fixed it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind. Timestamp issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we might have steered you wrong... Or maybe i misunderstood the code the first time. I'm looking at this more closely and have noticed that now each iteration of this This doesn't seem desirable. It also isn't clear from the user perspective - for 2 intervals to both impact the same wait time. Am i missing something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dlstadther There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I understand the explanation. Most likely this new added |
||
self.__logger.debug("Waiting for Kubernetes job " + self.uu_name + " to start") | ||
self.__print_kubectl_hints() | ||
|
||
|
@@ -276,6 +281,11 @@ def __verify_job_has_started(self): | |
|
||
# Verify that the pod started | ||
pods = self.__get_pods() | ||
if not pods: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I follow the logic here. How would the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm with @honnix . Seems like you'd want to re-eval There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, thanks |
||
self.__logger.debug( | ||
'No pods found for {}, waiting for cluster state to match the job definition', self.uu_name | ||
) | ||
time.sleep(self.pod_creation_wait_interal) | ||
|
||
assert len(pods) > 0, "No pod scheduled by " + self.uu_name | ||
for pod in pods: | ||
|
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.
Please use a constant similar as
__DEFAULT_POLL_INTERVAL
, also in docstring please describe the unit so it would be easier to follow.