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
asked 3 years ago210 views
3 Answers
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
answered 3 years ago
0
AWS
answered 3 years ago
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
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions