Thread
#prefect-community
    Xavier Babu

    Xavier Babu

    5 months ago
    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?
    Michael Adkins

    Michael Adkins

    5 months ago
    Is the location going to be local to the agent’s machine or is it a remote path?
    Xavier Babu

    Xavier Babu

    5 months ago
    local to the agent's machine
    where I can run prefect deployment create manually (CLI)
    Michael Adkins

    Michael Adkins

    5 months ago
    The JSON you want for the
    flow_data
    field would look like this
    '{"encoding": "file", "blob": "/path/to/flow.py"}'
    Xavier Babu

    Xavier Babu

    5 months ago
    Thanks, let me try
    It works. Thank you so much Michael!
    Just curious, do we have an option, if it is a remote path?
    Michael Adkins

    Michael Adkins

    5 months ago
    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.
    Xavier Babu

    Xavier Babu

    5 months ago
    Thanks, Michael. Do you have any example for fsspec or block.
    sample json
    Michael Adkins

    Michael Adkins

    5 months ago
    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.
    Xavier Babu

    Xavier Babu

    5 months ago
    Got it. Thanks, Michael.