Hi! does the agent will see configuration(envs, wo...
# ask-community
d
Hi! does the agent will see configuration(envs, working dirs and etc) of flow that have been registered on different machine with LocalRun ?
a
The flow run page in the UI will show you the run_config incl. things like env variables regardless of which machine registered the flow:
However, when using the default storage, you may get into troubles when you register from one machine and try to run it from another one, because Prefect won’t be able to find your flow file (i.e. your flow Storage) because it’s on completely different machine. You could leverage some other storage class e.g. S3 or GitHub for such use cases.
d
@Anna Geller I use Git storage. By the way I get this error, when try to run the flow:
Failed to load and execute Flow's environment: TypeError("__init__() missing 1 required positional argument: 'flow_path'",)
but i got flow_path argument, when I attach storage to flow
a
Can you share your flow definition, especially storage?
and run_config
d
@Anna Geller smth like this:
Copy code
f.run_config = LocalRun(env={"VAR": os.environ["VAR"]})
f.storage = Git(repo="path/to/repository",
        repo_host="<http://my.host.com|my.host.com>", use_ssh=True, flow_path="main.py")
a
Did you commit your changes? Once you commit and push, this should work (provided that the ssh etc is properly set up)
additionally, you would need the Git extension and SSH client installed on your local agent too. How do you register your flow? Do you use “prefect register” CLI?
d
@Anna Geller sorry, my bad. I've pushed wrong version of flow
now it works
🙌 1