对 Greengrass 生命周期进行更细粒度的安装检查。

0

【以下的问题经过翻译处理】 我有一个依赖于 awsiotsdk Python 模块的 Greengrass 组件,因此在清单中,我们添加了以下内容:

"Manifests": [
    {
      "Name": "Linux",
      "Platform": { "os": "linux" },
      "Lifecycle": {
        "Install": {
          "RequiresPrivilege": true,
          "Script": "apt-get --yes install python3 python3-pip && pip3 install awsiotsdk",
                "Timeout" : 240
        },

我们不得不添加 240 的超时时间,因为安装可能需要很长时间。 每次部署新版本时都会运行此操作,有时它似乎会与由不同的 Greengrass 组件运行的另一个 apt install 冲突。

我甚至认为每次部署都不需要运行安装,因为它应该仍然安装在之前的时间? 有没有一种将其分成三个不同命令的方法?

apt-get --yes install python3 
apt-get --yes install python3-pip 
pip3 install awsiotsdk

并且如果它尚未安装,则忽略它?

https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html#recipe-examples 中,我可以在 yaml 示例中看到它执行了跳过,但是我不确定如何使用此命令检查 awsiotsdk。是否有任何具有多个步骤和跳过的 json receipe 示例?

profile picture
EXPERTE
gefragt vor 6 Monaten11 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 Please customize your docker file to prevent installation timeout before you deploy the greengrass component.

profile picture
EXPERTE
beantwortet vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen