ayon-core
ayon-core copied to clipboard
Better handling of environments for farm jobs
Is there an existing issue for this?
- [X] I have searched the existing issues.
Please describe the feature you have in mind and explain what the current shortcomings are?
Currently, every integrator in Deadline (or for farm as it is) that is creating jobs is setting (or passing) environments to the job independently. Various submit_*_deadline
handle this logic by themselves. Also, they are assuming existence of addon specific environments. This is creating hidden dependency between addons and it makes adding new environments difficult.
How would you imagine the implementation of the feature?
This should be job of collectors in individual addons. For example collector in ayon-core
should collect context and instance level environments like:
"AYON_DEFAULT_SETTINGS_VARIANT" # context
"AYON_BUNDLE_NAME" # context
"AYON_PROJECT_NAME" # context
"AYON_USERNAME" # context
"IS_TEST" # context
"AYON_FOLDER_PATH" # instance
"AYON_TASK_NAME" # instance
"AYON_WORKDIR" # instance
In ftrack addon:
"FTRACK_API_KEY" # context
"FTRACK_API_USER" # context
"FTRACK_SERVER" # context
etc.
Also, because not every type of job needs all env vars, those collectors should be aware for what type of jobs they are providing what environment variable. This admittedly creates soft dependency too - at least between addons and ayon-core that should define job types, but that is reasonable.
To achieve this, ayon-core should provide API used by those collectors and farm integrators - ability to get/set environments for different job types and provide fallback option for unknow (uset) job type.
Are there any labels you wish to add?
- [X] I have added the relevant labels to the enhancement request.
Describe alternatives you've considered:
Backwards compatibility should be solved by keeping the logic in farm integrators but executing it only if collected environments are not provided.
Additional context:
No response