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
Restart jobs, tasks and allocs #122
Restart jobs, tasks and allocs #122
Conversation
Thanks for starting work on this @cshintov ! Check out some of my thoughts thoughts here on overall design for admin stuff and LMK what you think. For this PR, consider incorporating some of that design - it would be cool if the "admin task" table had just a single entry for now, "Restart Job/Allocation " by the end of this work. You can do jobs and allocations/tasks separately over different PRs if you'd like. For each PR, target the |
Continuing here.
Looked into how this can be implemented. Not natively supported by lip gloss. It's in the pipeline. There's a work around though! I think we can postpone this and go with your idea of typing |
I'm happy either way! If the workaround is too complicated and/or doesn't handle edge cases well (eg changing the terminal size while the popup is open breaks things), let's stick with the "type yes" screen for now. If user expediency is a concern, we can accept just typing "y" too. |
Btw, we can't restart a job. I Checked the api code. There's no such function. Probably why the UI also doesn't provide a button for this. When I want to restart a job, I usually add a dummy |
Interesting! Could we issue a stop, poll for when it's stopped, then issue a start? I'm afk so can't look at the nomad api right now. Don't feel you have to implement more than one admin action in this first PR. I would pick the one that's easiest and add just that to the list of admin actions for now. |
f7be088
to
e7f1a9b
Compare
Have implemented just restarting tasks for now, although The UI is not very nice, but does the job. wander-restart-task.webm |
Nice! I'll give the code a review this weekend :) |
e62ecfb
to
5a00563
Compare
Pressing `X` on `JobTasks` page will go to `Admin Menu` which will list variuos admin tasks along with trigger keys. Pressing any of them will go to a confirmation page; then either you can confirm by pressing `y` or go back to `Admin Menu` by `esc`. Also added utility MyDebug function to log to separate file other than `wander.log`.
5a00563
to
d89de2d
Compare
internal/dev/dev.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be open to modifying Debug to read an optional environment variable's value, WANDER_DEBUG_PATH
, and falling back to wander.log
if it's not set. That way we don't need multiple debug functions and devs can still specify their preferred logging path if not wander.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was to rather redirect specific temporary debug logs to a second file for ease of parsing the logs. But the second function can be added ad hoc, no need to keep it in the code. Have removed it.
Btw, what do you use for your debugging, delve
or wander.log
?
Remember to modify |
Thanks, that looks more clean, so I've stolen it all 😂! I've added the Screenshare.-.2024-01-28.11.10.00.PM.webm |
Looks great! Will give this a final review today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left some final comments for you to consider, but feel free to merge whenever you feel good about it. Nice job, thanks so much for this!
93eabf7
to
d5b673a
Compare
Add toast for failures in admin actions
d5b673a
to
bcf1cfd
Compare
Made changes according to the review. Think it's ready now.
But I don't have permission to merge! |
Implements #120
Implemented:
- Add restart task on key
t
- Load job tasks after restarting a task
TODO: