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]>
  • Loading branch information
Daniel Neilson committed Sep 6, 2023
1 parent 786af57 commit f37ec62
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 53 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 OpenJobIO
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
14 changes: 7 additions & 7 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
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
22 changes: 11 additions & 11 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 @@ -301,14 +301,14 @@ def _start_maya_client(self) -> None:

# Add the OpenJobIO 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
10 changes: 5 additions & 5 deletions src/deadline/maya_submitter/adaptor_override_environment.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
specificationVersion: '2022-09-01'
specificationVersion: 'jobtemplate-2023-09'
parameters:
- name: OverrideAdaptorWheels
type: PATH
objectType: DIRECTORY
dataFlow: IN
description: A directory that contains wheels for openjobio, deadline, and the overridden adaptor.
description: A directory that contains wheels for openjd, deadline, and the overridden adaptor.
- name: OverrideAdaptorName
type: STRING
description: The name of the adaptor to override, for example NukeAdaptor or MayaAdaptor.
Expand Down Expand Up @@ -40,7 +40,7 @@ environment:
echo ""
echo "Installing adaptor into the venv"
pip install {{Param.OverrideAdaptorWheels}}/openjobio*.whl
pip install {{Param.OverrideAdaptorWheels}}/openjd*.whl
pip install {{Param.OverrideAdaptorWheels}}/deadline*.whl
echo ""
Expand Down Expand Up @@ -79,6 +79,6 @@ environment:
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}")
14 changes: 7 additions & 7 deletions src/deadline/maya_submitter/default_maya_job_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: Default Maya Job Template
parameters:
jobParameters:
- name: MayaSceneFile
type: PATH
objectType: FILE
Expand Down Expand Up @@ -75,7 +75,7 @@ parameters:
groupLabel: Software Environment
description: A space-separated list of Rez packages to install
default: mayaIO mtoa deadline_cloud_for_maya
environments:
jobEnvironments:
- name: Rez
description: Initializes and destroys the Rez environment for the run
script:
Expand Down Expand Up @@ -160,17 +160,17 @@ 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: Render
parameterSpace:
parameters:
taskParameterDefinitions:
- name: Frame
type: INT
range: '{{Param.Frames}}'
environments:
stepEnvironments:
- name: Maya
description: Runs Maya in the background.
script:
Expand Down
4 changes: 2 additions & 2 deletions src/deadline/maya_submitter/maya_render_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ def _get_job_template(
wheels_path_package_names = {
path.split("-", 1)[0] for path in os.listdir(wheels_path) if path.endswith(".whl")
}
if wheels_path_package_names != {"openjobio", "deadline", "deadline_cloud_for_maya"}:
if wheels_path_package_names != {"openjd", "deadline", "deadline_cloud_for_maya"}:
raise RuntimeError(
"The Developer Option 'Include Adaptor Wheels' is enabled, but the wheels directory contains the wrong wheels:\n"
+ "Expected: openjobio, deadline, and deadline_cloud_for_maya\n"
+ "Expected: openjd, deadline, and deadline_cloud_for_maya\n"
+ f"Actual: {wheels_path_package_names}"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import pytest
import jsonschema # type: ignore
from openjobio.adaptor_runtime_client import PathMappingRule
from openjd.adaptor_runtime_client import PathMappingRule

import deadline.maya_adaptor.MayaAdaptor.adaptor as adaptor_module
from deadline.maya_adaptor.MayaAdaptor import MayaAdaptor
Expand Down

0 comments on commit f37ec62

Please sign in to comment.