mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
convert deadline from ENV var to settings
This commit is contained in:
parent
3e60512150
commit
852823dcf9
14 changed files with 88 additions and 51 deletions
|
|
@ -373,8 +373,12 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
"""Plugin entry point."""
|
"""Plugin entry point."""
|
||||||
self._instance = instance
|
self._instance = instance
|
||||||
context = instance.context
|
context = instance.context
|
||||||
self._deadline_url = os.environ.get(
|
self._deadline_url = (
|
||||||
"DEADLINE_REST_URL", "http://localhost:8082")
|
context.data["system_settings"]
|
||||||
|
["modules"]
|
||||||
|
["deadline"]
|
||||||
|
["DEADLINE_REST_URL"]
|
||||||
|
)
|
||||||
assert self._deadline_url, "Requires DEADLINE_REST_URL"
|
assert self._deadline_url, "Requires DEADLINE_REST_URL"
|
||||||
|
|
||||||
file_path = None
|
file_path = None
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ class ExtractCelactionDeadline(pyblish.api.InstancePlugin):
|
||||||
"""Submit CelAction2D scene to Deadline
|
"""Submit CelAction2D scene to Deadline
|
||||||
|
|
||||||
Renders are submitted to a Deadline Web Service as
|
Renders are submitted to a Deadline Web Service as
|
||||||
supplied via the environment variable DEADLINE_REST_URL
|
supplied via settings key "DEADLINE_REST_URL".
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -37,10 +37,15 @@ class ExtractCelactionDeadline(pyblish.api.InstancePlugin):
|
||||||
instance.data["toBeRenderedOn"] = "deadline"
|
instance.data["toBeRenderedOn"] = "deadline"
|
||||||
context = instance.context
|
context = instance.context
|
||||||
|
|
||||||
DEADLINE_REST_URL = os.environ.get("DEADLINE_REST_URL")
|
deadline_url = (
|
||||||
assert DEADLINE_REST_URL, "Requires DEADLINE_REST_URL"
|
context.data["system_settings"]
|
||||||
|
["modules"]
|
||||||
|
["deadline"]
|
||||||
|
["DEADLINE_REST_URL"]
|
||||||
|
)
|
||||||
|
assert deadline_url, "Requires DEADLINE_REST_URL"
|
||||||
|
|
||||||
self.deadline_url = "{}/api/jobs".format(DEADLINE_REST_URL)
|
self.deadline_url = "{}/api/jobs".format(deadline_url)
|
||||||
self._comment = context.data.get("comment", "")
|
self._comment = context.data.get("comment", "")
|
||||||
self._deadline_user = context.data.get(
|
self._deadline_user = context.data.get(
|
||||||
"deadlineUser", getpass.getuser())
|
"deadlineUser", getpass.getuser())
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class FusionSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
"""Submit current Comp to Deadline
|
"""Submit current Comp to Deadline
|
||||||
|
|
||||||
Renders are submitted to a Deadline Web Service as
|
Renders are submitted to a Deadline Web Service as
|
||||||
supplied via the environment variable DEADLINE_REST_URL
|
supplied via settings key "DEADLINE_REST_URL".
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -32,9 +32,13 @@ class FusionSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
|
|
||||||
from avalon.fusion.lib import get_frame_path
|
from avalon.fusion.lib import get_frame_path
|
||||||
|
|
||||||
DEADLINE_REST_URL = api.Session.get("DEADLINE_REST_URL",
|
deadline_url = (
|
||||||
"http://localhost:8082")
|
context.data["system_settings"]
|
||||||
assert DEADLINE_REST_URL, "Requires DEADLINE_REST_URL"
|
["modules"]
|
||||||
|
["deadline"]
|
||||||
|
["DEADLINE_REST_URL"]
|
||||||
|
)
|
||||||
|
assert deadline_url, "Requires DEADLINE_REST_URL"
|
||||||
|
|
||||||
# Collect all saver instances in context that are to be rendered
|
# Collect all saver instances in context that are to be rendered
|
||||||
saver_instances = []
|
saver_instances = []
|
||||||
|
|
|
||||||
13
pype/plugins/global/publish/collect_settings.py
Normal file
13
pype/plugins/global/publish/collect_settings.py
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
from pyblish import api
|
||||||
|
from pype.api import get_current_project_settings, get_system_settings
|
||||||
|
|
||||||
|
|
||||||
|
class CollectSettings(api.ContextPlugin):
|
||||||
|
"""Collect Settings and store in the context."""
|
||||||
|
|
||||||
|
order = api.CollectorOrder - 0.491
|
||||||
|
label = "Collect Settings"
|
||||||
|
|
||||||
|
def process(self, context):
|
||||||
|
context.data["project_settings"] = get_current_project_settings()
|
||||||
|
context.data["system_settings"] = get_system_settings()
|
||||||
|
|
@ -305,7 +305,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
||||||
|
|
||||||
self.log.info("Submitting Deadline job ...")
|
self.log.info("Submitting Deadline job ...")
|
||||||
|
|
||||||
url = "{}/api/jobs".format(self.DEADLINE_REST_URL)
|
url = "{}/api/jobs".format(self.deadline_url)
|
||||||
response = requests.post(url, json=payload, timeout=10)
|
response = requests.post(url, json=payload, timeout=10)
|
||||||
if not response.ok:
|
if not response.ok:
|
||||||
raise Exception(response.text)
|
raise Exception(response.text)
|
||||||
|
|
@ -924,10 +924,13 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
||||||
}
|
}
|
||||||
|
|
||||||
if submission_type == "deadline":
|
if submission_type == "deadline":
|
||||||
self.DEADLINE_REST_URL = os.environ.get(
|
self.deadline_url = (
|
||||||
"DEADLINE_REST_URL", "http://localhost:8082"
|
context.data["system_settings"]
|
||||||
|
["modules"]
|
||||||
|
["deadline"]
|
||||||
|
["DEADLINE_REST_URL"]
|
||||||
)
|
)
|
||||||
assert self.DEADLINE_REST_URL, "Requires DEADLINE_REST_URL"
|
assert self.deadline_url, "Requires DEADLINE_REST_URL"
|
||||||
|
|
||||||
self._submit_deadline_post_job(instance, render_job, instances)
|
self._submit_deadline_post_job(instance, render_job, instances)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ from maya import cmds
|
||||||
import maya.app.renderSetup.model.renderSetup as renderSetup
|
import maya.app.renderSetup.model.renderSetup as renderSetup
|
||||||
|
|
||||||
from pype.hosts.maya import lib
|
from pype.hosts.maya import lib
|
||||||
|
from pype.api import get_system_settings
|
||||||
import avalon.maya
|
import avalon.maya
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -124,8 +125,11 @@ class CreateRender(avalon.maya.Creator):
|
||||||
# get pools
|
# get pools
|
||||||
pools = []
|
pools = []
|
||||||
|
|
||||||
deadline_url = os.environ.get("DEADLINE_REST_URL", None)
|
system_settings = get_system_settings()["modules"]
|
||||||
muster_url = os.environ.get("MUSTER_REST_URL", None)
|
|
||||||
|
deadline_url = system_settings["deadline"]["DEADLINE_REST_URL"]
|
||||||
|
muster_url = system_settings["muster"]["MUSTER_REST_URL"]
|
||||||
|
|
||||||
if deadline_url and muster_url:
|
if deadline_url and muster_url:
|
||||||
self.log.error(
|
self.log.error(
|
||||||
"Both Deadline and Muster are enabled. " "Cannot support both."
|
"Both Deadline and Muster are enabled. " "Cannot support both."
|
||||||
|
|
|
||||||
|
|
@ -238,11 +238,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
"""Submit available render layers to Deadline.
|
"""Submit available render layers to Deadline.
|
||||||
|
|
||||||
Renders are submitted to a Deadline Web Service as
|
Renders are submitted to a Deadline Web Service as
|
||||||
supplied via the environment variable ``DEADLINE_REST_URL``.
|
supplied via settings key "DEADLINE_REST_URL".
|
||||||
|
|
||||||
Note:
|
|
||||||
If Deadline configuration is not detected, this plugin will
|
|
||||||
be disabled.
|
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
use_published (bool): Use published scene to render instead of the
|
use_published (bool): Use published scene to render instead of the
|
||||||
|
|
@ -254,11 +250,6 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
order = pyblish.api.IntegratorOrder + 0.1
|
order = pyblish.api.IntegratorOrder + 0.1
|
||||||
hosts = ["maya"]
|
hosts = ["maya"]
|
||||||
families = ["renderlayer"]
|
families = ["renderlayer"]
|
||||||
if not os.environ.get("DEADLINE_REST_URL"):
|
|
||||||
optional = False
|
|
||||||
active = False
|
|
||||||
else:
|
|
||||||
optional = True
|
|
||||||
|
|
||||||
use_published = True
|
use_published = True
|
||||||
tile_assembler_plugin = "PypeTileAssembler"
|
tile_assembler_plugin = "PypeTileAssembler"
|
||||||
|
|
@ -267,9 +258,16 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
def process(self, instance):
|
def process(self, instance):
|
||||||
"""Plugin entry point."""
|
"""Plugin entry point."""
|
||||||
instance.data["toBeRenderedOn"] = "deadline"
|
instance.data["toBeRenderedOn"] = "deadline"
|
||||||
|
context = instance.context
|
||||||
|
|
||||||
self._instance = instance
|
self._instance = instance
|
||||||
self._deadline_url = os.environ.get(
|
self._deadline_url = (
|
||||||
"DEADLINE_REST_URL", "http://localhost:8082")
|
context.data["system_settings"]
|
||||||
|
["modules"]
|
||||||
|
["deadline"]
|
||||||
|
["DEADLINE_REST_URL"]
|
||||||
|
)
|
||||||
|
|
||||||
assert self._deadline_url, "Requires DEADLINE_REST_URL"
|
assert self._deadline_url, "Requires DEADLINE_REST_URL"
|
||||||
|
|
||||||
context = instance.context
|
context = instance.context
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin):
|
||||||
order = pyblish.api.ValidatorOrder
|
order = pyblish.api.ValidatorOrder
|
||||||
hosts = ["maya"]
|
hosts = ["maya"]
|
||||||
families = ["renderlayer"]
|
families = ["renderlayer"]
|
||||||
if not os.environ.get("DEADLINE_REST_URL"):
|
|
||||||
active = False
|
|
||||||
|
|
||||||
def process(self, context):
|
def process(self, context):
|
||||||
|
|
||||||
|
|
@ -21,14 +19,15 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin):
|
||||||
if not contextplugin_should_run(self, context):
|
if not contextplugin_should_run(self, context):
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
deadline_url = (
|
||||||
DEADLINE_REST_URL = os.environ["DEADLINE_REST_URL"]
|
context.data["system_settings"]
|
||||||
except KeyError:
|
["modules"]
|
||||||
self.log.error("Deadline REST API url not found.")
|
["deadline"]
|
||||||
raise ValueError("Deadline REST API url not found.")
|
["DEADLINE_REST_URL"]
|
||||||
|
)
|
||||||
|
|
||||||
# Check response
|
# Check response
|
||||||
response = self._requests_get(DEADLINE_REST_URL)
|
response = self._requests_get(deadline_url)
|
||||||
assert response.ok, "Response must be ok"
|
assert response.ok, "Response must be ok"
|
||||||
assert response.text.startswith("Deadline Web Service "), (
|
assert response.text.startswith("Deadline Web Service "), (
|
||||||
"Web service did not respond with 'Deadline Web Service'"
|
"Web service did not respond with 'Deadline Web Service'"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
"""Submit write to Deadline
|
"""Submit write to Deadline
|
||||||
|
|
||||||
Renders are submitted to a Deadline Web Service as
|
Renders are submitted to a Deadline Web Service as
|
||||||
supplied via the environment variable DEADLINE_REST_URL
|
supplied via settings key "DEADLINE_REST_URL".
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -34,11 +34,15 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
node = instance[0]
|
node = instance[0]
|
||||||
context = instance.context
|
context = instance.context
|
||||||
|
|
||||||
DEADLINE_REST_URL = os.environ.get("DEADLINE_REST_URL",
|
deadline_url = (
|
||||||
"http://localhost:8082")
|
context.data["system_settings"]
|
||||||
assert DEADLINE_REST_URL, "Requires DEADLINE_REST_URL"
|
["modules"]
|
||||||
|
["deadline"]
|
||||||
|
["DEADLINE_REST_URL"]
|
||||||
|
)
|
||||||
|
assert deadline_url, "Requires DEADLINE_REST_URL"
|
||||||
|
|
||||||
self.deadline_url = "{}/api/jobs".format(DEADLINE_REST_URL)
|
self.deadline_url = "{}/api/jobs".format(deadline_url)
|
||||||
self._comment = context.data.get("comment", "")
|
self._comment = context.data.get("comment", "")
|
||||||
self._ver = re.search(r"\d+\.\d+", context.data.get("hostVersion"))
|
self._ver = re.search(r"\d+\.\d+", context.data.get("hostVersion"))
|
||||||
self._deadline_user = context.data.get(
|
self._deadline_user = context.data.get(
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
},
|
},
|
||||||
"publish": {
|
"publish": {
|
||||||
"CollectMayaRender": {
|
"CollectMayaRender": {
|
||||||
"sync_workfile_version": true
|
"sync_workfile_version": false
|
||||||
},
|
},
|
||||||
"ValidateCameraAttributes": {
|
"ValidateCameraAttributes": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|
@ -134,6 +134,9 @@
|
||||||
"ValidateMeshHasOverlappingUVs": {
|
"ValidateMeshHasOverlappingUVs": {
|
||||||
"enabled": false
|
"enabled": false
|
||||||
},
|
},
|
||||||
|
"ValidateAttributes": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
"ExtractCameraAlembic": {
|
"ExtractCameraAlembic": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
|
@ -316,4 +319,4 @@
|
||||||
"ValidateNoAnimation": false
|
"ValidateNoAnimation": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -123,4 +123,4 @@
|
||||||
"help": "Script exported from matchmoving application"
|
"help": "Script exported from matchmoving application"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -169,11 +169,11 @@
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"workspace_name": "studio name"
|
"workspace_name": "studio name"
|
||||||
},
|
},
|
||||||
"Deadline": {
|
"deadline": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"DEADLINE_REST_URL": "http://localhost:8082"
|
"DEADLINE_REST_URL": "http://localhost:8082"
|
||||||
},
|
},
|
||||||
"Muster": {
|
"muster": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"MUSTER_REST_URL": "http://127.0.0.1:9890",
|
"MUSTER_REST_URL": "http://127.0.0.1:9890",
|
||||||
"templates_mapping": {
|
"templates_mapping": {
|
||||||
|
|
|
||||||
|
|
@ -344,12 +344,12 @@
|
||||||
"label": "Deadline Group"
|
"label": "Deadline Group"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "text",
|
"type": "number",
|
||||||
"key": "deadline_chunk_size",
|
"key": "deadline_chunk_size",
|
||||||
"label": "Deadline Chunk Size"
|
"label": "Deadline Chunk Size"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "text",
|
"type": "number",
|
||||||
"key": "deadline_priority",
|
"key": "deadline_priority",
|
||||||
"label": "Deadline Priotity"
|
"label": "Deadline Priotity"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
]
|
]
|
||||||
}, {
|
}, {
|
||||||
"type": "dict",
|
"type": "dict",
|
||||||
"key": "Deadline",
|
"key": "deadline",
|
||||||
"label": "Deadline",
|
"label": "Deadline",
|
||||||
"collapsable": true,
|
"collapsable": true,
|
||||||
"checkbox_key": "enabled",
|
"checkbox_key": "enabled",
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
"type": "dict",
|
"type": "dict",
|
||||||
"key": "Muster",
|
"key": "muster",
|
||||||
"label": "Muster",
|
"label": "Muster",
|
||||||
"collapsable": true,
|
"collapsable": true,
|
||||||
"checkbox_key": "enabled",
|
"checkbox_key": "enabled",
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
}, {
|
}, {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"key": "MUSTER_REST_URL",
|
"key": "MUSTER_REST_URL",
|
||||||
"label": "Muster Resl URL"
|
"label": "Muster Rest URL"
|
||||||
}, {
|
}, {
|
||||||
"type": "dict-modifiable",
|
"type": "dict-modifiable",
|
||||||
"object_type": {
|
"object_type": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue