https://flyte.org logo
#ask-the-community
Title
# ask-the-community
y

Yahia Salem

02/29/2024, 9:26 AM
Hello everyone, I have directory stored in an
gcs
bucket, but everytime execute the workflow I will use a different bucket the question is, how can I download a directory to be used by the first task, I’m well aware that
FlyteDirectory
is used to pass dirs between tasks, but can I use it to download the dir for the first task? What I’ve tried so far is this code, but it does not work, I can’t find the directory Thanks!
Copy code
@task
def t1(input_dir: str) -> str:
    dir = FlyteDirectory(path=input_dir)
    dir.download()

    import os

 
    return str(os.listdir())
k

Kevin Su

02/29/2024, 10:03 AM
you could change the type of the input to
FlyteDirectory
, and use
input_dir.download()
to download the directory
5 Views