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 年前222 查看次数
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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则