Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadline: webservice password #200

Merged
merged 57 commits into from
May 6, 2024

Conversation

kalisp
Copy link
Member

@kalisp kalisp commented Mar 19, 2024

Changelog Description

This PR provides support for Deadline Webservice authentication.

Additional info

Settings are rudimentary and will need to be changed as we currently don't have password type of SettingsField which would mask and hash values. AFAIK I cannot use Secrets as they are not per artist.

Currently each artist needs to provide credentials via Site Settings, I didn't provide some default values as I assume if client expects authentication they will not use shared account.

This PR actually affects all existing DL integrations as they might need to have authentication injected.

  • After Effects
  • Blender
  • Maya
  • 3ds Max
  • Fusion
  • Nuke
  • Houdini

Testing notes:

  1. Enable authentication in Deadline Monitor Tools>Configure Repository Options>Web Service Settings>Require Authentication
  2. Build and deploy new deadline addon
  3. Enable authentication requirement for DL server in ayon+settings://deadline
    image
  4. Create user in DL and provide password (in Webservice password)
    image
  5. Use these credentials in Site Settings
    image

@kalisp kalisp added module: Deadline sponsored This is directly sponsored by a client or community member labels Mar 19, 2024
@ynbot ynbot added type: feature Adding something new and exciting to the product size/S host: CelAction host: Maya host: Nuke labels Mar 19, 2024
kalisp and others added 6 commits March 19, 2024 16:11
…e_deadline_connection.xml

Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
…_credentials.py

Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
…ce-password' into feature/AY-745_Deadline-webservice-password
Credentials for DL servers should be set only once, not for each project separately
@kalisp kalisp marked this pull request as draft March 26, 2024 09:25
@kalisp
Copy link
Member Author

kalisp commented Apr 30, 2024

I can't even get to the point 5. Deadline addon is not displayed at Site sync tab:-

Please make sure that you have deadline addon set in Production bundle, Site Settings are on applicable for addons in there. They will be used even if you use Dev bundle, but they must be in Production one too (which is a bit confusing).

@64qam
Copy link
Member

64qam commented May 2, 2024

When I set a authentication in DL, Deadline web service validator fails:

DEBUG: http://127.0.0.1:8081 "GET / HTTP/1.1" 401 0
Traceback (most recent call last):
  File "C:\Users\qam\AppData\Local\Ynput\AYON\dependency_packages\ayon_2403071252_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\qam\AppData\Local\Ynput\AYON\addons\core_0.3.1-dev.1\ayon_core\modules\deadline\plugins\publish\validate_deadline_connection.py", line 32, in process
    assert response.ok, "Response must be ok"
AssertionError: Response must be ok

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Im getting error when trying to submit Render to DL from the Blender host app

INFO: Using C:\projects\Ayon_Tests\blender\b3d_shots\sh020\publish\workfile\workfileLighting\v003\ATS_sh020_workfileLighting_v003.blend for render/export.
Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402141620_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Work\REPO\ayon-core\client\ayon_core\modules\deadline\abstract_submit_deadline.py", line 468, in process
    auth = instance.data["deadline"]["auth"]
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'auth'

@LiborBatek
Copy link
Member

Speaking of Fusion all working well and without any issues... tested on Fusion 18

@LiborBatek
Copy link
Member

Sucessfully tested also in Nuke host app. All fine and no errors experienced.

@LiborBatek
Copy link
Member

@MustafaJafar could you test in Houdini host pls? thx

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

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

I found some bugs with cache publishing.

These two lines:

for inst in instances:
inst["deadlineUrl"] = self.deadline_url

should be

        # Inject deadline url to instances to query DL for job id for overrides
        for inst in instances:
            if "deadline" not in inst:
                inst["deadline"] = {}
            inst["deadline"] = instance.data["deadline"]

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

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

It works on my side.
Tested publishing render, caches. Also, checked the files after publishing they are as expected.
image

image

@64qam
Copy link
Member

64qam commented May 3, 2024

In AE it fails during DL web service validation:

  File "C:\Users\qam\AppData\Local\Ynput\AYON\dependency_packages\ayon_2403071252_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\qam\AppData\Local\Ynput\AYON\addons\core_0.3.1-dev.1\ayon_core\modules\deadline\plugins\publish\validate_deadline_connection.py", line 24, in process
    deadline_url = instance.data["deadline"]["url"]
TypeError: 'NoneType' object is not subscriptable

When Nuke job is already on farm, there is DL error:

Error
=======================================================
Error: Global job preload script 'C:\ProgramData\Thinkbox\Deadline10\workers\qamtop\plugins\66354fbf50445baecead81e2\GlobalJobPreLoad.py': Missing required env vars: AVALON_PROJECT, AVALON_ASSET, AVALON_TASK, AVALON_APP_NAME (FranticX.Scripting.PythonNetException)
  File "C:\ProgramData\Thinkbox\Deadline10\workers\qamtop\plugins\66354fbf50445baecead81e2\GlobalJobPreLoad.py", line 487, in inject_ayon_environment
    raise RuntimeError((
  File "C:\ProgramData\Thinkbox\Deadline10\workers\qamtop\plugins\66354fbf50445baecead81e2\GlobalJobPreLoad.py", line 624, in __main__
    inject_ayon_environment(deadlinePlugin)
   at Python.Runtime.PythonException.ThrowLastAsClrException() in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1688438502375\work\src\runtime\PythonException.cs:line 53
   at Python.Runtime.PyObject.Invoke(PyObject[] args) in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1688438502375\work\src\runtime\PythonTypes\PyObject.cs:line 750
   at Python.Runtime.PyObject.InvokeMethod(String name, PyObject[] args) in C:\thinkbox-conda\conda-bld\dotnet_pythonnet_1688438502375\work\src\runtime\PythonTypes\PyObject.cs:line 818
   at FranticX.Scripting.PythonNetScriptEngine.CallFunction(String moduleName, String functionName, Object[] args)
   at Deadline.Plugins.PluginWrapper.d()
   at Deadline.Plugins.PluginWrapper.StartJob(String& outMessage, AbortLevel& abortLevel)

=======================================================
Type
=======================================================
RenderPluginException

=======================================================
Stack Trace
=======================================================
   at Deadline.Plugins.SandboxedPlugin.d(DeadlineMessage bgq, CancellationToken bgr)
   at Deadline.Plugins.SandboxedPlugin.StartJob(Job job, CancellationToken cancellationToken)
   at Deadline.Slaves.SlaveRenderThread.c(TaskLogWriter ajv, CancellationToken ajw)```

My job's envs are:
![Screenshot 2024-05-03 232858](https://github.com/ynput/ayon-core/assets/26925793/21bd55d1-abd4-486e-8b72-0283f0849691)

Must be collected before DL metadata
@kalisp
Copy link
Member Author

kalisp commented May 6, 2024

Fixed AE (issue in order).

I think that issue with GlobalJobPreLoad is that you have older version, not ayon-core.0.3.0 one.
Code should like this:
image

@kalisp kalisp merged commit 3e6e664 into develop May 6, 2024
2 of 3 checks passed
@kalisp kalisp deleted the feature/AY-745_Deadline-webservice-password branch May 6, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Maya host: Nuke host: 3dsmax module: Deadline size/S sponsored This is directly sponsored by a client or community member type: feature Adding something new and exciting to the product
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

10 participants