Hi guys, I'm just getting started with prefect 2.0...
# prefect-community
Hi guys, I'm just getting started with prefect 2.0 in docker. I mounted file into /flows folder - but unfortunately I can't see it in the flows section in the UI... what am I missing?
root@24dc674d1f7d:/flows# cat flow1.py
Copy code
from prefect import flow

def my_favorite_function():
    print("What is your favorite number?")
    return 42

you would need to run them to see them in the UI 😄
Copy code
docker run --platform linux/amd64 -ti -p 4200:4200 --expose=4200 prefecthq/prefect:2.0.1-python3.9
within container:
Copy code
prefect orion start --host
then in your ~/.prefect/profiles.toml on your local machine
Copy code
active = "default"

I'm in docker compose, and I was able to exec into the container and run the test flow
Hi @Anna Geller - I ran the python flow file and it registered in the flow table in postgres... but still nothing in the UI... any idea??
I think it's a broader problem that the UI cannot interact with the database
I can't create anything from the UI either
I found a similar thread...
"Error occurred while creating new work queue"
can't interact between UI & DB
maybe the issue that profiles.toml file not updated within the container...?
did it work for you without running Orion in Docker? could you validate your setup this way first?
the profile I mentioned would need to be set on your local machine, not in container
the setup I assumed you use: your Orion API server is running in the container and you run your flows and connect to the UI from your local machine
in that case the profile on your local machine would need to point to that Orion API running in a container
yes it's setup on my WSL2 but no luck :(
the UI is not communicating with the database...
I ran the flow from within the container
and it registered in the db
but not in the UI
If you check your developer console, to which IP is the UI sending requests? You should probably set
to the url of your orion api (in your container)?
Copy code
prefect1   |
prefect1   |  ___ ___ ___ ___ ___ ___ _____    ___  ___ ___ ___  _  _
prefect1   | | _ \ _ \ __| __| __/ __|_   _|  / _ \| _ \_ _/ _ \| \| |
prefect1   | |  _/   / _|| _|| _| (__  | |   | (_) |   /| | (_) | .` |
prefect1   | |_| |_|_\___|_| |___\___| |_|    \___/|_|_\___\___/|_|\_|
prefect1   |
prefect1   | Configure Prefect to communicate with the server with:
prefect1   |
prefect1   |     prefect config set PREFECT_API_URL=<>
prefect1   |
prefect1   | View the API reference documentation at <>
prefect1   |
prefect1   | Check out the dashboard at <>
prefect1   |
prefect1   |
prefect1   |
prefect1   | INFO:     Started server process [21]
prefect1   | INFO:     Waiting for application startup.
prefect1   | INFO:     Application startup complete.
prefect1   | INFO:     Uvicorn running on <> (Press CTRL+C to quit)
prefect1   | INFO: - "GET /ui-settings HTTP/1.1" 200 OK
prefect1   | INFO: - "GET /runs HTTP/1.1" 304 Not Modified
prefect1   | INFO: - "GET /ui-settings HTTP/1.1" 200 OK
prefect1   | INFO: - "GET /flows HTTP/1.1" 304 Not Modified
prefect1   | INFO: - "GET /assets/index.e5a1ec21.js HTTP/1.1" 304 Not Modified
prefect1   | INFO: - "GET /assets/index.af5420a1.css HTTP/1.1" 304 Not Modified
prefect1   | INFO: - "GET /ui-settings HTTP/1.1" 200 OK
prefect1   | INFO: - "GET /assets/Flows.3273f2ed.js HTTP/1.1" 304 Not Modified
I'm able to create flow via http://localhost:4200/api/flows/
the issue is just the UI itself
Yes, but you're doing that from inside the container, if I'm understanding correctly? Can you, e.g.
prefect flow-run ls
from your machine itself (i.e. a normal terminal)?
yes I see them from the machine
not from the UI though... that's the issue
not sure how to configure PREFECT_ORION_UI_API_URL
in a way that would work
in wsl2 and docker compose
If you open your dev console in browser, what URL do you see where the red rectangle is?
Here I actually meant from a windows terminal, since you're trying to connect to the api from your browser on windows
fixed with PREFECT_ORION_UI_API_URL: http://localhost:4200/api
🙌 1
thanks guys!!!
Yep, that's what I thought. Glad I could help 🙂
🙌 1
🙏 1