core icon indicating copy to clipboard operation
core copied to clipboard

feat request: ability to restart a task via sonmcli

Open nikonov1101 opened this issue 5 years ago • 2 comments

Received feedback from the tech support chat. User wants to have a handle in CLI to restart their tasks. Consider something like sonmcli task restart <deal_id> <task_id>, which should stop the given task, remember the task's image name, and then start a new task with that image.

Note to teammates: how to deal with tasks which resources were restricted by the task.yaml?

nikonov1101 avatar Mar 23 '19 15:03 nikonov1101

Without the atomic guarantee, it can be a situation when you stop the task and there isn't possible to start it again with updated resources. So the only way to do this properly is inside the worker.

3Hren avatar Mar 23 '19 16:03 3Hren

Thanks for comments. I'd mind to implement it as part of the worker, too. That must be more robust - we already have access to the docker API, thus can just restart existing container, moreover, we can keep same task ID which looks good at the user's point of view.

nikonov1101 avatar Mar 23 '19 16:03 nikonov1101