Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Support for mutliple installed versions #3456

Conversation

antirotor
Copy link
Member

@antirotor antirotor commented Jun 30, 2022

Feature

This PR is adding support for multiple installed versions (builds) on the same system. It will allow easy rollback and testing on farms and without disrupting existing running sessions.

On Deadline, it is now passing OpenPype version as OPENPYPE_VERSION to the job. If this environment variable is found on the job, Deadline will try to find compatible version build to use for launching that version of OpenPype. So if job was submitted from OpenPype version 3.12.2 Deadline will try to find any build that matches 3.12 and will use the latest available. Deadline will try to find it in directories specified in OpenPypeInstallationDirs configuration option.

It relies on functionality implemented here #3445.

Deployment Notes

Since #3445 you can have multiple versions of OpenPype installed on Windows. This was possible even before with Linux, but it was missing logic that will load only versions from the update zips/repository compatible with the currently running build.

So with this PR, running build will "see" only versions compatible with it and will use only them. For Deadline, where this process is reversed - you know what version was used to create the submission and you need to find correct build to launch it, you need to put builds under some common directory do OpenPype can detect them. On Windows, this is by default C:\Program Files (x86)\OpenPype but it can be any directory following logic that its direct subdirectories should contain separate build available. So with Deadline, you need to point it to the directory with following structure: /some/op/dir/3.12.2-nightly.2, /some/op/dir/3.13.0 and so on.

Testing

For proper testing, you need to create few "mock" build versions of OpenPype. It should be enough to change openpype/version.py and running tools/build.ps1|sh and after each run store produced version somewhere.

Visibility of compatible versions

OpenPype should by default see only versions compatible with the running build. So issuing command like:

.\.poetry\bin\poetry.exe run python start.py --list-versions

or

& "C:\Program Files (x86)\OpenPype\3.12.2-nightly.3\openpype_console.exe" --list-versions

should show only versions compatible with that particular build.

Deadline

When testing, don't forget to update Deadline plugins in Deadline repository.

You need to configure OpenPype Deadline plugin:

image

Add path to OpenPype Installation Directories. This is path-per-line, first found is used.

Jobs submitted to Deadline should have set OPENPYPE_VERSION to correct one. In job log, you should find messages about version resolution.

Implementation steps:

  • change Inno Setup to allow multiple versions intalled on Windows Windows installer: Clean old files and add version subfolder #3445
  • implement compatibility checks to functions detecting OP versions
  • change unzipping and tools to look into version folders in user data folder
  • mark as deprecated looking for versions in common folder
  • fix unit tests
  • implement version selector in the Deadline global event / OP plugin1

🧑‍🏭 TODO: find out how to deal with multiple installations on mac.

Resolves #3415
Resolves #3416
Resolves #3439

Footnotes

  1. This would go over all specified path to OpenPype in Deadline and try to find requested version among them.

# Conflicts:
#	openpype/plugins/publish/integrate_new.py
… in CollectAnatomyContextData and CollectAnatomyInstanceData.

This currently was duplicated logic and should not be handled in the Integrator
- This is moved from the Integrate Asset New settings
@antirotor antirotor marked this pull request as ready for review July 25, 2022 11:44
@antirotor antirotor added the Bump Minor Pull requests that update a dependency file label Jul 25, 2022
@antirotor antirotor changed the base branch from develop to release/3.13.x July 25, 2022 12:13
Copy link
Member

@m-u-r-p-h-y m-u-r-p-h-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sry wrong PR

@antirotor
Copy link
Member Author

Currently there is one limitation and that is that Deadline cannot work with the sources. It will find the version correctly, but then it is looking for openpype_console executable that is present only in the build. Question is how to handle this in platform independent manner, because running OP from sources basically involves running Poetry like this ./.poetry/bin/poetry run python start.py

@iLLiCiTiT
Copy link
Member

It's hard to review when there are changes from develop.

Copy link
Member

@m-u-r-p-h-y m-u-r-p-h-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a build and put it in the defined folder

Error: Global job preload script 'C:\ProgramData\Thinkbox\Deadline10\workers\WS01\plugins\62e251cea96635187cc30a45\GlobalJobPreLoad.py': TypeError : can only concatenate str (not "list") to str (FranticX.Scripting.PythonNetException)
  File "C:\ProgramData\Thinkbox\Deadline10\workers\WS01\plugins\62e251cea96635187cc30a45\GlobalJobPreLoad.py", line 290, in __main__
    inject_openpype_environment(deadlinePlugin)
  File "C:\ProgramData\Thinkbox\Deadline10\workers\WS01\plugins\62e251cea96635187cc30a45\GlobalJobPreLoad.py", line 105, in inject_openpype_environment
    "The path to the render executable can be configured " + 

image

@antirotor
Copy link
Member Author

Closing in favour of pure 3.13.x based branch to ease out testing.

@antirotor antirotor closed this Aug 1, 2022
@mkolar mkolar deleted the feature/OP-3458_support-for-multiple-build-versions branch December 9, 2022 13:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bump Minor Pull requests that update a dependency file type: feature Larger, user affecting changes and completely new things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for multiple build versions
7 participants