Skip to content
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

Fix spinner animation blocking user input in diagnostic tool #631

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

parthosa
Copy link
Collaborator

@parthosa parthosa commented Oct 24, 2023

Fixes #630. This PR fixes spinner animation in diagnostic tool as it interferes with the user input.

Changes:

  1. Add pause() and resume() methods in ToolsSpinner.
  2. Store the spinner as a class variable and toggle it later.
  3. Update the logging - write to log only if user input is skipped (using -y flag), else print to console and ask for user input.
  4. Fix cursor getting disappeared by using the flag hide_cursor=False in the spinner.

Output

  1. Default mode and user input is required
psarthi@work:~/tools_dir/$ spark_rapids_user_tools dataproc diagnostic --cluster test-cluster
Processing...⢿
This operation will collect sensitive information from your cluster, such as OS & HW info, Yarn/Spark configurations and log files etc.
Do you want to continue (yes/no): yes
Processing...⣻
Processing Completed!
  1. Default mode and user input is skipped
psarthi@work:~/tools_dir/$ spark_rapids_user_tools dataproc diagnostic --cluster test-cluster -y
Processing...⣻
Processing Completed!
  1. Verbose/Debug mode and user input is required.
psarthi@work:~/tools_dir/$ spark_rapids_user_tools dataproc diagnostic --cluster test-cluster -v
...
INFO rapids.tools.diagnostic.ctxt: Local output folder is set as: /home/psarthi/tools_dir/xyz
DEBUG rapids.tools.diagnostic: Set thread number as: 3
This operation will collect sensitive information from your cluster, such as OS & HW info, Yarn/Spark configurations and log files etc.
Do you want to continue (yes/no): yes
INFO rapids.tools.diagnostic: ======= [Process-Arguments]: Finished =======
INFO rapids.tools.diagnostic: ******* [Execution]: Starting *******
...
  1. Verbose/Debug mode and user input is skipped
psarthi@work:~/tools_dir/$ spark_rapids_user_tools dataproc diagnostic --cluster test-cluster -v -y
...
INFO rapids.tools.diagnostic.ctxt: Local output folder is set as: /home/psarthi/tools_dir/xyz
DEBUG rapids.tools.diagnostic: Set thread number as: 3
WARNING rapids.tools.diagnostic: This operation will collect sensitive information from your cluster, such as OS & HW info, Yarn/Spark configurations and log files etc.
INFO rapids.tools.diagnostic: Confirmed by command line option.
INFO rapids.tools.diagnostic: ======= [Process-Arguments]: Finished =======
INFO rapids.tools.diagnostic: ******* [Execution]: Starting *******
...

Signed-off-by: Partho Sarthi <psarthi@nvidia.com>
@parthosa parthosa added the core_tools Scope the core module (scala) label Oct 24, 2023
@parthosa parthosa self-assigned this Oct 24, 2023
@parthosa parthosa added user_tools Scope the wrapper module running CSP, QualX, and reports (python) and removed core_tools Scope the core module (scala) labels Oct 24, 2023
Copy link
Collaborator

@cindyyuanjiang cindyyuanjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@parthosa parthosa merged commit a96e0d7 into NVIDIA:dev Oct 27, 2023
9 checks passed
@parthosa parthosa deleted the spark-rapids-tools-630 branch October 27, 2023 15:33
@parthosa parthosa added the bug Something isn't working label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user_tools Scope the wrapper module running CSP, QualX, and reports (python)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Spinner animation blocks the input prompt from Diagnostic tool
3 participants