ynput / ayon-launcher

AYON desktop application launcher
Apache License 2.0
31 stars 13 forks source link

Storage and Local directory paths #144

Closed iLLiCiTiT closed 3 weeks ago

iLLiCiTiT commented 1 month ago

Changelog Description

AYON launcher defines more generic environment variables to define storage and local directory. A directory where are stored files that can be shared across multiple machines AYON_LAUNCHER_STORAGE_DIR and directory where are stored user/machine specific files AYON_LAUNCHER_LOCAL_DIR. Those 2 should be used for whatever is related to AYON and should be stored.

Additional info

Previously defined environment variables AYON_ADDONS_DIR and AYON_DEPENDENCIES_DIR did not cover all files that are used during AYON processes. Using more abstract concept of "shared" directory and "local" directory is easier to explain and maintain.

Just because it can be shared does not mean it won't break if it is shared. I'm not sure what will happen if 2 AYON launchers on different machines will try to download addons, dependency packages or any other file to the same location at the same time.

This is initial part of the idea. With this available in AYON launcher it is necessary to add api functions to ayon-core and then use the functions in other addons. With only this PR is might be dangerous to change AYON_LAUNCHER_LOCAL_DIR as ayon-core might look to other places. I didn't test it and did not validate code in ayon-core to find out how much danger it is (that's my next step).

[!IMPORTANT] This change requires modification of https://github.com/ynput/ayon-launcher/pull/112 as shim has to know where to find executables.json .

Testing notes:

  1. Set environment variable AYON_LAUNCHER_STORAGE_DIR to other place on your machine.
  2. Launch AYON launcher with this PR.
  3. It should start download addons and dependency packages to that directory.
  4. The same should happen with AYON_LAUNCHER_LOCAL_DIR and local files.