Dear Orion community, If I need to deploy a flow (...
# ask-community
x
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
Is the location going to be local to the agent’s machine or is it a remote path?
x
local to the agent's machine
where I can run prefect deployment create manually (CLI)
z
The JSON you want for the
flow_data
field would look like this
'{"encoding": "file", "blob": "/path/to/flow.py"}'
x
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
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
Thanks, Michael. Do you have any example for fsspec or block.
sample json
z
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
Got it. Thanks, Michael.