Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HansVRP
Copy link
Contributor

@HansVRP HansVRP commented Jan 22, 2025

No description provided.

@HansVRP
Copy link
Contributor Author

HansVRP commented Jan 22, 2025

@soxofaan does this design match with what we discussed yesterday?

Copy link
Member

@soxofaan soxofaan left a 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,
Copy link
Member

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:
Copy link
Member

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])
Copy link
Member

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":
Copy link
Member

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:
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants