if i try to connect to a local prefect server with...
# prefect-server
s
if i try to connect to a local prefect server with a prefect agent inside a docker container by using: prefect agent start --api http://192.168.1.1:4200/graphql, no flow gets deployed to the server. is there anything i am missing?
d
Hi @sebastian.clanzett! Just to clarify, running an agent and registering a flow are two different actions. Once you register a Flow, you can schedule Flow Runs. Then, the agent should (in the case of a Docker agent) pull and run that Flow’s specified container to create a Flow Run
So, even if you have a Prefect Server instance and an Agent running, you still need to register your Flow with your Prefect Server instance
s
I do know that. And of course i did register and trigger the flow. 😉
My guess is that this has something todo with running the agent inside the docker container while server is running on a different host
But i still dont have a clue
d
You may need to provide a URI to your agent to connect to server
s
Thats what i did with --api . But i found the missing part. If i register a new flow the flow automatically gets a label with the name of the host where the flow has been created. So what i need to do is somehow alter this label so that the agent can pick up the job
d
Ah yes my apologies. For the local executor, we add labels with the name of your machine. If your local agent is also running on that machine, you can add a label with your machine’s name with
--labels
at agent start
I added a comment to this issue outlining the snag you ran into. We’ll do our best to make this process a bit clearer/easier: https://github.com/PrefectHQ/prefect/issues/3242