Fix - added local targets to install host

By default when host is started, it should register targets to 'local', only if specific env var is set (OPENPYPE_REMOTE_PUBLISH) it should be 'remote'. This means
farm is using host to collect/validate/extract and publish on behalf of artist.
This commit is contained in:
Petr Kalis 2022-06-08 14:46:16 +02:00
parent e7937931e9
commit 56a3dae94b
4 changed files with 11 additions and 3 deletions

View file

@ -66,7 +66,7 @@ def install():
log.info("Installing callbacks ... ")
register_event_callback("init", on_init)
if os.environ.get("HEADLESS_PUBLISH"):
if os.environ.get("OPENPYPE_REMOTE_PUBLISH"):
# Maya launched on farm, lib.IS_HEADLESS might be triggered locally too
# target "farm" == rendering on farm, expects OPENPYPE_PUBLISH_DATA
# target "remote" == remote execution

View file

@ -115,7 +115,7 @@ class MayaSubmitRemotePublishDeadline(openpype.api.Integrator):
environment["OPENPYPE_REMOTE_JOB"] = "1"
environment["OPENPYPE_USERNAME"] = instance.context.data["user"]
environment["OPENPYPE_PUBLISH_SUBSET"] = instance.data["subset"]
environment["HEADLESS_PUBLISH"] = "1"
environment["OPENPYPE_REMOTE_PUBLISH"] = "1"
payload["JobInfo"].update({
"EnvironmentKeyValue%d" % index: "{key}={value}".format(

View file

@ -104,6 +104,14 @@ def install_host(host):
MessageHandler.emit = modified_emit
if os.environ.get("OPENPYPE_REMOTE_PUBLISH"):
# target "farm" == rendering on farm, expects OPENPYPE_PUBLISH_DATA
# target "remote" == remote execution, installs host
print("Registering pyblish target: remote")
pyblish.api.register_target("remote")
else:
pyblish.api.register_target("local")
install_openpype_plugins()

View file

@ -23,7 +23,7 @@ class Integrator(InstancePlugin):
Wraps pyblish instance plugin. Targets set to "local" which means all
integrators should run on "local" publishes, by default.
"farm" targets could be used for integrators that should run on a farm.
"remote" targets could be used for integrators that should run externally.
"""
targets = ["local"]