Αλκιβιάδης Σαββόπουλος
10/03/2024, 11:41 AMcontrolflow
inside Prefect Cloud. Is this functionality supported ? Am I overseeing something ? Thank you in advance.Jeremiah
Αλκιβιάδης Σαββόπουλος
10/04/2024, 10:03 AMΑλκιβιάδης Σαββόπουλος
10/04/2024, 10:04 AMfrom prefect import flow, task
@task
def task_one():
print("Hello from task 1")
@task
def task_two():
print("Hello from task 2")
@task
def task_three():
print("Hello from task 3")
@flow
def flow_that_registers():
task_one()
task_two()
task_three()
if __name__ == "__main__":
flow_that_registers()
by just hitting python my_flow.py
, I can see the run on Prefect Cloud. See the screenshot.Αλκιβιάδης Σαββόπουλος
10/04/2024, 10:05 AMimport controlflow as cf
@cf.flow
def flow_that_doesnt(x):
y = cf.run('Add 5 to the number', result_type=int, context=dict(x=x))
z = cf.run('Multiply the result by 2', result_type=int)
return z
if __name__ == "__main__":
flow_that_doesnt(100)
with python my_controlflow.py
, the script executes, but I see nothing in Prefect Cloud.Αλκιβιάδης Σαββόπουλος
10/04/2024, 10:05 AMJeremiah
Jeremiah
Jeremiah
Αλκιβιάδης Σαββόπουλος
10/07/2024, 7:42 AMΑλκιβιάδης Σαββόπουλος
10/07/2024, 9:20 AMfrom pathlib import Path
import controlflow as cf
@cf.flow
def flow_that_doesnt(x):
y = cf.run('Add 5 to the number', result_type=int, context=dict(x=x))
z = cf.run('Multiply the result by 2', result_type=int)
return z
if __name__ == "__main__":
flow_that_doesnt.from_source(
source=str((p := Path(__file__)).parent.resolve()),
entrypoint=f"{p.stem}.py:flow_that_doesnt",
).deploy(name="my-first-cf-deployment",
tags=["cf-pls-run"],
parameters={"elemeiooooooo": True},
work_pool_name="wp1",
interval=10*60)
I am getting an error that the work pool cannot be detected, even though I have the exact workpool with the exact name.
Part of the error is :
prefect.exceptions.PrefectHTTPStatusError: Client error '404 Not Found' for url '<http://127.0.0.1:8471/api/work_pools/wp1>'
Response: {'detail': 'Work pool "wp1" not found.'}
Does this mean that controlflow is not looking at my cloud, but tries to detect locally the workpools ?
i have authenticated with prefect cloud login
, is there any additional controlflow cloud login
that I should perform ?Jeremiah