https://prefect.io logo
a

Alex Welch

02/12/2021, 7:45 PM
Hello! I am running the hello-world flow and trying to get it running in the cloud. However when I do I get the following error
{'type': ['Unsupported value: UniversalRun']}.
It works locally. Here is my code:
Copy code
import prefect
from prefect import task, Flow

@task
def say_hello():
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>("Hello, Cloud!")

with Flow("hello-flow") as flow:
    say_hello()

flow.register(project_name="tutorial")
z

Zanie

02/12/2021, 8:00 PM
Hi @Alex Welch, can you give the output of
prefect diagnostics
?
a

Alex Welch

02/12/2021, 8:23 PM
do i run that locally or somewhere in the cloud ui
z

Zanie

02/12/2021, 8:28 PM
On the machine where your agent is running / the machine where you are writing your flow if they're different
a

Alex Welch

02/12/2021, 8:35 PM
z

Zanie

02/12/2021, 8:40 PM
Great thanks, that looks normal. What kind of agent are you running? Where are you seeing this error?
j

Jim Crist-Harif

02/12/2021, 8:41 PM
I am running the hello-world flow and trying to get it running in the cloud. However when I do I get the following error
{'type': ['Unsupported value: UniversalRun']}.
In the future when presenting errors, please try to provide some context around where the error message appears and what action(s) led to it. An error message with no context or traceback is hard for us to interpret. From the above discussion, I'm guessing you're seeing that message on the flow run page in the UI? This likely indicates that the agent you're running is on an old version of prefect and should be updated.
a

Alex Welch

02/12/2021, 8:44 PM
i am seeing it on the flow run
sorry, i am brand new to prefect so I dont have a lot of knowledge in terms of what information needs to be shared
in the UI
j

Jim Crist-Harif

02/12/2021, 8:46 PM
no worries, just general feedback to make the process smoother next time. As stated above, this likely means your agent is on an old version of prefect. Not sure what agent you're running or where, but that'd be the first thing I'd check.
a

Alex Welch

02/12/2021, 8:47 PM
how do i check the agent version
i installed via
pip install prefect
so i didnt do anything specific
j

Jim Crist-Harif

02/12/2021, 8:47 PM
Are you running a local agent then?
a

Alex Welch

02/12/2021, 8:47 PM
i am
j

Jim Crist-Harif

02/12/2021, 8:47 PM
In the same environment/terminal that you started the agent, what does
prefect version
output?
a

Alex Welch

02/12/2021, 8:48 PM
0.14.8
j

Jim Crist-Harif

02/12/2021, 8:48 PM
Hmmm, interesting.
Are you the only user of your tenant in prefect cloud?
a

Alex Welch

02/12/2021, 8:48 PM
oh really interesting
i ran it in another terminal just to check and i got0.13.14
j

Jim Crist-Harif

02/12/2021, 8:49 PM
Ah, so you have an old version around somewhere.
An agent running prefect < 0.14.0 would get the error you have, so this is likely the issue.
a

Alex Welch

02/12/2021, 8:49 PM
makesd sense
ill run in it in the terminal with that version and see what happens
z

Zanie

02/12/2021, 8:54 PM
The
which prefect
command might help you track down where the other version is coming from
👍 1
a

Alex Welch

02/12/2021, 8:54 PM
it worked
awesome
thank you
for my edification, the cloud UI is using my local agent to manage all the scheduling and the like correct?
so I would need to set up an other agent which would be responsible for our production runs
z

Zanie

02/12/2021, 8:55 PM
The backend schedules the runs, the local agent just picks them up when they are ready to run.
You'll have to clarify what you mean 🙂
a

Alex Welch

02/12/2021, 8:56 PM
fair enough
z

Zanie

02/12/2021, 8:56 PM
Prefect Agents are lightweight processes for orchestrating flow runs. Agents run inside a user's architecture, and are responsible for starting and monitoring flow runs. During operation the agent process queries the Prefect API for any scheduled flow runs, and allocates resources for them on their respective deployment platforms.
Note that both Prefect Agents (and flow runs) only send requests out to the Prefect API, and never receive requests themselves. This is part of our Hybrid Execution Model, and helps keep your code and data safe.
A single agent can manage many concurrent flow runs - the only reason to have multiple active agents is if you need to support flow runs on different deployment platforms.
a

Alex Welch

02/12/2021, 8:58 PM
ok gotcha
so I need to deploy an Agent to our architecture some where
z

Zanie

02/12/2021, 8:58 PM
To pair development runs with an agent and production runs with another you can use labels
Yep
a

Alex Welch

02/12/2021, 9:04 PM
ok, yeah i think tha tmakes sense. Are there any documents (i looked but may have missed) that detail what a production system might look like?
other than hosting then, what is the benefit of the cloud over teh locally ran server
z

Zanie

02/12/2021, 9:48 PM
Server doesn't scale nearly as well as Cloud and doesn't provide authentication (there is no concept of a user) or "overview" features such as checking on flow runtimes.
a

Alex Welch

02/12/2021, 9:49 PM
ok, final question. I’m looking at the docker agent. I was having an issue earlier when trying to use prefect locally via the docker image 
docker run -it prefecthq/prefect:latest
 , when i then run 
prefect server start
 I get a FileNotFoundError looking for a docker-compose file. I am running the command in the docker container.
is this because the official docker container is the agent and not the server?
z

Zanie

02/12/2021, 9:51 PM
The official docker image is a base image for running flows (as noted in the little blurb it displays)
prefect server start
uses docker-compose to spin up many containers which is tricky to do from within a docker container (I would not recommend trying to run it that way)
a

Alex Welch

02/12/2021, 9:52 PM
right, so you need prefect locally as well if you want to execute in the docker container
locally meaning not containerized
z

Zanie

02/12/2021, 9:53 PM
Ah you need Prefect somewhere if you want to run your own Prefect API
If you want to execute the flow in a docker container you can also do so with a
DockerRun
and Prefect Cloud / Server without necessarily having prefect installed on your development machine
a

Alex Welch

02/12/2021, 9:55 PM
but i still need an agent somewhere
z

Zanie

02/12/2021, 9:59 PM
Yes, you'll need to run a docker/ecs/k8s agent in your infrastructure.
a

Alex Welch

02/12/2021, 9:59 PM
thanks
z

Zanie

02/12/2021, 9:59 PM
This is because all communication with Prefect is one-directional (you -> backend) as a part of the hybrid model so we can't execute anything in your infrastructure.
a

Alex Welch

02/12/2021, 10:00 PM
right and that makes sense
and you dont have an option to use agents you’ve provided (something similar to how GitLab does shared runners)
z

Zanie

02/12/2021, 10:02 PM
Sorry I'm not familiar with their shared runners. By "agent's we've provided" you mean the option of executing flows in our infrastructure or some shared/hosted infrastructure?
a

Alex Welch

02/12/2021, 10:02 PM
correct
z

Zanie

02/12/2021, 10:07 PM
Ah yeah there's nothing like that right now.
a

Alex Welch

02/12/2021, 10:07 PM
ok, good to know
thank you for all your help