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

Construct AYON USD environment on top launch context environment #32

Closed
wants to merge 1 commit into from

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Aug 30, 2024

Changelog Description

This may fix an issue where launching an application may not inherit all the needed environment variables from the launch context.

Additional info

For whatever reason I suddenly couldn't test it because I started getting issues with how the settings load in config.py

Launching tray would give me:

*** WRN: >>> { AddonsLoader }: [  FAILED to import "ayon_usd"  ]
==============================
404 Client ERROR: Not Found for url: http://localhost:5000/api/addons/ayon_usd/1.0.4-dev.37/settings?variant=2024.01.0-full-2024-01-17-02-roydev
==============================
Traceback (most recent call last):
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 202, in raise_for_status
    self._response.raise_for_status()
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\requests\models.py", line 1021, in raise_for_status
    raise HTTPERROR(http_ERROR_msg, response=self)
requests.exceptions.HTTPERROR: 404 Client ERROR: Not Found for url: http://localhost:5000/api/addons/ayon_usd/1.0.4-dev.37/settings?variant=2024.01.0-full-2024-01-17-02-roydev

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\dev\ayon-core\client\ayon_core\addon\base.py", line 417, in _load_ayon_addons
    mod = __import__(basename, fromlist=("",))
  File "E:\dev\ayon-usd\client\ayon_usd\__init__.py", line 3, in <module>
    from .addon import USDAddon
  File "E:\dev\ayon-usd\client\ayon_usd\addon.py", line 11, in <module>
    from . import config, utils
  File "E:\dev\ayon-usd\client\ayon_usd\config.py", line 170, in <module>
    f"{get_addon_settings_value(get_addon_settings(), ADDON_SETTINGS_LAKE_FS_REPO_URI)}{get_usd_lib_conf_from_lakefs()}"  File "E:\dev\ayon-usd\client\ayon_usd\config.py", line 122, in get_addon_settings
    return ayon_api.get_addon_settings(
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\_api.py", line 1815, in get_addon_settings
    return con.get_addon_settings(*args, **kwargs)
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 3255, in get_addon_settings
    return self.get_addon_studio_settings(
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 3159, in get_addon_studio_settings
    result.raise_for_status()
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 206, in raise_for_status
    raise HTTPRequestERROR(message, exc.response)
ayon_api.exceptions.HTTPRequestERROR: 404 Client ERROR: Not Found for url: http://localhost:5000/api/addons/ayon_usd/1.0.4-dev.37/settings?variant=2024.01.0-full-2024-01-17-02-roydev

Testing notes:

  1. Start AYON tray
  2. Launch Maya
  3. Maya should work with all it env vars (like allow to do import capture)

@BigRoy BigRoy requested review from antirotor and Lypsolon August 30, 2024 16:16
@BigRoy BigRoy added the type: bug Something isn't working label Aug 30, 2024
@BigRoy BigRoy self-assigned this Aug 30, 2024
@BigRoy
Copy link
Collaborator Author

BigRoy commented Aug 31, 2024

For whatever reason I suddenly couldn't test it because I started getting issues with how the settings load in config.py

Launching tray would give me:

*** WRN: >>> { AddonsLoader }: [  FAILED to import "ayon_usd"  ]
==============================
404 Client ERROR: Not Found for url: http://localhost:5000/api/addons/ayon_usd/1.0.4-dev.37/settings?variant=2024.01.0-full-2024-01-17-02-roydev
==============================
Traceback (most recent call last):
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 202, in raise_for_status
    self._response.raise_for_status()
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\requests\models.py", line 1021, in raise_for_status
    raise HTTPERROR(http_ERROR_msg, response=self)
requests.exceptions.HTTPERROR: 404 Client ERROR: Not Found for url: http://localhost:5000/api/addons/ayon_usd/1.0.4-dev.37/settings?variant=2024.01.0-full-2024-01-17-02-roydev

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\dev\ayon-core\client\ayon_core\addon\base.py", line 417, in _load_ayon_addons
    mod = __import__(basename, fromlist=("",))
  File "E:\dev\ayon-usd\client\ayon_usd\__init__.py", line 3, in <module>
    from .addon import USDAddon
  File "E:\dev\ayon-usd\client\ayon_usd\addon.py", line 11, in <module>
    from . import config, utils
  File "E:\dev\ayon-usd\client\ayon_usd\config.py", line 170, in <module>
    f"{get_addon_settings_value(get_addon_settings(), ADDON_SETTINGS_LAKE_FS_REPO_URI)}{get_usd_lib_conf_from_lakefs()}"  File "E:\dev\ayon-usd\client\ayon_usd\config.py", line 122, in get_addon_settings
    return ayon_api.get_addon_settings(
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\_api.py", line 1815, in get_addon_settings
    return con.get_addon_settings(*args, **kwargs)
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 3255, in get_addon_settings
    return self.get_addon_studio_settings(
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 3159, in get_addon_studio_settings
    result.raise_for_status()
  File "C:\Program Files\Ynput\AYON 1.0.3\dependencies\ayon_api\server_api.py", line 206, in raise_for_status
    raise HTTPRequestERROR(message, exc.response)
ayon_api.exceptions.HTTPRequestERROR: 404 Client ERROR: Not Found for url: http://localhost:5000/api/addons/ayon_usd/1.0.4-dev.37/settings?variant=2024.01.0-full-2024-01-17-02-roydev

So this was due to other issues as explained in #31 - the issue in this case was that it didn't use the addon version number from the bundle, but from the active client - which in my test run mismatched because I had a different server addon version than this branch.

Anyway, since #31 required massive changes I've included this PR in #33. Hence I'm closing this in favor of #33 - if there end up being tons of reasons not to merge #33 we can reopen this one again of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant