we have a docker agent running on a cloud vm for our production workloads. We need to automatically restart the docker agent on reboot. Is there a recommended way to make that happen? I stumbled across the https://docs.prefect.io/orchestration/agents/local.html#using-with-supervisor supervisor feature for local agent and am thinking about adapting this for our use case. However, I do not know enough of Supervisor to know if that would be the right approach.
10 months ago
@Bastian Röhrig good question - overall local agent and Docker agent both run as a local process, so you can absolutely use the same Supervisor configuration as for a local agent. You need to only adjust the startup command.When you run:
prefect agent local install
, this will output an example
config file. You can then copy all that and change:
[program:prefect-agent]command=prefect agent local start
Hi @Bastian Röhrig ! I'm trying to do exactly the same, did you manage to do it ? I have to create a custom VM image and as a complete noob in this field I try to gather as much advice as possible!
9 months ago
@Emma Rizzi perhaps you can try first on your local machine? what we do here is a simple supervisor config to make sure the agent process runs in background and is restarted if it gets shut down for some reason
9 months ago
@Anna Geller i see it might not be exactly what I need, I'll open a new thread to not spam here!