https://prefect.io logo
#prefect-community
Title
# prefect-community
x

Xavier Babu

04/18/2022, 3:45 PM
Dear Orion community, If I need to deploy a flow (createflow or deployflow) via Orion REST API, how can I pass the flow-location, so that it can pickup the python file from a location?
z

Zanie

04/18/2022, 3:53 PM
Is the location going to be local to the agent’s machine or is it a remote path?
x

Xavier Babu

04/18/2022, 3:54 PM
local to the agent's machine
where I can run prefect deployment create manually (CLI)
z

Zanie

04/18/2022, 3:56 PM
The JSON you want for the
flow_data
field would look like this
'{"encoding": "file", "blob": "/path/to/flow.py"}'
x

Xavier Babu

04/18/2022, 3:58 PM
Thanks, let me try
It works. Thank you so much Michael!
Just curious, do we have an option, if it is a remote path?
z

Zanie

04/18/2022, 9:53 PM
If it’s a remote path, we’ll use fsspec by default to load it
You can construct a “block” document that uses a storage block to read from the path but we’ll be changing that soon and it’s kind of hard to construct so I wouldn’t recommend that at this point.
x

Xavier Babu

04/19/2022, 2:45 PM
Thanks, Michael. Do you have any example for fsspec or block.
sample json
z

Zanie

04/19/2022, 9:12 PM
You can use a blob like
<s3://your-bucket/your-file>
with the same format as above for using fsspec
(I’m pretty sure; this is being changed right now)
Using a block is more complicated as you need to register it beforehand and use an ID — I wouldn’t recommend doing that manually for now. We’ll have easier methods in the future.
x

Xavier Babu

04/20/2022, 4:19 PM
Got it. Thanks, Michael.