Hi, I'm wondering if it is possible to run the exe...
# ask-community
d
Hi, I'm wondering if it is possible to run the executor on the same EC2 instance that is running the agent?
k
Hi @Derek Heyman, the agent will deploy a flow which will basically create a new Python process by default so yes the default local agent will run on the same compute at the EC2 instance
d
Hi @Kevin Kho, how do I set this up? Is there a specific flow executor or flow run config I need to specify to make that happen? Are there any specific server options that need to be enabled?
Copy code
`run_config` of type `LocalRun`, only `ECSRun` is supported
k
It seems like you are using an ECS agent? Is that intentional? I think you want Local agent EC2?
The RunConfigs pair with the corresponding Agents. LocalRun with Local Agent and ECSRun with ECS Agent
d
I spun up an EC2 instance and installed everything for the prefect agent. I started it like this:
Copy code
prefect agent ecs start --launch-type EC2
How do I set up my EC2 instance as an EC2 agent if this is incorrect?
OK so I think I have this working now. The agent running on the ec2 instance should be run as a local agent as you suggested. In addition, I needed to add a label that matches the label for the registered flow. prefect agent local start -l test_label And when registering your flow: flow.run_config = LocalRun(labels=["test_label"])
k
Hey sorry my responses are a bit delayed as I am at Kubecon this week. That sounds right yep! I take this is working now?
d
Yup I'm set there. I'm working on making a request through the API to trigger a flow (not through CLI because I don't want to set up the environment for that in aws lambda). Working through an authentication error at the moment. Have a good time at Kubecon!
k
Sounds good 🙂 .