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

Refactor client SDK progress bar for vfolder upload and download func APIs #344

Open
achimnol opened this issue Jan 7, 2022 · 2 comments · May be fixed by lablup/backend.ai-client-py#197
Milestone

Comments

@achimnol
Copy link
Member

achimnol commented Jan 7, 2022

The Python client SDK's vfolder upload and download commands display a progress bar when executed in a terminal using tqdm. The issue is that the functional API layer directly uses tqdm, so it may show unwanted stdout outputs when used as a library, though this is controllable using show_progress argument. This is a leak of abstraction.

By the design principle, all terminal manipulation and console outputs should be done inside ai.backend.client.cli (and ai.backend.client.output) only, while ai.backend.client.func should only provide a programming interface without console outputs (but it may include use of logging because logging policy could be controlled by the host program).

  • Let's move invocation of tqdm to ai.backend.client.cli and/or ai.backend.client.output.
  • Let's make a simple progress reporter abstraction so that the functional implementation still could provide the progress information and the CLI output handler could receive it.
@achimnol achimnol added comp:client Related to Client component comp:cli Related to CLI component type:refactor Refactor codes or add tests. labels Jan 7, 2022
@achimnol achimnol added this to the 22.03 milestone Jan 7, 2022
@fregataa
Copy link
Member

fregataa commented Jan 10, 2022

Do aiotusclient should be updated? it also uses tqdm directly
Link

@achimnol
Copy link
Member Author

achimnol commented Feb 9, 2022

Do aiotusclient should be updated? it also uses tqdm directly Link

Yes, I think then aiotusclient should be also updated.
Let's add a progress-reporter abstraction there (since it's a separate library, it should provide its own class) and connect it with our progress reporter.

If done, ask @leksikov for an initial review.

@fregataa fregataa removed their assignment Oct 3, 2022
@achimnol achimnol removed comp:client Related to Client component comp:cli Related to CLI component type:refactor Refactor codes or add tests. labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants