Hi everyone, I trying to figure out how to registe...
# prefect-server
y
Hi everyone, I trying to figure out how to register the prefect flows with hosted prefect server instead local. Is there any documentation for that?
a
Yes, check out this page The most important part is this:
Copy code
[server]
  [server.ui]
  apollo_url="<http://localhost:4200/graphql>"
y
Its like my prefect register code will be a sep container and prefect server in other container. Im trying to figure out how to make communication between them.
a
Exactly as I described above 🙂 Replace localhost by your Server public IP and add this configuration to your ~/.prefect/config.toml on the machine from which you register your flows.
Copy code
[server]
  [server.ui]
  apollo_url="<http://localhost:4200/graphql>"
y
Thanks anna, I will try to do it in this way. Then what is the use of this particular class
_class_ prefect.client.client.Client
?
a
to talk to the API from Python e.g. if you want to query the graphQL API - the API reference will give you more info: https://docs.prefect.io/api/latest/client/client.html
y
@Anna Geller My prefect registration code is one container and prefect server is in other. I tried to pass the graphql server api in this way
client = prefect.Client(api_server=os.getenv('GRAPHQL_SERVICE_HOST'))
. where below are the env when im docker composing my prefect registration code.
Copy code
environment:
      GRAPHQL_SERVICE_HOST: <http://apollo:4200/graphql>
I was able to fetch all the pre-registered flow and runs, but I was not able to register a flow. Here is how I'm registring
Copy code
.......
    with Flow(name=group_name) as flow:
        result = create_config(group_name)
        start_orchestration(result[0], result[1], result[2])
    _id = flow.register(project_name='Test')
......