Nukesor / pueue

:stars: Manage your shell commands.
MIT License
4.69k stars 128 forks source link

Support Display the status of the waiting task only while waiting. #497

Closed kahirokunn closed 2 weeks ago

kahirokunn commented 4 months ago

A detailed description of the feature you would like to see added.

Display the status of the waiting task only while waiting.

Explain your usecase of the requested feature

I want to add a task to pueue and then WAIT to execute it in parallel, but I don't know the status of the task.

Alternatives

No response

Additional context

No response

Nukesor commented 4 months ago

Could you provide a bit more detailed explanation of the requested feature?

I don't get it from your current explanation. A proper usecase and an example would be nice.

Nukesor commented 4 months ago

Since you seem to want to "WAIT" for a task ( even though the title and previous sentence emphasize display), did you take a look at pueue wait?

Nukesor commented 4 months ago

I'm planning to publish a new release soonish.

Is this topic still an issue or can this be closed :)

kahirokunn commented 4 months ago

Thx! Yes, Iā€™m using pueue wait.

IMAGE_TAG=latest

IDS_LIST=()
IDS_LIST+=($(pueue add -p -- docker buildx build --platform linux/arm64,linux/amd64 -t "xxxx.dkr.ecr.ap-northeast-1.amazonaws.com/hoge/hoge-app:${IMAGE_TAG}" --push  -f hoge/Dockerfile .))
IDS_LIST+=($(pueue add -p -- docker buildx build --platform linux/arm64,linux/amd64 -t "xxxx.dkr.ecr.ap-northeast-1.amazonaws.com/hoge/hoge-sidecar:${IMAGE_TAG}" --push  -f fuga/Dockerfile .))

pueue parallel ${#IDS_LIST[@]}
pueue wait ${IDS_LIST[@]}
pueue clean

I want to do something like this. However, this is not enough information to display, and I would like to have at least pueue status information.

Nukesor commented 4 months ago

From the sound of it, it feels like you want an interactive live-updating status interface. There were ideas at some point to build an ncurses interface for pueue: https://github.com/Nukesor/pueue/issues/49

I'm curious, why do you need the pueue status info in your script visible while waiting though? Pueue wait shows all important information on the task's current status.

If you want additional info, you could also have a while true; do pueue status && sleep 1 && clear; done in another terminal.

kahirokunn commented 4 months ago

CleanShot 2024-02-16 at 09 52 24@2x

In pueue wait we would also like to see the logs.

kahirokunn commented 4 months ago

We think it would be nice to see the last part of the log in pueue status as well.

Thx šŸ™

Nukesor commented 4 months ago

I'm sorry, but I have to ask again. I still don't know your usecase, just that you would like to have this implemented.

So let me re-iterate:

Regarding log output of tasks in wait and `status. I don't see a way of doing this without making the UI very crowded and confusing. I would like to see some design proposals first on what you have in mind before discussing this in detail.

kahirokunn commented 4 months ago

The progress of the currently executed task will appear in the log. Being able to check them gives a sense of security while waiting.

kahirokunn commented 4 months ago

If it is just an API, progress may not be necessary. However, I am a human being and would like to see how the task is currently doing.

Nukesor commented 4 months ago

The progress of the currently executed task will appear in the log. Being able to check them gives a sense of security while waiting.

I think this is definitely a good use case for the pueue ncurses tui I mentioned before :)

To have live log output, pueue would have to take control over the terminal, as one would have to show the last lines of log output for each command that's currently running, including cleaning those logs up to keep the wait history clean. That's too much work and functionality for a command that's mainly designed to enable simple scripting.

An interactive tui that allows you to dynamically explore tasks and their logs in a "live" way, seems to be a much better fit, as such a tool would also be easily extensible for further requested features.

I would rather like to build a proper tui from the get-go, instead of patching wait and the other commands until they become a tui by accident.

If it is just an API, progress may not be necessary.

There's sadly no universal way to track progress of tasks, as tasks can contain arbitrary bash and programs don't have a unified way of reporting any kind of progress.

kahirokunn commented 3 months ago

What is pueue ncurses tui? I couldn't find such an option in puepe cli. šŸ‘€

Nukesor commented 3 months ago

It doesn't exist yet :). It was a previously requested feature and would need to be built first.

kahirokunn commented 3 months ago

Okay. Thx.

Nukesor commented 2 weeks ago

I'm closing this for now due to missing specification.

If somebody comes up with a nice design on how to build a interactive TUI, feel free to create a new ticket :)