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

Adding build progress callback to ImageCollection.build #3152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

axel7083
Copy link

@axel7083 axel7083 commented Jul 4, 2023

Description

Since the ImageCollection.build function return (image_id, result_stream), it cannot be used as generator for getting progress. I added a progress_callback: Callable[[int, int, str], None] functions that can be passed as argument when building an image.

The existing program is already parsing the stream from BuildApiMixin.build, I simply added a regex which is looking for string matching the format Step X/Y: details, and sending to the callable function the current_step, the maximum number of step, and the step details.

Related issues

@axel7083 axel7083 changed the title Adding build progress callback to client.images.build Adding build progress callback to ImageCollection.build Jul 4, 2023
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

1 participant