Hi <#CM28LL405|> Can we deploy Prefect 2 Agent on ...
# prefect-cloud
a
Hi #CM28LL405 Can we deploy Prefect 2 Agent on ECS Fargate with Prefect orion UI. I mean with default workspace. Hope Prefect orion UI doesn't have API key and account id.
k
Hi @Anjaneyulu K, you can deploy the agent on ECS and you would just need to give the agent the
--api
to give it the
PREFECT_API_URL
https://docs.prefect.io/concepts/work-queues/#agent-configuration
a
I have installed prefect2 on ec2 and running prefect Orion UI server on particular IP address. And I am running prefect agent with ecs task "prefect agent start -q "demo" --api <prefect Orion api link>". ecs task running fine. But when I do the deployment flows are not running. prefect work-queue is not syncing/active. Can I understand what I am missing in this case
k
Hi @Anjaneyulu K are you setting the workqueue name in the deployment to "demo" as well. The agent is going to pull from the workqueue named "demo" and by default if you do not give a deployment a workqueue, it will go to default. You can check this in the UI on the deployment screen to see which workqueue the flow runs will go to and additionally on the workqueue screen, you should see if there are any late flowruns waiting for the agent to pick up
a
Yes I am setting work queue name "demo" and agent started in ECS . But when I open UI still there are late flow runs. Its not syncing . Queue shows unhealthy itself. Not sure what I am missing. Should I restart prefect Orion UI?
m
Hmmm, can you try setting the PREFECT_API_URL explicitly prior to starting the agent
prefect config set PREFECT_API_URL = "ORION API URL"
, and then see if you can run
prefect deployments ls
It should in theory work either way but I'm curious if your ecs instance is actually able to see any deployments