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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠