对 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
전문가
질문됨 6달 전11회 조회
1개 답변
0

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

profile picture
전문가
답변함 6달 전

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

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

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