Looking for recommendation on how to trigger recovery lifecycle action

0

Hello -

We are deploying container workloads to Greengrass V2 enabled devices and would like to signal to the component when the recovery lifecycle action should occur. Specifically, when the container fails/exits it would be nice to catch this by the "component" somehow and trigger a recovery action.

In the past, when we've used a Python script as the Run action this automatically occurs when the script exits. We could wrap the docker run call in a script that polls for status and fails/exits when the container dies but was hoping there was a more elegant way to address this natively in the component recipe. Any suggestions?

TIA!
Mike

mgfink
preguntada hace 3 años210 visualizaciones
3 Respuestas
0

Hi Mike,

Thanks for using Greengrass V2, and sorry about the delay. Have you tried the lifecycle command called 'Recover' that you can add to your recipe and it will automatically run when your run command exits with an error, so in order to trigger it, you will need to ensure that your run command, which might be docker run command exits with code 1 when there's an issue

Thanks,
Shagupta

AWS
respondido hace 3 años
0
AWS
respondido hace 3 años
0

Shagupta - thanks for the reply! That's the path we're currently using along with the --restart flag in Docker directly. We've overloaded the "Run" script by using multiple commands, separating them with ';', and also including &&/|| expressions but this seems to be working.

Thanks again!

mgfink
respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas