There doesn't appear to be a way to stop the prefect server and all its containers.
prefect server stop will stop all containers.
Hi @tekumara - you can gracefully stop all containers with a SIGINT signal (e.g., CTRL+C).
Because prefect server start is a blocking command with a graceful shutdown mode, I don't think there's a benefit to adding a new CLI endpoint for stopping the containers independently of this.
I've hung up on the original terminal session that started prefect, and so now don't know how to shut the server containers down.
Hi @tekumara - since all of the services run with Docker, you can run docker ps to get a list of your running containers and then docker kill ${container-id} for each of the containers you'd like to shut down. If you've used something like nohup to redirect output, you can instead use ps aux | grep prefect to get the PID of the prefect process and run kill ${PID}. I hope that helps!
The prefect process doesn't exist anymore. The hang up occurred when I upgraded macOS. When my machine rebooted, Docker Desktop started the containers again.
I killed the 6 containers using docker kill. The prefect-server docker network was left behind. So I reran prefect server start and then hit CTRL-C which removed the network. A little complicated but it worked, thanks!
Manually doing this work to clean up a prefect session isn't ideal since I switch between projects. I use prefect server start >> server.log 2>&1 & to run in the background. Can prefect provide a clean-up command as proposed?