-
Notifications
You must be signed in to change notification settings - Fork 42
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
pull job action away from track_statuses #711
base: master
Are you sure you want to change the base?
Conversation
@soxofaan does this design match with what we discussed yesterday? |
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.
some quick notes
@@ -206,6 +206,7 @@ def __init__( | |||
poll_sleep: int = 60, | |||
root_dir: Optional[Union[str, Path]] = ".", | |||
*, | |||
download: Optional[bool] = True, |
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 think this feature to disable download can be a different feature request and PR
metadata_path = self.get_job_metadata_path(job.job_id) | ||
|
||
self.ensure_job_dir_exists(job.job_id) | ||
job.get_results().download_files(target=job_dir) | ||
if self._download: |
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.
FYI: I think this if
can be moved to the top of this function: if you don't want to download, nothing has to happen here
if previous_status in {"created", "queued"} and new_status == "running": | ||
stats["job started running"] += 1 | ||
active.loc[i, "running_start_time"] = rfc3339.utcnow() | ||
jobs_error.append((the_job, active.loc[i])) | ||
|
||
if new_status == "canceled": | ||
stats["job canceled"] += 1 | ||
self.on_job_cancel(the_job, active.loc[i]) |
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.
jobs_canceled is not handled here
|
||
if new_status == "canceled": | ||
stats["job canceled"] += 1 | ||
self.on_job_cancel(the_job, active.loc[i]) | ||
|
||
if previous_status in {"created", "queued"} and new_status == "running": |
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.
did you move this code block for a reason? I'm not sure that's necessary
@@ -540,6 +542,16 @@ def _job_update_loop( | |||
stats["job_db persist"] += 1 | |||
total_added += 1 | |||
|
|||
# Act on jobs | |||
for job, metadata in jobs_error: |
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.
metadata
might be a bit confusing. I think we use something like row
elsewhere
No description provided.