I created a project `vtk_flow` using the web GUI, ...
# prefect-community
p
I created a project
vtk_flow
using the web GUI, and am attempting to register a flow:
Copy code
$ python3 -m vtk_flow.flow
Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/nih-3d-resource-workflows/vtk_flow/flow.py", line 82, in <module>
    f.register(project_name='vtk_flow')
  File "/prefect-env/lib64/python3.7/site-packages/prefect/core/flow.py", line 1583, in register
    no_url=no_url,
  File "/prefect-env/lib64/python3.7/site-packages/prefect/client/client.py", line 729, in register
    project_name, project_name
ValueError: Project vtk_flow not found. Run `client.create_project("vtk_flow")` to create it.
I thought Client was to talk to Prefect Cloud ?
(I've set
prefect backend server
)
n
Hi @Philip MacMenamin - where did you create the project? It looks like whichever Server you're pointing to doesn't have that project.
The Prefect Client will talk to either Prefect Server or Prefect Cloud, depending on which you're pointing to
p
ok - got it.
Should be the same host, if the client will talk to the server then I can try setting it using that object rather than the GUI
n
Which GUI are you using? Is it available on localhost:8080?
p
It's available on http://3.218.151.216:8080
n
Got it - is that where you've hosted all of Prefect Server? And does your local config.toml point to that endpoint?
p
currently that machine is running the server and the agent, yeah
Copy code
lts
(prefect-env) [root@ip-172-20-10-29 ~]# cat .prefect/config.toml
[server]

  [server.ui]

    graphql_url = "<http://3.218.151.216:4200/graphql>"
(I just pointed the graphql explicitly)
n
Great, that means your local UI is pointed there as expected, you'll also want to set:
Copy code
[server]
endpoint = "<http://3.218.151.216:4200/graphql>"
(that tells Prefect Core where to go)
p
And restart server I guess? Is there a nice way to restart the prefect server if it's been disowned? So, ok, if it's running on the same host, I thought it should just work, no? As in it defaults to localhost. Or is that incorrect? I thought that I didn't need to set those vars if I ran agent / server on the same machine.
n
No, you shouldn't need to restart Server, that variable should exist on your local machine, or whatever machine you're calling
flow.register()
from, and is evaluated at runtime. Server defaults to localhost but that's relative to where you're registering the flow from. If you're registering from your local machine, your local Prefect config will need to be configured to point to your remote Server.
👍 1