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

queue: update kill ui messages #8798

Merged
merged 5 commits into from
Jan 25, 2023
Merged

queue: update kill ui messages #8798

merged 5 commits into from
Jan 25, 2023

Conversation

dberenbaum
Copy link
Contributor

Fix #8797

@@ -316,7 +319,7 @@ def _try_to_kill_tasks(
self.proc.kill(queue_entry.stash_rev)
else:
self.proc.interrupt(queue_entry.stash_rev)
logger.debug(f"Task {rev} had been killed.")
ui.write(f"Task {rev} has been killed.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task or expriment?

(in VS Code we won't be able to use Task, for DVC it might make sense if command is dvc queue ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think either is necessary here, so I just dropped "Task."

@@ -316,7 +319,7 @@ def _try_to_kill_tasks(
self.proc.kill(queue_entry.stash_rev)
else:
self.proc.interrupt(queue_entry.stash_rev)
logger.debug(f"Task {rev} had been killed.")
ui.write(f"Task {rev} has been killed.")
Copy link
Member

@skshetry skshetry Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move ui messages to respective commands. It's hard to change existing ones, but newer commands should try to put UI related outputs in commands as much as possible, and internals should be designed in such a way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we show this to the users maybe we should also show the message in line 340

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we show this to the users maybe we should also show the message in line 340

Not sure I follow @karajan1001. You mean Task id {task_id} rev {remained_entries[entry]} marked as failure? I'm not sure it's needed.

@skshetry Do you have a suggestion for how to do it here? I'd like for any valid tasks to get killed and show a success message for each as they are killed, and finally return an error if there were any invalid tasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to look into it.

@skshetry
Copy link
Member

There are merge conflicts, @dberenbaum. Could you please resolve them?

@codecov
Copy link

codecov bot commented Jan 24, 2023

Codecov Report

Base: 93.71% // Head: 93.72% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (6009e91) compared to base (ea2e5dc).
Patch coverage: 87.50% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8798   +/-   ##
=======================================
  Coverage   93.71%   93.72%           
=======================================
  Files         453      453           
  Lines       36146    36154    +8     
  Branches     5239     5240    +1     
=======================================
+ Hits        33875    33884    +9     
  Misses       1761     1761           
+ Partials      510      509    -1     
Impacted Files Coverage Δ
dvc/repo/experiments/queue/celery.py 87.77% <60.00%> (+1.48%) ⬆️
dvc/repo/experiments/exceptions.py 80.35% <100.00%> (+0.72%) ⬆️
tests/unit/repo/experiments/queue/test_celery.py 96.61% <100.00%> (+0.18%) ⬆️
tests/unit/repo/experiments/conftest.py 90.62% <0.00%> (-4.69%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@skshetry skshetry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to block this PR for too long. On a quick look, it seems that we should split the kill into two interfaces: list_tasks and actual kill_task.

@skshetry skshetry merged commit a8d193b into main Jan 25, 2023
@skshetry skshetry deleted the queue-kill-ui branch January 25, 2023 14:23
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.

queue kill: add a message when it's successfully run
4 participants