core
core copied to clipboard
feat request: ability to restart a task via sonmcli
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
?
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.
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.