https://prefect.io logo
s

sqlboi

08/29/2023, 9:30 PM
hey everyone, have a question - i was able to spin up prefect in a container and start the server up. i can visit the ui just fine. i also tried to create a flow, and the data populated my sqlite db:
Copy code
root@3032594fbf4c:/opt/app/initial_test# python3 hello.py
21:18:58.862 | INFO    | prefect.engine - Created flow run 'impressive-shrimp' for flow 'hello-world'
21:18:58.864 | INFO    | Flow run 'impressive-shrimp' - View at <http://myapp.com/prefect/flow-runs/flow-run/6e4ca6b7-3873-4ca0-a36b-2083992a77ad>
hello world
21:18:59.004 | INFO    | Flow run 'impressive-shrimp' - Finished in state Completed()
root@3032594fbf4c:/opt/app/initial_test# python3 hello.py
21:21:11.399 | INFO    | prefect.engine - Created flow run 'victorious-raptor' for flow 'hello-world'
21:21:11.401 | INFO    | Flow run 'victorious-raptor' - View at <http://myapp.com/prefect/flow-runs/flow-run/9406a029-1952-421f-ac86-409bf2df944c>
hello world
21:21:11.545 | INFO    | Flow run 'victorious-raptor' - Finished in state Completed()
but none of this shows up in the actual webapp... when i try to visit the above it shows me 404. also i dont see any output from the server - so it's almost like prefect is running the job, but doesn't communicate it with the actual server...
Copy code
prefect config set PREFECT_SERVER_API_HOST="0.0.0.0"
prefect config set PREFECT_UI_API_URL="<http://myapp.com/prefect/api>"
prefect config set PREFECT_UI_URL="<http://myapp.com/prefect>"
prefect config set PREFECT_API_DATABASE_CONNECTION_URL="sqlite+aiosqlite:////opt/app/prefect.db"
when i check the log using
--log-level DEBUG
and run python on a script it doesn't show any changes beyond the regular logs
d

Daniel

08/29/2023, 9:37 PM
Are the server, UI and flow all running inside the same container? You probably need to set
PREFECT_API_URL=<http://myapp.com/prefect/api>
so the flow uses the existing server
s

sqlboi

08/29/2023, 9:38 PM
yep both in the same container - i just used
prefect server start
and the ui kicked in, then within the same container i ran
python3 hello.py
it had a
@flow
decorator so you can see the output worked
oooo you know what thats my bad! i removed
/prefect
from the proxy
its all good thank you!!
1