Handling Application Dependencies

Once you start building more complex alwaysAI applications, you’ll likely use dependencies that are not included in the edgeIQ Docker image. There are two types of dependencies that are supported:

  1. Python Dependencies: These are packages that can be installed using pip.

  2. System Dependencies: These are packages that can be installed using apt-get.

Python Dependencies

To add a Python dependency to your app, add a requirements.txt file to your app directory and add the requirement, along with the version if necessary. For example, if your app requires the Requests Python module your requirements.txt would look like this:

Requests==2.22.0

During the app install command, the dependencies are installed in a Python virtual environment for your app.

System Dependencies

To add a system dependency to your app, add additional commands to your Dockerfile. For example, if your app depends on the VLC package, your Dockerfile would look like this:

ARG ALWAYSAI_HW="default"
FROM alwaysai/edgeiq:${ALWAYSAI_HW}-<version>
RUN apt-get update && apt-get install -y vlc

During the app install command the Docker image is rebuilt using the updated Dockerfile. Your app will run in a container based on the new Docker image.