Skip to content

feat(gp-cli): tasks restart #9030

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

Closed
wants to merge 1 commit into from

Conversation

andreafalzetti
Copy link
Contributor

Description

This is an attempt of providing gp-cli with a task restart functionality.

Restarting a task can be challenging and this PR is intentionally "lightweight" to get early feedback on the approach.

What I am doing here is leveraging the /terminal/alias/write endpoint of supervisor api. Once I know which task needs to be restart, I "re-write" those commands in the task terminal. It seems to work, but I've only briefly tested and I am concerned of side-effects of re-using the existing terminal (e.g. terminal session related things).

Ideally, we would shutdown the terminal, create a new one, set a title for it and write those commands. However, I didn't see an API endpoint for supervisor to create a new terminal. I've definitely seen capability in the supervisor-cli (supervisor terminal new) so perhaps it's easy to expose such endpoint.

Related Issue(s)

Fixes #8691

How to test

Release Notes

Documentation

@roboquat
Copy link
Contributor

@andreafalzetti: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@iQQBot
Copy link
Contributor

iQQBot commented Mar 31, 2022

Technically, the implementation is fine, but not all tasks can be restarted without side effects, and different tasks can be related, for example, some tasks use commands like gp sync-await to wait for other tasks to complete.

@akosyakov
Copy link
Member

I would call it run and implement in supervisor, i.e. add RunTask method to control.proto which stops the currently running task instance and start another.

@andreafalzetti andreafalzetti deleted the andreafalzetti/restart-task-8691 branch April 7, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gp cli] restart tasks support
5 participants