-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Addon's Library logic with Rez #29
Conversation
Marking as draft so we can have a conversation about this. |
46d4418
to
3a5b917
Compare
Thanks for drafting a prototype! I haven't been involved much with the Ayon backend but just wanted to say that any work on this front in combination with Rez is greatly appreciated. This PR's Rez integration is solely regarding the addons and modules in the backend, not the running of the actual DCC application and tools, right? So it's not for those that might have a huge ready-to-go Rez repository already with many applications and tools and allow them to launch those through OpenPype for certain hosts. Or am I mistaken? |
For that we will need to implement alternative to applications addon that will use rez and also we will need to create rez package from ayon-launcher (that will be the new entry point as Igniter in OP is) |
Great. Just to confirm, so this particular PR is not intended to do that. Right? |
You are right, this is not the PR for that. And there are other changes happening on the same parts, that I'll need to rebase later, so this won't be merge in the near future I'd say. |
Is with this PR possible to manually add/remove addon to/from server? |
No, this PR doesn't implement the adding/removing side of thing, will wait till the bundle changes settle to rebase and piggyback on current implementation to install /remove and hook there Rez |
ff7574c
to
3c0fcd4
Compare
432038e
to
903ab76
Compare
3ca86d2
to
25e56b5
Compare
6c4fd8e
to
ef7824b
Compare
cd4f16c
to
4cbd4c4
Compare
This commit add a new class to the `ayon_server.addons` logic that allows the server to use Rez (https://github.com/AcademySoftwareFoundation/rez) as a package manager, including a default `rezbuild.py` for packages that do not include one, these need to follow the AYON Addon template structure. THIS BREAKS WITH EXISTING ADDONS present in the `/addons` which are not rez packages.
72e0e6a
to
9a48d6d
Compare
I am finally satisfied with the commit history, and managed to catch some bugs, it is now ready to be reviewed, will update the PR to reflect changes. |
With the implementation of the `RezRepo` we deprecate the previous `ServerAddonDefinition` since now we leverage `rez.PackageFamily` to achieve the same results. The class has been refactored to use `RezRepo` for discovery, installing and removing AYON addons. Some methods have been kept (or reworded) but refactored to provide a more streamlined set of results, hopefully for consistency when using the `AddonLibrary`.
Modified all instances where we accessed the AddonLibrary to ensure we get the same result as previously and that everything works given the new class.
9a48d6d
to
9ae1706
Compare
…Repo` Modified all modules where the interface with `AddonLibrary` changed or where it was now necessary to use the `RezRepo`.
9ae1706
to
2f0d86e
Compare
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
# Copy "server" to "addon" | ||
if server_dir.is_dir(): | ||
print(f"Copying `server` directory contents to {DEST_DIR}") | ||
_recursive_copy(server_dir, DEST_DIR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not what this does, but if there is package.py
it does expect to have server code in server
subfolder.
_recursive_copy(server_dir, DEST_DIR) | |
_recursive_copy(server_dir, DEST_DIR / "server") |
Replace
addons
logic with RezThis Pull Request, modifies the backend in order to leverage Rez to manage AYON addons (they should now include a
package.py
with the attributeplugin_for="ayon_server"
.A loose explantation of the process is:
ayon_server
exists in our repo, as of now/addons
; and it matches the currentayon-backend
version, otherwise we create one, and request a restart, this package has the attributehas_plugins=True
ayon_server
.rezbuild.py
that we fall back for simple addons; there's a bug in rez that makes it mandatory for thepackage.py
to contain thebuild_command
attribute set (tried to add it programmatically, but it won't install the package, due this bug).All the rest should work as it does now, I really haven't tested the migration of settings between bundles, so that might not be working at the minute.
Reviewing
I tired to keep it tidy and compartemantilized, so there are 4 commits:
api
folder, to adapt to any required changesayon_server
folder, to adapt to any required changes, this one has some bits that have changed more than simple method renames.TODO
package.py
at the root).BaseServerAddon
and move some of the attributes to thepackage.py
then, read the info from there.Testing note
I would suggest making a copy of the
docker-compose.yml
in theayon-docker
backend and build a new image calledayon-rez
that build the newrez
dependency; so it does not interfere with your existing deploys; also map the/addons
folder to a different one than the one you are currently using.You can use this PR to generate rez packages out of the OpenPype ones: ynput/OpenPype#6169