Hello Friends I am going through the first flow t...
# prefect-community
j
Hello Friends I am going through the first flow tutorial: https://docs.prefect.io/orchestration/tutorial/first.html#write-flow. Here is what my flow script looks like
Copy code
#prefect_test.py
import prefect
from prefect import task, Flow

@task
def hello_task():
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>("Hello, Cloud!")

flow = Flow("hello-flow", tasks=[hello_task])
flow.register()
flow.run_agent()
I've got my prefect server running. I started with the following command:
prefect server start --hasura-port=3050
. So I then see that when I run the prefect_test.py file above it submits the flow and I have a url where I want to go run the flow. Something like this:
<http://localhost:8080/flow/6e437b8f-9fc2-41c1-9862-311d9a423442>
I follow this link to use the UI to run the flow and I have an empty screen. Anything obvious I am missing?
n
Hi @justin - where are you running Prefect Server? Is it on your local machine?
j
Its on a server in a vpn
not quite local
n
That would be why - localhost refers to just that, your localhost. If you've correctly set your
endpoint
var in
config.toml
, that's where prefect is registering flows
You'll need the address of your server, the UI will be available on port
8080
by default (this port will also need to be exposed)
In the thread with Lewis above (which I believe you were part of), I outlined the steps you'll need to take both locally and on your server; let me know if you have some trouble after following those
j
I am confused by the locally part actually
I am running everything on the remote server
n
That's where you're registering your flows from as well?
j
yes
n
Ok then the only part that applies is the UI setup that I described
Your browser still needs to know where to go, which in this case is NOT localhost
j
so in conig.toml I am pointing it to
x.x.x.x:8080?
n
No, that's where the UI is being served
j
Copy code
[server]
  [server.ui]
  graphql_url = "<http://0.0.0.0:4200/graphql>"
[endpoint]
  ui = "<http://0.0.0.0:8080>"
oh ok
n
That looks fine, assuming you're replacing the 0.0.0.0 with an actual IP
j
let me try
do I need to have [endpoint.ui] as a entry in the toml?
n
No, you don't
j
upon modification shall I run
prefect backend server
or how does it acknowledge updates?
n
You'll want to stop server and restart it
j
I see
n
Should also run that if you haven't already
@justin it might be good to start with Prefect Cloud if you continue to have issues - it's trivial to get set up and Prefect Server requires a fairly large amount of networking and deployment knowledge
j
I see
Thank you for the suggestion
I do see that my local Private IP has propagated to the graphql status modal
n
But it's not connecting? Is the
/graphql
route included?
j
correct
by local I mean local to the vpn
n
Can you access the API in your browser at the 4200 port?
j
yes
same issue as lewis balls
n
What are you seeing when you try to access them?
j
GET query missing.
n
Can you provide a full screenshot of both tabs? Including the URLs? that'll help me debug a little.
j
n
And the UI?
j
oh snap its up
shoot we're good!
thanks a ton
n
Glad to hear it 🙂
j
thank you so much!
😄 1
fwiw, we do a ton of work on the cloud but we are trying to do something like a sagemaker on an nvidia dgx so we are trying out prefect