rough-sugar-4818
01/06/2024, 4:00 PMrough-sugar-4818
01/06/2024, 4:12 PMfreezing-airport-6809
freezing-airport-6809
rough-sugar-4818
01/06/2024, 8:12 PMfreezing-airport-6809
rough-sugar-4818
01/06/2024, 10:23 PMrough-sugar-4818
01/06/2024, 10:26 PMdef faster_flyte_file(flyte_file: FlyteFile) -> FlyteFile:
uri: str = flyte_file._remote_source # type: ignore
local_path: str = flyte_file.path # type: ignore
def _downloader():
bucket = uri.split("/")[2]
key = "/".join(uri.split("/")[3:])
s3 = boto3.resource("s3")
s3.Bucket(bucket).download_file(Key=key, Filename=local_path)
os.makedirs(Path(local_path).parent)
flyte_file_with_s3_downloader = FlyteFile(path=local_path, downloader=_downloader)
flyte_file_with_s3_downloader._remote_source = uri # type: ignore
flyte_file_with_s3_downloader.download()
return flyte_file_with_s3_downloader
# then in your task do
flyte_file_fast = faster_flyte_file(flyte_file_slow)
On the small cpu worker I tested the transfer speed increases from ~30MB/s to ~170MB/s.rough-sugar-4818
01/06/2024, 10:33 PMrough-sugar-4818
01/06/2024, 10:35 PMrough-sugar-4818
01/06/2024, 10:42 PMpip install flytekitplugins-async-fsspec
yields an error:
ERROR: Could not find a version that satisfies the requirement flytekitplugins-async-fsspec (from versions: none)
ERROR: No matching distribution found for flytekitplugins-async-fsspec
freezing-airport-6809
freezing-airport-6809
freezing-airport-6809
freezing-airport-6809
rough-sugar-4818
01/06/2024, 11:10 PMrough-sugar-4818
01/06/2024, 11:14 PMflaky-daybreak-42119
01/07/2024, 7:06 AMflaky-daybreak-42119
01/07/2024, 7:07 AMglamorous-carpet-83516
01/08/2024, 8:00 PM