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

Harmen van Rossum

02/19/2024, 7:39 AM
I'm having a problem withe FlyteFile where remote_path isn't populated. Relevant snippet from the task:
Copy code
bam_file = FlyteFile(path=bam_file)
    remote_bam_file = FlyteFile.new_remote_file(f'{well_reads.well}.bam')
    with bam_file.open("rb") as r:
        with remote_bam_file.open("wb") as w:
            w.write(r.read())
    well_reads.bam_file = remote_bam_file
    return well_reads
Then when I try to access well_reads.bam_file.remote_path later on it's empty. Am I doing something wrong?
y

Yee

02/20/2024, 7:18 PM
can you elaborate more the goal?
it looks like you’re just trying to copy a file?
h

Harmen van Rossum

02/22/2024, 8:07 PM
What I'd like to get is a FlyteFile with a remote path (gs://etc/ ). I took this snippet from the documentation at https://docs.flyte.org/en/latest/api/flytekit/generated/flytekit.types.file.FlyteFile.html#flytekit.types.file.FlyteFile.new_remote_file
y

Yee

02/22/2024, 9:50 PM
for what purpose? are you just trying to write a local file to gcs?
that example is a bit contrived
h

Harmen van Rossum

02/23/2024, 9:08 AM
yeah, basically i want it in the gs flyte directory, so that i can have a look at it later.