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
已提問 3 年前檢視次數 221 次
3 個答案
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
已回答 3 年前
0
AWS
已回答 3 年前
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
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南