Skip to content

Conditional artifacts in greengrass component recipe

0

We are deploying greengrass components across multiple platforms, and wondering if there is a way to have conditional artifacts - for example a docker artifact - or others ? Ideally, we could then instruct greengrass to download one particular docker image if being executed on one platform and a different one if on another - and not both.

asked 9 months ago100 views
1 Answer
1
Accepted Answer

Yes, it is possible to have conditional artifacts in AWS IoT Greengrass component recipes, allowing you to deploy different artifacts based on the platform where the component is being executed.

In the component recipe, you can define multiple manifests, each specifying a different platform configuration. Within each manifest, you can specify the artifacts that should be deployed for that particular platform.

Here's how you can achieve this:

  1. In your component recipe, define separate manifests for each platform you're targeting.

  2. For each manifest, specify the platform details using the "Platform" field. This can include the operating system and architecture.

  3. Within each manifest, define the specific artifacts that should be deployed for that platform.

For example, you could have a manifest for a Linux ARM platform and another for a Linux x86 platform, each with its own set of artifacts:

Manifests:
  - Platform:
      os: linux
      architecture: arm
    Artifacts:
      - URI: s3://your-bucket/arm-docker-image.tar
        Unarchive: NONE
  - Platform:
      os: linux
      architecture: x86_64
    Artifacts:
      - URI: s3://your-bucket/x86-docker-image.tar
        Unarchive: NONE

In this setup, Greengrass will only download and deploy the artifact specified for the matching platform. So, if the component is being deployed to a Linux ARM device, it will only download the ARM Docker image, and if it's being deployed to a Linux x86 device, it will only download the x86 Docker image.

This approach allows you to efficiently manage your artifacts across different platforms, ensuring that only the necessary files are downloaded and deployed to each device, optimizing storage and network usage.

Remember to adjust the lifecycle scripts in each manifest to handle the platform-specific artifacts correctly. This way, you can have a single component that behaves differently depending on the platform it's deployed to, without unnecessarily downloading artifacts for other platforms.

Sources
Customize your machine learning components - AWS IoT Greengrass
AWS IoT Greengrass component recipe reference - AWS IoT Greengrass

answered 9 months ago
AWS
EXPERT
reviewed 9 months 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.