Marcin Grzybowski
06/07/2022, 1:51 PM-v /home/marcin/.prefect/orion.db:/root/.prefect/orion.db
when I run orion dashboards from host:
prefect orion start
it works as intended - shows flows run from container.
But when I try to host dashboards from container I get empty dashboards (also mounting oriond.db, so both containers see the same database
-v /home/marcin/.prefect/orion.db:/root/.prefect/orion.db
added -p 4200:4200 to map port fdrom host to container, and exported PREFECT_ORION_API_HOST=0.0.0.0 so I can access dashboards in container from my host.
orion.db is properly mounted in both containers, because I see that it changes in them when i run a flow. Dashboards are accessible, but empty...Kevin Kho
06/07/2022, 2:57 PMdocker run -it --rm \
-p 4200:4200 \
prefecthq/prefect:2.0b5-python3.8 \
prefect orion start --host=0.0.0.0
That’s the same as yours?Marcin Grzybowski
06/07/2022, 3:58 PMPREFECT_ORION_API_HOST=0.0.0.0
and I used my image, not the official one, I will look into this
And how do you deal with the database? Local prefect uses sqlite file (orion.db, by default from location ~/.prefect/orion.db) so I mount the file from host into containers to the path ~/.prefect/orion.db, so it gets persisted on the host, and all containers use the same file
I try to make a setup with two containers, one hosting UI (prefect orion start) and one running flows (just python3 myflow.py)
The container running flow works all right - writes into that file. UI run from the host (not from the container_ works fine - shows flows history.
UI run from the container works, but shows no datadocker run -it --rm -p 4200:4200 -v /home/marcin/.prefect/orion.db:/root/.prefect/orion.db prefecthq/prefect:2.0b5-python3.8 prefect orion start --host=0.0.0.0
when I use my image it doesn't
my image is basically python image with installed prefect and sqlite3:
dockerfile is like this:
FROM python:3.9.13-slim-buster
RUN mkdir /prefect/
ADD ./requirements.txt /prefect/
RUN apt-get update
RUN apt install sqlite3
run pip install -r /prefect/requirements.txt
ENTRYPOINT prefect orion start --host 0.0.0.0
and ./requirements.txt is
prefect==2.0b5
prefect-snowflake==0.1.0
so something is missing here apparentlyAnna Geller
06/07/2022, 5:53 PMMarcin Grzybowski
06/07/2022, 6:01 PMAnna Geller
06/07/2022, 6:07 PMMarcin Grzybowski
06/07/2022, 6:10 PM