Tom Shaffner
12/01/2021, 8:55 PMprefect server config
to generate a docker compose file, and I'm partway down the path of trying to set that up to auto-start (still working through https://github.com/flavienbwk/prefect-docker-compose, which was linked in it), but so far it's not working and it seems like there should be a simpler answer here. Docker has restart policies already (https://docs.docker.com/config/containers/start-containers-automatically/), is there not some flag I can pass to prefect server start
to use them?Anna Geller
Tom Shaffner
12/01/2021, 9:07 PMKevin Kho
docker-compose up
upon reboot. What happens when you do prefect server start
was a startup script? Although of course this won’t revive containers that die while the machine is alive (maybe you can combine it with a restart policy?)Tom Shaffner
12/01/2021, 9:14 PMprefect server config > docker-compose.yml
and then do docker-compose docker-compose.yml up
, the UI doesn't load at the end. Are there other steps or differences there which I'm missing?Tom Shaffner
12/01/2021, 9:20 PMKevin Kho
Kevin Kho
Tom Shaffner
12/01/2021, 9:27 PMKevin Kho
Anna Geller
prefect server start --expose
Tom Shaffner
12/01/2021, 9:29 PMTom Shaffner
12/01/2021, 9:30 PMprefect server config --expose > docker-compose.yml
, and I checked, doing so set the IP in several places to 0.0.0.0 as it should. When I run the docker up
command on the result though the UI doesn't load.Anna Geller
Anna Geller
prefect server config --expose > docker-compose.yml
docker-compose up -d
Anna Geller
Anna Geller
restart: always
Tom Shaffner
12/01/2021, 10:09 PMTom Shaffner
12/01/2021, 10:16 PMfrom prefect.cli import server
server.setup_compose_file()
I get pretty different outputs, and the only difference should be the IP I think. I haven't gone through it all yet, but is there nothing in the stripped-down config version that's missing?
In the meantime I'll see about docker restarting after a reboot; maybe that's my problem if always is defaulted to on.Anna Geller
is there nothing in the stripped-down config version that’s missing?based on my local test, all components were spun up correctly. So it looks like this is what you need. Perhaps you can compare your docker-compose with the one from here to see if there is something else you want to include, e.g. an agent https://github.com/flavienbwk/prefect-docker-compose
Tom Shaffner
12/01/2021, 10:49 PMsudo systemctl start docker
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
Then prefect server start --expose -d --use-volume
, and I now seem to be persisting beyond a reboot without restarting the DB each time. Combine that with the supervisord instructions you have up and I think I'm up and running!Anna Geller
Tom Shaffner
12/02/2021, 3:17 PM