Search by Tags

Build the AWS AI at the Edge Demo Image

 
Applicable for

Article updated at 07 Nov 2019
Subscribe for this article updates

Introduction

The AWS AI at the Edge demonstration is built on top of the Torizon platform. Nevertheless, some degree of customization is done to the TorizonCore image:

  • Greengrass Core Software is added and runs on the base image.
  • The deep learning inference engine runs on the base image.
  • Docker compose files and systemd services to control them are added for the conteinerized applications.

The preferred method for using the AWS AI at the Edge demonstration is by installing the image from the Toradex Easy Installer online feeds. The alternative way - to build the image by yourself - is documented in this article.

This article complies to the Typographic Conventions for Torizon Documentation.

Prerequisites

You must have already set up a Yocto build environment for TorizonCore. You can follow the instructions from:

For instance, to only configure but don't build:

Warning: the following instruction is a hint, but it does not replace going through the instructions from the TorizonCore Build Environment article.

$ docker run --rm -it --name=crops -v ${HOME}/yocto-workdir:/workdir torizon/crops-toradex --workdir=/workdir --cmd="MACHINE=apalis-imx8 startup-tdx-torizon.sh"

Setup the meta-pasta-demo layer

With the setup already configured for a TorizonCore build, clone the meta-pasta-demo layer to the layers directory:

$$ cd <layers directory>
$$ git clone https://github.com/toradex/meta-pasta-demo.git 

Enter the meta-pasta-demo directory and run the config.sh script. It applies patches to other layers, fetches extra layers, configures a sample local.conf and adds meta-pasta-demo and the extra layers to bblayers.conf:

$$ cd meta-pasta-demo
$$ ./config.sh
$$ cd ../../build-torizon

Make sure to accept the FSL_EULA, since the accept variable is commented in the sample file. The EULA is at layers/meta-freescale/EULA and you should have already read it during the setup of the Yocto environment:

conf/local.conf
ACCEPT_FSL_EULA="1"

Add Greengrass Core Device Credentials - Optional

Add the greengrass core device credentials to recipes-aws/aws-iot-greengrass-core-software/files/core-device-secret.tar.gz and add aws-iot-greengrass-core-software-device-credentials to recipes-images/images/pasta-demo.bb.

Note: if you skip this section, you can add the credentials after the image is installed on the target.

Add OTA Credentials - Optional

Add Aktualizr OTA credentials to recipes-sota/aktualizr/files/credentials.zip and uncomment related lines at conf/local.conf.example and recipes-images/images/pasta-demo.bb.

Note: this is only useful if you plan to update components from the base image. For containers and/or AWS Greengrass, there are other options.

Build the pasta-demo Image

The AWS AI at the Edge demo image is named pasta-demo, as a reference to the pasta detection application. Build the image:

$$ bitbake -k pasta-demo

The binary image will be available in deploy/images/apalis-imx8. You can, for instance, use the TorizonCore Build Environment to serve the image over your local network.