Jay Sundaram
03/19/2021, 1:55 AMprefect backend server
prefect server start
prefect create project etl-project
prefect agent local start --label etl-label
prefect register flow --file simple_flow.py --name a-simple-etl-flow -l etl-label -p etl-project
In the UI, I can click on QUICK RUN and observe the flow execute.
Next , in another simple script named start_flow_run.py:
from prefect.tasks.prefect.flow_run import StartFlowRun
kickoff_task = StartFlowRun(
project_name='etl-project',
flow_name='a-simple-etl-flow'
)
which I execute like this:
python start_flow_run.py
But nothing happens.
The agent doesn't detect it; no activity in the UI.
I was expecting my registered flow named 'a-simple-etl-flow' to execute.
Please advise. Thanks.from prefect.tasks.prefect.flow_run import StartFlowRun
kickoff_task = StartFlowRun(
project_name='etl-project',
flow_name='a-simple-etl-flow'
)
kickoff_task.run()
Might want to update the example in the documentation to indicate that kickoff.run() is required.Chris White
Jay Sundaram
03/19/2021, 3:00 AMChris White
Jay Sundaram
03/19/2021, 3:36 AMChris White
Jay Sundaram
03/19/2021, 2:18 PMprefect auth create-token -n runner_token -s RUNNER
Usage: prefect auth [OPTIONS] COMMAND [ARGS]...
Error: Auth commands with server are not currently supported.
In the UI (I believe the only other way to create RUNNER tokens), the API Token option is grayed out:Chris White
Jay Sundaram
03/21/2021, 7:10 PMChris White
<https://localhost:8080/graphql>
Jay Sundaram
03/21/2021, 7:22 PMChris White
from prefect import Client
c = Client() # will autodetect your configuration
c.create_flow_run(flow_id)
Jay Sundaram
03/21/2021, 7:30 PMChris White
version_group_id=XXXX
as a keyword argument instead of flow id and the backend will trigger a run for the latest version of the flow without you having to update the flow ID each timeJay Sundaram
03/21/2021, 7:42 PM