https://prefect.io logo
#prefect-server
Title
# prefect-server
m

Michael J Hall

09/13/2020, 8:31 PM
Copy code
[linuxserver02 ~]$ prefect backend cloud
Backend switched to cloud
[linuxserver02 ~]$ export PREFECT__CLOUD__AGENT__AUTH_TOKEN=ABC123ABC123123XYZ
[linuxserver02 ~]$ python3.6
Python 3.6.8 (default, Jun 11 2019, 15:15:01)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import prefect
>>> from prefect import task, Flow
>>>
>>> @task
... def hello_task():
...     logger = prefect.context.get("logger")
...     <http://logger.info|logger.info>("Hello, Cloud!")
...
>>> flow = Flow("hello-flow", tasks=[hello_task])
>>> flow.register(project_name="Hello, World!")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/prefect/core/flow.py", line 1594, in register
    no_url=no_url,
  File "/usr/local/lib/python3.6/site-packages/prefect/client/client.py", line 730, in register
    project_name, project_name
ValueError: Project Hello, World! not found. Run `client.create_project("Hello, World!")` to create it.
>>>
2 Views