Hey everyone,
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.
a
Anna Geller
11/08/2021, 10:42 AM
@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
supervisord.conf
config file. You can then copy all that and change:
Copy code
[program:prefect-agent]
command=prefect agent local start
Thank you, that sounds good 🙂 We will do it like that
👍 1
e
Emma Rizzi
12/10/2021, 10:30 AM
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!
a
Anna Geller
12/10/2021, 10:34 AM
@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
e
Emma Rizzi
12/10/2021, 10:37 AM
@Anna Geller i see it might not be exactly what I need, I'll open a new thread to not spam here!
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.