Hi - can someone point out what I'm missing in the...
# ask-community
p
Hi - can someone point out what I'm missing in the following set up - I have a Server stood up, and separate machine running:
Copy code
prefect agent local start --api http://<server_IP>:4200
I've registered the flows on the agent machine, and the server can see the agent as is evident in the GUI. However, the registered flows are not showing up.
k
Hey @Philip MacMenamin, did you do
prefect backend server
?
p
I did... on both machines actually now that I think about it 🤔
k
Is the flow you registered from on a different machine than the server? How did you configure the API endpoint?
p
Essentially I've been running the agent on the same machine as the server, and now I'd like to run the flows on another machine. All I've done is stop the agent that's running on the server machine, and started up an agent on another machine running a prefect agent, I registered the flows on the agent machine.
Maybe there's a walkthrough on this that I'm missing. Conceptually I thought you could set up agents running on various machines, which can connect to a server (via 4200) and await jobs.
I suspected that I'd need some class of key to get in to that server. And there is a key argument, although I seem to be able to connect to the server without a key.
I tried to gen a key similar to the mutation listed here https://docs.prefect.io/orchestration/concepts/api_keys.html#using-api-keys but it's not clear to me what a user_id is in this context.
k
You shouldn’t need that for server since there is no auth. Did you configure your
config.toml
to point to <VM-IP>:4200 instead of localhost:4200? This would be done for all machines trying to reach that server (agent or flow registration)
p
I did not. I need to do this as well as tell the agent to connect to server IP? I just created a config.toml file such that:
Copy code
$ cat .prefect/config.toml 
api = "http://<server_IP>:4200"
k
Here is the right syntax for that
config.toml
p
ok, currently
Copy code
# cat  ~/.prefect/config.toml 
[server]
  [server.ui]
  apollo_url="http://<server_IP>:4200/graphql"
I stared the agent with
Copy code
prefect agent local start --api http://<server_IP>:4200
I deleted the project with the CLI (on the machine running the agent), created the project and registered a flow to that project. The agent is visible to the server, but there are no flows visible.
k
Did you register with the same configuration also?
p
yes, I registered the project and flow with that config file in place.
k
Did you restart your server by chance?
Were there logs when you registered? Can you show me the output of
prefect diagnostics
?
p
I didn't restart the server, no. I'll get the reg logs for you now.
Copy code
root@ip-172-20-10-198:/lib/python3.8/nih_3d_resource_workflows# prefect create project "NIH_3D"
NIH_3D created
root@ip-172-20-10-198:/lib/python3.8/nih_3d_resource_workflows# prefect register --project "NIH_3D" -p chimera_x_flow/
Collecting flows...
Processing 'chimera_x_flow/flow.py':
  Building `Local` storage...
  Registering 'ChimeraX_Flow'... Done
  └── ID: 64c7c841-20ec-4d46-95a8-545485271344
  └── Version: 1
======================== 1 registered ========================
Copy code
root@ip-172-20-10-198:~# prefect diagnostics
{
  "config_overrides": {
    "server": {
      "ui": {
        "apollo_url": true
      }
    }
  },
  "env_vars": [],
  "system_information": {
    "platform": "Linux-5.8.0-1035-aws-x86_64-with-glibc2.29",
    "prefect_backend": "server",
    "prefect_version": "0.15.3",
    "python_version": "3.8.10"
  }
}
stopped and start prefect server s/w, no change.
k
Oh I was asking because Prefect Server doesn’t keep state by default and you have to use the
--use-volume
to persist the state. This all looks good though. Can I see a screenshot of your UI? Like the dashboard?
For posterity, the config.toml should be:
Copy code
[server]
endpoint = "<http://XX.XXX.XXX.XX:4200/graphql>"
👀 1
👍 2
p
Great, thanks Kevin!