opened 11:06AM - 16 Mar 23 UTC
epic
type: feature
community contribution
**Is your feature request related to a problem? Please describe.**
Ayon and e…ven OpenPype had to handle dependencies, versions of packages and distributing vendored binaries. With Ayon resolving versions and its dependencies becomes more dynamic due to being able to mix and match addons which in itself can require specific versions of other addons.
As a part of this some of the work for Ayon has been involving resolving these dependencies and building an environment for launching a specific version of Ayon, etc. and has with OpenPype (v3) involved managing environments for Applications and Tools when launching even specific assets in a project.
This addon (package) management and dependency resolving with version ranges is exactly what [Rez](https://github.com/AcademySoftwareFoundation/rez) is built to solve and I feel like before we set of implementing complex resolving algorithms for the addons and their 'dependencies' we should maybe avoid time spent there and instead spent time on relying on Rez as much as we can.
By adopting Rez we can also get other benefits like:
- Setting up a central repository of package versions (e.g. ffmpeg, ocio, otio, python packages) without requiring each build of Ayon to embed all those dependencies.
- It can support local caching of having the dependencies on a network share but copy certian packages (or all) locally to improve runtime performance. This would then also automatically become possible for things like "tools" where e.g. redshift could be loaded through ayon configuration and its resolving could use that Redshift locally to improve the startup running time for the renderer.
- Since Rez is built to resolve dependencies like this we can use its feature set to also help debug dependency problems, etc. without again having to re-write and manage our own.
- It can even help the "version resolving" we are using for OpenPype itself currently by turning OpenPype ZIP packages into rez packages, etc. (e.g. at deployment time or alike) to avoid maintaining our own version resolving logic and be able to rely on Rez's mechanisms which have a much stronger backbone in production already.
**Describe the solution you'd like**
Have Ayon use `rez` to resolve the environment to launch an application in would be one first step.
I'd say the final goal would be to be able to run even Ayon itself through rez so from there you could e.g. pick a particular Ayon version to start with too - but that doesn't have to be a first priority I'd say. Being able to pick Ayon version through `rez` would open up e.g. Deadline resolving to a specific ayon version to also just move through `rez` to get the right package.
**Describe alternatives you've considered**
We've had Applications and Tools in OPv3 but with separating all addons for Ayon and them versioning independently with dependencies (requirements) to other addons will start complicating the version resolving logic that needs to be written.
I'd say we are getting to a point where Rez might be best way forward into development time and what we gain from it in the end.
**Additional context**
### Rez feature requests have come up before
Even before Ayon having Rez support has come up as a request multiple times by multiple users on Discord:
- @instinct-vfx [mentioned it recently with regards to Ayon and automatic downloads of addons](https://discord.com/channels/517362899170230292/890894521817260052/1085821403665805405)
- [A Rez thread on Ynput community discord](https://discord.com/channels/517362899170230292/954098029135282307) showing interest from @davidlatwe @Tilix4 @Minkiu with some developers mentioning they had working prototypes with OpenPype like @Anti-Distinctlyminty
- [Some implementation discussion here](https://discord.com/channels/517362899170230292/954098029135282307/1073159241751347201) and [here](https://discord.com/channels/517362899170230292/563751989075378201/1012723921113587732)
- [There have also been requests to keep it separate with some answers by @mkolar at the time about OP philosophy](https://discord.com/channels/517362899170230292/913725331389710337)
- [And last but not least some questions about Rez package versus JSON configs from back in 2020](https://discord.com/channels/517362899170230292/517382145552154634/770726352169074719)
### Rez is supported by Academy Software Foundation
Rez has ASWF support and used by a variety of bigger studios in the animation industry.
[cuID:[OP-5252](https://app.clickup.com/t/85zrrzwwg)]