pythondeploymentprefect

Run flow on prefect cloud without running local agent locally?


I'm trying to deploy my flow but I'don't know what I should do to completely deploy it (serverless).

I'm using the free tier of Prefect Cloud and I have create a storage and process block.

The step I have done :

$ prefect deployment build -n reporting_ff_dev-deployment flow.py:my_flow
$ prefect deployment apply <file.yaml>
from prefect.filesystems import LocalFileSystem
from prefect.infrastructure import Process

#STORAGE
my_storage_block = LocalFileSystem(
    basepath='~/ff_dev'
)
my_storage_block.save(
    name='ff-dev-storage-block',
    overwrite=True)

#INFRA
my_process_infra = Process(
    working_dir='~/_ff_dev_work',
)
my_process_infra.save(
    name='ff-dev-process-infra',
    overwrite=True)
$ prefect deployment build -n <name>  -sb <storage_name> -ib <infra_name>  <entry_point.yml> -a

I know that prefect cloud is a control system rather than a storage medium but as I understand, a store block -> store the code and process code -> run the code. What is the next step to run the flow without local agent ?


Solution

  • Where are you looking for the code to be executed from? With a deployment registered, you can execute the following to spawn a flow run. A deployment just describes how and where -

    prefect deployment run /my_flow