Understanding Dependencies in AYON Addons

Introduction

When working with AYON, understanding the different types of dependencies that can affect your projects is crucial, especially for newcomers. Let’s break down the two main types:

  • Addon Dependencies
  • Code Dependencies

Addon Dependencies

Addon Dependencies, or compatibility requirements, arise when an addon relies on other addons or AYON products to function properly.

Key Characteristics:

  • Requirement of Other Addons: One addon may depend on other addon(s).
  • Specific Versions: Compatibility is mostly version-specific. For example, an addon may only work with a particular version of the AYON server, AYON launcher, or another addon.

To simplify this, we offer a compatibility checker during bundle creation. It alerts you if any AYON products within your bundle are incompatible, helping prevent the creation of a faulty bundle.

Note: The compatibility checker doesn’t consider the dependency package. It only checks the requirements mentioned in the package.py.


In my screenshot, I forgot to specify a launcher version, which caused the compatibility check to fail on my applications and core addons.

Code Dependencies

Code dependency involves the need for specific code libraries to run the addon. This could include a python library for client-side code or a React component for the frontend part of the addon. Ensuring these code dependencies are met is crucial to avoid functionality issues.

Client-Side Python Dependencies

Each client-side code has its code dependency defined in the pyproject.toml inside the addon client code directory.

To satisfy this dependency, we create a dependency package and add it to our bundle. For more info, check What are dependency packages and how to update them?.

Frontend React Components

Each frontend has its own package.json in the addon frontend directory.

We don’t need to do anything special to satisfy this dependency. The AYON server should be able to install the package for the frontend to work properly.

Server-Side Python Dependencies

While it might be tempting to use a particular Python library for your server code, perhaps to implement a custom endpoint, this approach isn’t advisable for production environments. Therefore, we don’t support that officially. Any attempts to support it can make the server unstable, use at your own risk.

Addons server-side code should use the generic libraries available on the server. Check ayon-backend/pyproject.toml.

We recommend using an event-driven approach. This means using the endpoint to trigger actions rather than performing the actual action directly. For heavy lifting, it’s better to rely on a dedicated AYON service, ensuring a more efficient workflow.

Addon Services

Services are Docker images, so you can install any dependency you’d like if the Docker image supports it.

Therefore, it’s up to your Dockerfile setup.
Usually, we use pyproject.toml with poetry commands in the Dockerfile.

  • Example: Ftrack service processor’s Dockerfile
1 Like