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

Chore: Use 'AYON_USE_STAGING' #124

Merged
merged 8 commits into from
Feb 12, 2025

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Feb 7, 2025

Changelog Description

GlobalPreLoadJob.py does respect AYON_USE_STAGING environment variable as replacement for AYON_DEFAULT_SETTINGS_VARIANT.

Additional review information

Environment variable AYON_DEFAULT_SETTINGS_VARIANT is still used for backwards compatibility. It is also explicitly set by deadline addon now, so ayon-core does not have to set it up for future deprecation.

This change is preparation for future cleanup that can't happen now to keep backwards compatibility.

Logic leading to this change

We need to know if AYON process should happen as production, staging or dev. Dev is defined just by bundle name, production is also defined only by bundle name, and staging needs bundle name and AYON_USE_STAGING, so we don't need AYON_DEFAULT_SETTINGS_VARIANT at all if we have AYON_BUNDLE_NAME and AYON_USE_STAGING available.

Future plans

We need to support backwards compatibility, so changing GlobalPreLoadJob might be dangerous now, as we probably should support bigger range of addon versions.
But when we bump requirement of ayon-core to >1.1.1 we don't have to set up AYON_DEFAULT_SETTINGS_VARIANT anymore, as staging will be defined by AYON_USE_STAGING.

Testing notes:

  1. Deadline GlobalPreLoadJob.py must be copied to deadline repository.
  2. For now nothing should change as both core and deadline are still setting AYON_DEFAULT_SETTINGS_VARIANT.

To validate new logic

  1. Use Chore: Pass 'AYON_USE_STAGING' to farm jobs ayon-core#1130 .
  2. Add custom plugin that happens after collection (e.g. during validation) that will remove AYON_DEFAULT_SETTINGS_VARIANT from context.data[FARM_JOB_ENV_DATA_KEY].
  3. With these changes it should be possible to submit production, staging and dev jobs.

Resolves #129

@iLLiCiTiT iLLiCiTiT self-assigned this Feb 7, 2025
@iLLiCiTiT iLLiCiTiT added the type: enhancement Improvement of existing functionality or minor addition label Feb 7, 2025
@iLLiCiTiT iLLiCiTiT requested review from kalisp and BigRoy February 7, 2025 11:21
Copy link
Member

@kalisp kalisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did try to instance.context.data[FARM_JOB_ENV_DATA_KEY].pop("AYON_DEFAULT_SETTINGS_VARIANT") , AYON_DEFAULT_SETTINGS_VARIANT is not pushed to DL, AYON_USE_STAGING is.

extractenvironments seems to be triggered on staging variant (even if it is not fed by command line argument, but AYON_USE_STAGING seems to propagate).

@iLLiCiTiT
Copy link
Member Author

Cool, thanks for testing.

@iLLiCiTiT iLLiCiTiT added type: enhancement Improvement of existing functionality or minor addition and removed type: enhancement Improvement of existing functionality or minor addition labels Feb 12, 2025
@iLLiCiTiT iLLiCiTiT merged commit f9556b3 into develop Feb 12, 2025
3 checks passed
@iLLiCiTiT iLLiCiTiT deleted the enhancement/look-for-ayon-use-staging branch February 12, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace AYON_DEFAULT_SETTINGS_VARIANT with AYON_USE_STAGING
2 participants