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

[MOD-3267] progress bar for volume/nfs put/get #1969

Merged
merged 22 commits into from
Jul 16, 2024

Conversation

kramstrom
Copy link
Contributor

@kramstrom kramstrom commented Jul 5, 2024

Adds progress bars when uploading and downloading files / directories to volumes and network file systems

Example screenshot of what it looks like when in progress

upload

We still have some magic spinner for "post processing" once files are uploaded to the server but the server is doing some work. Added a TODO for that but it would require more work on the server to send progress reports which we don't currently have

@thundergolfer thundergolfer self-requested a review July 5, 2024 21:23
@kramstrom kramstrom changed the title WIP: volume file upload progress bar ]MOD-3267] progress bar for volume put/get Jul 12, 2024
@kramstrom kramstrom changed the title ]MOD-3267] progress bar for volume put/get [MOD-3267] progress bar for volume put/get Jul 12, 2024
def _advance_sub_task(self, task_id: TaskID, advance: float):
self._download_progress.update(task_id, advance=advance)

def progress(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we should wrap this in a try-catch block and just log warnings instead of crashing if the progress handler breaks, unintuitive for the user but at least their upload/downloads wouldn't stop for some UI crash

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm possibly. If the failure case is a bug then I'd lean on hard-failing to surface them more prominently. I don't there's really are other failure cases because this is all in-memory or writing to stdout, which have a very low probability of a transient fault.

@kramstrom kramstrom marked this pull request as ready for review July 12, 2024 21:25
@kramstrom kramstrom changed the title [MOD-3267] progress bar for volume put/get [MOD-3267] progress bar for volume/nfs put/get Jul 12, 2024
@erikbern
Copy link
Contributor

Nice!

@ekzhang
Copy link
Member

ekzhang commented Jul 15, 2024

Fantastic work

@mwaskom
Copy link
Contributor

mwaskom commented Jul 15, 2024

Looks really nice!

Apologies if this is a dumb question as I just skimmed the diff so far, but will this avoid creating thousands of progress bars if people upload a directory with many files?

@kramstrom
Copy link
Contributor Author

Looks really nice!

Apologies if this is a dumb question as I just skimmed the diff so far, but will this avoid creating thousands of progress bars if people upload a directory with many files?

Not at all! Since the progress bars are wrapped in a Live display they will by default only display up to the size of the terminal you're running in.

@mwaskom
Copy link
Contributor

mwaskom commented Jul 15, 2024

Since the progress bars are wrapped in a Live display they will by default only display up to the size of the terminal you're running in.

👌 perfect!

Copy link
Contributor

@thundergolfer thundergolfer left a comment

Choose a reason for hiding this comment

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

lovely 👍

def _advance_sub_task(self, task_id: TaskID, advance: float):
self._download_progress.update(task_id, advance=advance)

def progress(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm possibly. If the failure case is a bug then I'd lean on hard-failing to surface them more prominently. I don't there's really are other failure cases because this is all in-memory or writing to stdout, which have a very low probability of a transient fault.

@@ -165,6 +177,7 @@ async def perform_multipart_upload(
part_urls: List[str],
completion_url: str,
upload_chunk_size: int = DEFAULT_SEGMENT_CHUNK_SIZE,
progress_report_cb: Callable,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
progress_report_cb: Callable,
progress_report_cb: Optional[Callable],

because it's called by _blob_upload which itself has an optional param.

I think this might not be caught because this function is missing its return type annotation, which should be -> None

@kramstrom kramstrom merged commit 852e49e into main Jul 16, 2024
22 checks passed
@kramstrom kramstrom deleted the kramstrom/add-volume-file-upload-progress-bar branch July 16, 2024 15:21
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 this pull request may close these issues.

None yet

5 participants