forked from flyteorg/flytekit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto download for fetch (flyteorg#1918)
* Auto download for fetch Signed-off-by: Ketan Umare <[email protected]> * Adds new fetch with download command ` pyflyte fetch --download-to /tmp/. flyte://v1/flytesnacks/development/f5dc81c5a8c6441d4a0a/rotaterotateimage/o/o0` Signed-off-by: Ketan Umare <[email protected]> * Auto download and improved some bugs Signed-off-by: Ketan Umare <[email protected]> * Updated fetch and hitl Signed-off-by: Ketan Umare <[email protected]> --------- Signed-off-by: Ketan Umare <[email protected]>
- Loading branch information
1 parent
31cc37a
commit c91ffba
Showing
7 changed files
with
122 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import typing | ||
|
||
from fsspec import Callback | ||
from rich.progress import Progress | ||
|
||
|
||
class RichCallback(Callback): | ||
def __init__(self, rich_kwargs: typing.Optional[typing.Dict] = None, **kwargs): | ||
super().__init__(**kwargs) | ||
rich_kwargs = rich_kwargs or {} | ||
self._pb = Progress(**rich_kwargs) | ||
self._pb.start() | ||
self._task = None | ||
|
||
def set_size(self, size): | ||
self._task = self._pb.add_task("Downloading...", total=size) | ||
|
||
def relative_update(self, inc=1): | ||
self._pb.update(self._task, advance=inc) | ||
|
||
def __del__(self): | ||
self._pb.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters