Dinu Gherman
09/16/2020, 1:29 PMprefect backend server
and prefect server start
, got the web UI up and wonder how I can make the standard hello world example below appear in that UI? Do I need a “project”? If so how do I wire that up with the example code running?
from prefect import task, Flow, Parameter
@task(log_stdout=True)
def say_hello(name):
print("Hello, {}!".format(name))
with Flow("My First Flow") as flow:
name = Parameter('name')
say_hello(name)
flow.run(name='world') # "Hello, world!"
flow.run(name='Marvin') # "Hello, Marvin!"
josh
09/16/2020, 1:31 PMregister
it to that project. I recommend walking through this deployment tutorial which will outline some of these features 🙂 https://docs.prefect.io/orchestration/tutorial/first.htmlDinu Gherman
09/16/2020, 1:31 PMflow.register(project_name="Project1")
to some sample code, I get this error below.ClientError: Malformed response received from Cloud - please ensure that you have an API token properly configured.
josh
09/16/2020, 1:59 PMprefect backend server
on that same machine? That is an error when attempting to talk to Cloudprefect diagnostics
and see the backend setDinu Gherman
09/16/2020, 2:00 PMjosh
09/16/2020, 2:01 PMDinu Gherman
09/16/2020, 2:01 PM$ prefect diagnostics
{
"config_overrides": {},
"env_vars": [],
"system_information": {
"platform": "Darwin-18.7.0-x86_64-i386-64bit",
"prefect_backend": "server",
"prefect_version": "0.13.6",
"python_version": "3.7.6"
}
}
josh
09/16/2020, 2:02 PMDinu Gherman
09/16/2020, 2:02 PMjosh
09/16/2020, 2:03 PMfrom prefect import config
print(config.backend)
Dinu Gherman
09/16/2020, 2:04 PMjosh
09/16/2020, 2:04 PMprefect backend server
Dinu Gherman
09/16/2020, 2:08 PMflow.run_agent()
I still had to run the flow in the UI manually, which came up with unenxpected strings like “nickel-roadrunner” 😉 I guess there is some way to start the entire flow from code, too…