Skip to content

Commit

Permalink
feat!: update to the 2023-09 job template schema
Browse files Browse the repository at this point in the history
The job template schema is being updated for service release. With it,
the implementation library is being updated in a breaking way and so
this code needs to be updated to that revision. This includes a rename
of the job template's specification name from the codename openjobio
to Open Job Description.

Signed-off-by: Daniel Neilson <[email protected]>
Signed-off-by: Mark Wiebe <[email protected]>
  • Loading branch information
Daniel Neilson committed Sep 7, 2023
1 parent 786af57 commit ef4e0b4
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 92 deletions.
10 changes: 5 additions & 5 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ WARNING: This workflow installs additional Python packages into your Maya's pyth

1. Create a development location within which to do your git checkouts. For example `~/deadline-clients`.
Clone packages from this directory with commands like
`git clone [email protected]:casillas2/deadline-cloud-for-maya.git`. You'll also want the `deadline-cloud` and `openjobio` repos.
`git clone [email protected]:casillas2/deadline-cloud-for-maya.git`. You'll also want the `deadline-cloud` and `openjd` repos.
2. Switch to your Maya directory, like `cd "C:\Program Files\Autodesk\Maya2023"`.
3. Run `.\mayapy -m pip install -e C:\Users\<username>\deadline-clients\deadline-cloud` to install the Amazon Deadline Cloud Client
Library in edit mode.
4. Run `.\mayapy -m pip install -e C:\Users\<username>\deadline-clients\openjobio` to install the OpenJobIO
4. Run `.\mayapy -m pip install -e C:\Users\<username>\deadline-clients\openjd` to install the Open Job Description
Library in edit mode.
5. Run `.\mayapy -m pip install -e C:\Users\<username>\deadline-clients\deadline-cloud-for-maya` to install the Maya Submtiter
in edit mode.
Expand All @@ -48,21 +48,21 @@ your build of the adaptor for the one in the service.

1. Use the development location from the Submitter Development Workflow.
Make sure you're running Maya with `set DEADLINE_ENABLE_DEVELOPER_OPTIONS=true` enabled.
2. Build wheels for `openjobio`, `deadline` and `deadline-cloud-for-maya`.
2. Build wheels for `openjd`, `deadline` and `deadline-cloud-for-maya`.
```
# If you don't have the build package installed already
$ pip install build
...
$ mkdir wheels; \
rm wheels/*; \
for dir in ../openjobio ../deadline-cloud ../deadline-cloud-for-maya; \
for dir in ../openjd ../deadline-cloud ../deadline-cloud-for-maya; \
do python -m build --wheel --outdir ./wheels --skip-dependency-check $dir; \
done
...
$ ls ./wheels
deadline_cloud_for_maya-<version>-py3-none-any.whl
deadline-<version>-py3-none-any.whl
openjobio-<version>-py3-none-any.whl
openjd-<version>-py3-none-any.whl
```
3. Open the Maya integrated submitter, and in the Job-Specific Settings tab, enable the option 'Include Adaptor Wheels'. This
option is only visible when the environment variable `DEADLINE_ENABLE_DEVELOPER_OPTIONS` is set to `true`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This package has two active branches:
- `mainline` -- For active development. This branch is not intended to be consumed by other packages. Any commit to this branch may break APIs, dependencies, and so on, and thus break any consumer without notice.
- `release` -- The official release of the package intended for consumers. Any breaking releases will be accompanied with an increase to this package's interface version.

The deadline.maya_adaptor package is an adaptor that renders maya scenes through MayaPy. It uses the openjobio adaptor_runtime and supports job stickiness.
The deadline.maya_adaptor package is an adaptor that renders maya scenes through MayaPy. It uses the Open Job Description adaptor_runtime and supports job stickiness.

## Development

Expand Down
4 changes: 2 additions & 2 deletions depsBundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def _get_dependencies(pyproject_dict: dict[str, Any]) -> list[str]:
raise Exception("pyproject.toml is missing dependencies section")

dependencies = pyproject_dict["project"]["dependencies"]
deps_noopenjobio = filter(lambda dep: not dep.startswith("openjobio"), dependencies)
return list(map(lambda dep: dep.replace(" ", ""), deps_noopenjobio))
deps_noopenjd = filter(lambda dep: not dep.startswith("openjd"), dependencies)
return list(map(lambda dep: dep.replace(" ", ""), deps_noopenjd))


def _get_package_version_regex(package: str) -> re.Pattern:
Expand Down
14 changes: 7 additions & 7 deletions job_bundle_output_tests/cube/expected_job_bundle/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
specificationVersion: '2022-09-01'
specificationVersion: jobtemplate-2023-09
name: cube.ma
parameters:
parameterDefinitions:
- name: MayaSceneFile
type: PATH
objectType: FILE
Expand Down Expand Up @@ -97,7 +97,7 @@ parameters:
groupLabel: Maya Settings
minValue: 1
description: The image height of the output.
environments:
jobEnvironments:
- name: Rez
description: Initializes and destroys the Rez environment for the run
script:
Expand Down Expand Up @@ -182,21 +182,21 @@ environments:
for k, v in put.items():
print(f"updating {k}={v}")
print(f"openjobio_env: {k}={v}")
print(f"openjd_env: {k}={v}")
for k in delete:
print(f"openjobio_unset_env: {k}")
print(f"openjd_unset_env: {k}")
steps:
- name: masterLayer
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.Frames}}'
- name: Camera
type: STRING
range:
- persp
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down
30 changes: 15 additions & 15 deletions job_bundle_output_tests/layers/expected_job_bundle/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
specificationVersion: '2022-09-01'
specificationVersion: jobtemplate-2023-09
name: layers.ma
parameters:
parameterDefinitions:
- name: MayaSceneFile
type: PATH
objectType: FILE
Expand Down Expand Up @@ -232,7 +232,7 @@ parameters:
allowedValues:
- 'true'
- 'false'
environments:
jobEnvironments:
- name: Rez
description: Initializes and destroys the Rez environment for the run
script:
Expand Down Expand Up @@ -317,21 +317,21 @@ environments:
for k, v in put.items():
print(f"updating {k}={v}")
print(f"openjobio_env: {k}={v}")
print(f"openjd_env: {k}={v}")
for k in delete:
print(f"openjobio_unset_env: {k}")
print(f"openjd_unset_env: {k}")
steps:
- name: layerDefaultFrames
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.layerDefaultFramesFrames}}'
- name: Camera
type: STRING
range:
- camera1
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down Expand Up @@ -396,7 +396,7 @@ steps:
mode: NOTIFY_THEN_TERMINATE
- name: layerFrameRange1
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.layerFrameRange1Frames}}'
Expand All @@ -405,7 +405,7 @@ steps:
range:
- camera1
- persp
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down Expand Up @@ -469,7 +469,7 @@ steps:
mode: NOTIFY_THEN_TERMINATE
- name: masterLayer
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.masterLayerFrames}}'
Expand All @@ -478,7 +478,7 @@ steps:
range:
- camera1
- persp
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down Expand Up @@ -543,7 +543,7 @@ steps:
mode: NOTIFY_THEN_TERMINATE
- name: renderSetupLayer2
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.renderSetupLayer2Frames}}'
Expand All @@ -553,7 +553,7 @@ steps:
- camera1
- camera2
- camera3
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down Expand Up @@ -618,7 +618,7 @@ steps:
mode: NOTIFY_THEN_TERMINATE
- name: renderSetupLayer4
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.renderSetupLayer4Frames}}'
Expand All @@ -627,7 +627,7 @@ steps:
range:
- camera1
- persp
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
specificationVersion: '2022-09-01'
specificationVersion: jobtemplate-2023-09
name: layers_no_variation.ma
parameters:
parameterDefinitions:
- name: MayaSceneFile
type: PATH
objectType: FILE
Expand Down Expand Up @@ -108,7 +108,7 @@ parameters:
allowedValues:
- 'true'
- 'false'
environments:
jobEnvironments:
- name: Rez
description: Initializes and destroys the Rez environment for the run
script:
Expand Down Expand Up @@ -193,21 +193,21 @@ environments:
for k, v in put.items():
print(f"updating {k}={v}")
print(f"openjobio_env: {k}={v}")
print(f"openjd_env: {k}={v}")
for k in delete:
print(f"openjobio_unset_env: {k}")
print(f"openjd_unset_env: {k}")
steps:
- name: layerTheFIrst
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.Frames}}'
- name: Camera
type: STRING
range:
- persp
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down Expand Up @@ -272,15 +272,15 @@ steps:
mode: NOTIFY_THEN_TERMINATE
- name: layerTheSecond
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.Frames}}'
- name: Camera
type: STRING
range:
- persp
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down Expand Up @@ -345,15 +345,15 @@ steps:
mode: NOTIFY_THEN_TERMINATE
- name: masterLayer
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.Frames}}'
- name: Camera
type: STRING
range:
- persp
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ license = ""
requires-python = ">=3.7"

dependencies = [
"deadline == 0.20.*",
"openjobio == 0.8.*",
"deadline == 0.21.*",
"openjd == 0.10.*",
]

[project.scripts]
Expand Down
2 changes: 1 addition & 1 deletion src/deadline/maya_adaptor/MayaAdaptor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import sys

from openjobio.adaptor_runtime import EntryPoint
from openjd.adaptor_runtime import EntryPoint

from .adaptor import MayaAdaptor

Expand Down
24 changes: 12 additions & 12 deletions src/deadline/maya_adaptor/MayaAdaptor/adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
from pathlib import Path
from typing import Callable

from openjobio.adaptor_runtime.adaptors import Adaptor, AdaptorDataValidators
from openjobio.adaptor_runtime_client import Action
from openjobio.adaptor_runtime.adaptors.configuration import AdaptorConfiguration
from openjobio.adaptor_runtime.process import LoggingSubprocess
from openjobio.adaptor_runtime.app_handlers import RegexCallback, RegexHandler
from openjobio.adaptor_runtime.application_ipc import ActionsQueue, AdaptorServer
from openjobio.adaptor_runtime._utils import secure_open
from openjd.adaptor_runtime.adaptors import Adaptor, AdaptorDataValidators
from openjd.adaptor_runtime_client import Action
from openjd.adaptor_runtime.adaptors.configuration import AdaptorConfiguration
from openjd.adaptor_runtime.process import LoggingSubprocess
from openjd.adaptor_runtime.app_handlers import RegexCallback, RegexHandler
from openjd.adaptor_runtime.application_ipc import ActionsQueue, AdaptorServer
from openjd.adaptor_runtime._utils import secure_open

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -299,16 +299,16 @@ def _start_maya_client(self) -> None:
mayapy_exe = "mayapy"
regexhandler = RegexHandler(self._get_regex_callbacks())

# Add the OpenJobIO namespace directory to PYTHONPATH, so that adaptor_runtime_client
# Add the openjd namespace directory to PYTHONPATH, so that adaptor_runtime_client
# will be available directly to the adaptor client.
import openjobio.adaptor_runtime_client
import openjd.adaptor_runtime_client
import deadline.maya_adaptor

openjobio_namespace_dir = os.path.dirname(
os.path.dirname(openjobio.adaptor_runtime_client.__file__)
openjd_namespace_dir = os.path.dirname(
os.path.dirname(openjd.adaptor_runtime_client.__file__)
)
deadline_namespace_dir = os.path.dirname(os.path.dirname(deadline.maya_adaptor.__file__))
python_path_addition = f"{openjobio_namespace_dir}{os.pathsep}{deadline_namespace_dir}"
python_path_addition = f"{openjd_namespace_dir}{os.pathsep}{deadline_namespace_dir}"
if "PYTHONPATH" in os.environ:
os.environ[
"PYTHONPATH"
Expand Down
4 changes: 2 additions & 2 deletions src/deadline/maya_adaptor/MayaClient/maya_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from types import FrameType
from typing import Optional

# The Maya Adaptor adds the `openjobio` namespace directory to PYTHONPATH,
# The Maya Adaptor adds the `openjd` namespace directory to PYTHONPATH,
# so that importing just the adaptor_runtime_client should work.
try:
from adaptor_runtime_client import HTTPClientInterface # type: ignore[import]
from maya_adaptor.MayaClient.render_handlers import ( # type: ignore[import]
get_render_handler,
)
except (ImportError, ModuleNotFoundError):
from openjobio.adaptor_runtime_client import HTTPClientInterface # type: ignore[import]
from openjd.adaptor_runtime_client import HTTPClientInterface # type: ignore[import]
from deadline.maya_adaptor.MayaClient.render_handlers import ( # type: ignore[import]
get_render_handler,
)
Expand Down
Loading

0 comments on commit ef4e0b4

Please sign in to comment.