https://prefect.io logo
Title
s

Shreyansh Pandey

05/21/2020, 8:33 PM
Hey, community! So I had a question from more of an operational perspective. From what I understand, I am supposed to start the Prefect server which will bootstrap, provision and start the dependent services (Postgres, Hasura, etc.) Then we have agents which communicate with the Prefect API to get flows assigned to them and, vis-a-vis, execute them. Imagine I have two servers: server A and server B. Server A is responsible only for the Prefect backend and Server B is my agent farm containing 5 agents. For the purpose of this question, assume that they are in the same CIDR/subnet and can communicate with each other. How would I tell what domain name/IP address my Prefect server is running on so that it can communicate and function like it's supposed to. Another question which arises from this is how would this look like as a standard version-controlled workflow? Imagine I have a repository on my Git servers which contains my flow definition; how will the CI function to automatically register new flows or update existing ones?
🤔 1
đź‘€ 1
d

Dylan

05/21/2020, 8:44 PM
Hi @Shreyansh Pandey! When you call `prefect agent start`/`prefect agent install` you can pass an
--api
parameter with the URI of your Prefect Server instance and your agents will poll for work from that server.
This isn’t included in the
-h
description in the CLI, I’m opening an issue which I will link here
s

Shreyansh Pandey

05/21/2020, 8:46 PM
Ah, got it! This also isn't mentioned in the Orchestrating/Core documentation pages. I may have missed it, though.
d

Dylan

05/21/2020, 8:46 PM
Thank you for pointing that out, I will include that in the issue as well 👍
s

Shreyansh Pandey

05/21/2020, 8:46 PM
Absolutely! 🔥
🙇‍♂️ 1
@Shreyansh Pandey an amendment to my previous statement:
prefect agent start
doesn’t respect the
--api
flag, only the
install
command does. For
prefect agent start
you’ll need to have a
~/.prefect/config.toml
file on the machine the agent is running on. Make sure to run
prefect backend server
on that machine to set the proper config for you and then add the following:
[server]
endpoint = "https://{your prefect server backend address}
So server.endpoint will work if they ran prefect backend server prior