Skip to content

Commit

Permalink
chore(deps)!: Update to openjd-runtime-adaptor (#32)
Browse files Browse the repository at this point in the history
move to deadline-0.30 and move to openjd-adaptor-runtime as openjd has been deprecated.

---------

Signed-off-by: Alex Gerveshi <[email protected]>
  • Loading branch information
agerveshi authored Oct 11, 2023
1 parent b0d36fe commit a51edc8
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 65 deletions.
47 changes: 21 additions & 26 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,48 @@ All of the testing and development dependencies are in the `setup.cfg` and are m

`./build.sh` will build and run `pytest`.

# Submitter Development Workflow
## Submitter Development Workflow

WARNING: This workflow installs additional Python packages into your Maya's python distribution.

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 `openjd` repos.
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 `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\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.
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\openjd-adaptor-runtime-for-python` to install the Open Job Description Adaptor Runtime Library in edit mode.
5. Run `.\mayapy -m pip install -e C:\Users\<username>\deadline-clients\deadline-cloud-for-maya` to install the Maya submitter in edit mode.
6. Edit (create if missing) your `~/Documents/maya/2023/Maya.env` file, and add the following lines to it:
```

```bash
DEADLINE_ENABLE_DEVELOPER_OPTIONS=true
MAYA_MODULE_PATH=C:\Users\<username>\deadline-clients\deadline-cloud-for-maya\maya_submitter_plugin
```

The developer options add a shelf TEST button you can use to run the tests from the `job_bundle_output_tests` directory.
7. Run Maya. Go to Windows > Settings/Preferences > Plug-In Manager and you will find that
`DeadlineCloudForMaya.py` is available as a plugin. Check the checkbox to have Maya load
the plugin and create the Deadline tray for you. Click the icon on the tray to open the submitter.
7. Run Maya. Go to Windows > Settings/Preferences > Plug-In Manager and you will find that `DeadlineCloudForMaya.py` is available as a plugin. Check the checkbox to have Maya load the plugin and create the Deadline tray for you. Click the icon on the tray to open the submitter.

# Application Interface Adaptor Development Workflow
## Application Interface Adaptor Development Workflow

You can work on the adaptor alongside your submitter development workflow using a Deadline Cloud
farm that uses a service-managed fleet. You'll need to perform the following steps to subsititute
farm that uses a service-managed fleet. You'll need to perform the following steps to substitute
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 `openjd`, `deadline` and `deadline-cloud-for-maya`, place them in a "wheels"
folder in `deadline-cloud-for-maya`. A script is provided to do this, just execute from `deadline-cloud-for-maya`:
```
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 `openjd_adaptor_runtime`, `deadline` and `deadline_cloud_for_maya`, place them in a "wheels" folder in `deadline-cloud-for-maya`. A script is provided to do this, just execute from `deadline-cloud-for-maya`:

```bash
# If you don't have the build package installed already
$ pip install build
...
$ ./scripts/build_wheels.sh
```

Wheels should have been generated in the "wheels" folder:
```

```bash
$ ls ./wheels
deadline_cloud_for_maya-<version>-py3-none-any.whl
deadline-<version>-py3-none-any.whl
openjd-<version>-py3-none-any.whl
openjd_adaptor_runtime-<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`.
Then submit your test job.

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`. Then submit your test job.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Amazon Deadline Cloud for Maya
# Amazon Deadline Cloud for Maya

This package has two active branches:

Expand All @@ -9,30 +9,37 @@ The deadline.maya_adaptor package is an adaptor that renders maya scenes through

## Development

# Build / Test / Release
See [DEVELOPMENT](DEVELOPMENT.md) for more information.

## Build the package.
```
## Build / Test / Release

### Build the package

```bash
hatch build
```

## Run tests
```
### Run tests

```bash
hatch run test
```

## Run linting
```
### Run linting

```bash
hatch run lint
```

## Run formating
```
### Run formatting

```bash
hatch run fmt
```

## Run tests for all supported Python versions.
```
### Run tests for all supported Python versions

```bash
hatch run all:test
```

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.28.*",
"openjd == 0.10.*",
"deadline == 0.30.*",
"openjd-adaptor-runtime == 0.3.*",
]

[project.scripts]
Expand Down
6 changes: 4 additions & 2 deletions scripts/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ if [ ! -d wheels ]; then
fi
rm -f wheels/*

for dir in ../openjobio ../deadline-cloud ../deadline-cloud-for-maya; do
for dir in ../openjd-adaptor-runtime-for-python ../deadline-cloud ../deadline-cloud-for-maya; do
echo "Building $dir..."
python -m build --wheel --outdir ./wheels --skip-dependency-check $dir
cd $dir
hatch build
mv dist/*.whl ../deadline-cloud-for-maya/wheels/
done
8 changes: 6 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,14 @@ 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 != {"openjd", "deadline", "deadline_cloud_for_maya"}:
if wheels_path_package_names != {
"openjd_adaptor_runtime",
"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: openjd, deadline, and deadline_cloud_for_maya\n"
+ "Expected: openjd_adaptor_runtime, deadline, and deadline_cloud_for_maya\n"
+ f"Actual: {wheels_path_package_names}"
)

Expand Down
10 changes: 5 additions & 5 deletions test/deadline_adaptor_for_maya/unit/MayaAdaptor/test_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def test_populate_action_queue_test_mapping(
mock_actions_queue.__len__.return_value = 0
mock_rules.return_value = [
PathMappingRule(
source_os="linux",
source_path_format="posix",
source_path="/source",
destination_os="linux",
destination_path="/destination",
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_arnold_pathmapping_called(
mock_actions_queue.__len__.return_value = 0
mock_rules.return_value = [
PathMappingRule(
source_os="linux",
source_path_format="posix",
source_path="/source",
destination_os="linux",
destination_path="/destination",
Expand Down Expand Up @@ -324,19 +324,19 @@ def test_arnold_pathmapping(
# GIVEN
mock_rules.return_value = [
PathMappingRule(
source_os="linux",
source_path_format="posix",
source_path="/source",
destination_os="linux",
destination_path="/destination",
),
PathMappingRule(
source_os="windows",
source_path_format="windows",
source_path="C:\\source",
destination_os="linux",
destination_path="/destination",
),
PathMappingRule(
source_os="mac os",
source_path_format="posix",
source_path="/mac_source",
destination_os="linux",
destination_path="/destination",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ def __eq__(self, other: Any) -> bool:
)
def test_initialize_plugin_exc(mock_reload: Mock, mock_confirm_dialog: Mock) -> None:
# GIVEN

# WHEN
with pytest.raises(Exception) as exc_info:
DeadlineCloudForMaya.initializePlugin(Mock())

# THEN
assert exc_info.value is mock_reload.side_effect
mock_confirm_dialog.assert_called_once_with(
title="Deadline Cloud For Maya Plugin Failed To Load",
message=(
"Encountered the following exception while loading the Deadline Cloud Submitter:\n"
f"{str(exc_info.value)}"
),
button="OK",
defaultButton="OK",
)
with patch.object(DeadlineCloudForMaya, "_first_initialization", False):
# WHEN
with pytest.raises(Exception) as exc_info:
DeadlineCloudForMaya.initializePlugin(Mock())

# THEN
assert exc_info.value is mock_reload.side_effect
mock_confirm_dialog.assert_called_once_with(
title="Deadline Cloud For Maya Plugin Failed To Load",
message=(
"Encountered the following exception while loading the Deadline Cloud Submitter:\n"
f"{str(exc_info.value)}"
),
button="OK",
defaultButton="OK",
)

0 comments on commit a51edc8

Please sign in to comment.