-
Notifications
You must be signed in to change notification settings - Fork 7
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
progress: add option to remove spinner & steady tick #12
Comments
I agree the progress bar can be more configurable than current hard-codings, I think at least we want these options:
We may even want to make the entire PROGRESS_STYLE configurable as there are may options that Indicatif suppports. I like using CLI arguments for above options. Would be happy to review a PR @utkarshgupta137 Thanks! |
I am thinking we can add these 2 command line options easily:
@utkarshgupta137 please let me know if you would like to raise a PR for above, if not I am happy to make this change also. thanks! |
I would personally prefer an environment variable for this, otherwise it would crowd out the command line too much. I feel like this is something that you either always want on or always want off & not toggle it on a per invocation basis. Can have both too. |
I pushed a commit here: 24b8257 This disables the steady tick and spinner if stderr is not a terminal, using the builtin @utkarshgupta137 can you please test if this behaves well in your airflow job example? thanks! |
No, doesn't seem to be working. This could partly be because I use ssh command with a pseudo-terminal enabled, so that tasks get killed when I kill them from airflow. |
Thanks for testing @utkarshgupta137 One question to understand - is this the way you are running your jobs?
|
Yeah, it uses get_pty arg for paramiko. |
… a terminal." This reverts commit 24b8257. Did not fix this issue: #12 (comment)
Learned that tracing subscriber (which rust-parallel uses for logging) uses References:
Pushed a commit to make the progress bar check if NO_COLOR environment variable is set to non-empty value. If yes then we decide the terminal does not support ANSI, so disable steady tick and spinner in progress bar: 10d6019 Example usage:
OR
@utkarshgupta137 can you please test this? Thanks! |
In v1.17.0 added See progress bar manual section for more details. @utkarshgupta137 I think Thanks! |
Thank you, it is indeed working. |
We use rust-parallel in an airflow job. Because of the way airflow saves the logs of the jobs, it creates a new line every time the spinner is updated, as it doesn't support ANSI I think. This results in a lot of spam, since this crate has a steady tick of 100ms, we get 2.1M useless log lines, which not only makes the logs useless, it also increases the log storage costs.
I've a fork where I've removed both of these, but I would like to raise a PR with an option to disable this at runtime either via a CLI arg or environment variable (such as TERM or NO_COLOR).
What kind of an interface should we have for this.
The text was updated successfully, but these errors were encountered: