对 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
专家
已提问 5 个月前8 查看次数
1 回答
0

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

profile picture
专家
已回答 5 个月前

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

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

回答问题的准则