Skip to content
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

Addons: Preparation steps for child processes #781

Merged

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jul 17, 2024

Changelog Description

Give addons option to initialize their environment before a pipeline process starts.

Additional info

The preparation can be used to make sure user is logged into some service and has set environment variables that are necessary. It is achived using simple mechanism by implementing ensure_is_process_ready method which expects ProcessContext as an argument.

Right now process context contains information if is headless, which addon name and version triggered the request and which project name is used. All of the mentioned information are optional (maybe addon name and version should be required?). Using object gives option to improve what can be specified (we might also add version to ProcessContext for forwards/backwards compatibility?).

All addon has to do is to call ensure_addons_are_process_ready with object of ProcessContext to trigger the preparation. Addons can raise ProcessPreparationError with human readable message, in that case user does not have option to see/copy detail (detail contains stdout/stderr with traceback).

Testing notes:

At this moment the functionality is implemented only in ftrack addon and used by applications addon. For that is also required to use different AYON launcher.

  1. Make sure to create packages of all of the addons.
  2. It is necessary to build and install AYON launcher with the PR to register scheme uri handler.
  3. Launch tray and logout from ftrack. You can close tray afterwards, but keeping it open will also test ftrack PR.
  4. Start application from AYON web UI.
  5. It should ask you to login to ftrack, if that fails it stops launching, otherwise it should launch the application. If you kept tray running, ftrack should update credentials.

@ynbot
Copy link
Contributor

ynbot commented Jul 17, 2024

@ynbot ynbot added size/S type: feature Adding something new and exciting to the product labels Jul 17, 2024
iLLiCiTiT and others added 4 commits July 17, 2024 15:53
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
…-child-processes

# Conflicts:
#	client/ayon_core/addon/base.py
@iLLiCiTiT iLLiCiTiT marked this pull request as ready for review July 23, 2024 09:07
@BigRoy
Copy link
Collaborator

BigRoy commented Jul 25, 2024

Cannot be tested without an addon that triggers the functionality. When the PR is ready for review there will be added example addon that can be used for the functionality test.

It's already marked "ready for review" no? So how to test? :)

@iLLiCiTiT
Copy link
Member Author

It's already marked "ready for review" no? So how to test? :)

Ou, I did? Converting back.

@iLLiCiTiT iLLiCiTiT marked this pull request as draft July 25, 2024 14:07
@iLLiCiTiT iLLiCiTiT marked this pull request as ready for review July 30, 2024 12:58
@iLLiCiTiT iLLiCiTiT requested a review from kalisp July 31, 2024 09:20
@iLLiCiTiT iLLiCiTiT merged commit 318ba20 into develop Aug 6, 2024
1 check passed
@iLLiCiTiT iLLiCiTiT deleted the feature/AY-6021_Addons-initialization-for-child-processes branch August 6, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S type: feature Adding something new and exciting to the product
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants