Hello. I'm new to Flyte, trying to test setup on l...
# flytekit
Hello. I'm new to Flyte, trying to test setup on local sandbox before attempting AWS deploy. Running WSL2 Ubuntu on Windows with Docker Desktop to produce a localhost remote cluster. What I don't quite understand is how files are stored. e.g. running this within a workflow:
Copy code
# write to local path
out_path =  flytekit.current_context().working_directory
with open(os.path.join(out_path, 'test2.txt'), 'w') as f:
        pth = f.name
return pth
If i run this locally (in Windows terminal) I get something like:
If I run with --remote I get e.g.
I'd like to set up to use a folder (e.g. C:\Users\<user>\projectA\data and C:\Users\<user>\projectA\output) and run locally and then with --remote on the WSL2 hosted flytectl. Eventually will move to S3 but useful to have the local option for testing. C: is available in wsl under \mnt\c Ideas? Help?
hi @Peter Davidson firstly warmest welcome to the community. Thank you for joining
when running locally, files are stored in a temp directory.
but i dont quite understand the question, maybe a little more of a working example can help
Running the code, localy from windows returns:
Running it --remote in the sandbox returns:
The remote path is not very useful. How do you direct the output of flyte to a specific folder? Is this a flyteconfig setting or should I uzse FlyteFile or? Similarly, I would like to be able to point it to input files. --- Code:
Copy code
import os
import flytekit
from flytekit import task, workflow

def put_file() -> str:
    # write to local path
    out_path = os.path.expanduser('~')
    # out_path = flytekit.current_context().working_directory
    # out_path = '//root'
    with open(os.path.join(out_path, 'test.txt'), 'w') as f:
        pth = f.name
    # with open(os.path.join(home, 'test.txt'), 'r') as f:
    #     pth = f.read()
    return pth

def wf() -> str:
    return put_file()
You can send
pyflyte register
command to store the offloaded data.
Thanks. I need a bit more hand-holding. Say I run this:
pyflyte register flytest.py --raw-data-prefix C:\Users\<user>\flytest
What does this enable?
It’ll store the flyte offloaded data, i.e., the data returned from the flyte tasks in the given path.
thanks -> so how do I access this folder from within a workflow?
So when you pass a flytefile or a dataframe etc it is automatically stored and retrieved from the location in the background
This is done transparently so that it can be stored efficiently and relieves the burden of creating new locations. Also avoids corruption and makes the entire system portable