Skip to content

Commit

Permalink
Merge pull request #124 from ynput/enhancement/look-for-ayon-use-staging
Browse files Browse the repository at this point in the history
Chore: Use 'AYON_USE_STAGING'
  • Loading branch information
iLLiCiTiT authored Feb 12, 2025
2 parents 8228974 + e19cc93 commit f9556b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class CollectDeadlineJobEnvVars(pyblish.api.ContextPlugin):

# Not sure how this is usefull for farm, scared to remove
"PYBLISHPLUGINPATH",

# NOTE still required by GlobalPreLoadJob.py, but might not be set by
# ayon-core anymore
"AYON_DEFAULT_SETTINGS_VARIANT",
]

def process(self, context):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def _submit_deadline_post_job(
"--targets", "deadline",
"--targets", "farm",
]
# TODO remove when AYON launcher respects environment variable
# 'AYON_DEFAULT_SETTINGS_VARIANT'
# TODO remove settings variant handling when not needed anymore
# which should be when package.py defines 'core>1.1.1' .
settings_variant = os.environ["AYON_DEFAULT_SETTINGS_VARIANT"]
if settings_variant == "staging":
args.append("--use-staging")
Expand Down
18 changes: 12 additions & 6 deletions client/ayon_deadline/repository/custom/plugins/GlobalJobPreLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
FileUtils,
DirectoryUtils,
)
__version__ = "1.2.0"
__version__ = "1.2.1"
VERSION_REGEX = re.compile(
r"(?P<major>0|[1-9]\d*)"
r"\.(?P<minor>0|[1-9]\d*)"
Expand Down Expand Up @@ -558,8 +558,12 @@ def inject_ayon_environment(deadlinePlugin):
]

# staging requires passing argument
# TODO could be switched to env var after https://github.com/ynput/ayon-launcher/issues/123
settings_variant = job.GetJobEnvironmentKeyValue("AYON_DEFAULT_SETTINGS_VARIANT") # noqa
# TODO could be removed when PR in ayon-core starts to fill
# 'AYON_USE_STAGING' (https://github.com/ynput/ayon-core/pull/1130)
# - add requirement for "core>=1.1.1" to 'package.py' when removed
settings_variant = job.GetJobEnvironmentKeyValue(
"AYON_DEFAULT_SETTINGS_VARIANT"
)
if settings_variant == "staging":
args.append("--use-staging")

Expand All @@ -583,9 +587,11 @@ def inject_ayon_environment(deadlinePlugin):
"AYON_BUNDLE_NAME": ayon_bundle_name,
}

automatic_tests = job.GetJobEnvironmentKeyValue("AYON_IN_TESTS")
if automatic_tests:
environment["AYON_IN_TESTS"] = automatic_tests
for key in ("AYON_USE_STAGING", "AYON_IN_TESTS"):
value = job.GetJobEnvironmentKeyValue(key)
if value:
environment[key] = value

for env, val in environment.items():
# Add the env var for the Render Plugin that is about to render
deadlinePlugin.SetEnvironmentVariable(env, val)
Expand Down

0 comments on commit f9556b3

Please sign in to comment.