-
Notifications
You must be signed in to change notification settings - Fork 37
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
Chore: Set environment variables for farm #1023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - with the exception of the comments as potential follow ups.
"AYON_PROJECT_NAME", | ||
"AYON_FOLDER_PATH", | ||
"AYON_TASK_NAME", | ||
"AYON_WORKDIR", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's technically not related to this PR - but why do we need to pass the workdir? Isn't this workdir path also local to the current machine and not rootless? I have a feeling we should maybe, after this PR investigate this and potentially clean that up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be used here by the way:
ayon-core/client/ayon_core/plugins/publish/collect_rendered_files.py
Lines 176 to 187 in a08a1af
# Remap workdir if it's set workdir = os.getenv("AYON_WORKDIR") remapped_workdir = None if workdir: remapped_workdir = anatomy.roots_obj.path_remapper( os.getenv("AYON_WORKDIR") ) if remapped_workdir: os.environ["AYON_WORKDIR"] = remapped_workdir except Exception as e: self.log.error(e, exc_info=True) raise Exception("Error") from e
But I guess that should still be set by the "launch context" regardless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try to find out where it is used, and I didn't find anything. If you can create issue it would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be used here by the way:
Yes, but is it then used for anything?
Changelog Description
Moved some of logic to define farm job environment variables from ayon-deadline to ayon-core.
Additional info
There already is plugin https://github.com/ynput/ayon-deadline/blob/develop/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py that is collecting environment variables, but that is not extedable because the constant defined in deadline should be supplied from ayon core, and most of the variables defined in the plugin should be defined by ayon-core, ayon-ftrack, ayon-shotgrid or ayon-applications addon. This is first step to be able to actually do it in the other plugins. Right now they would have to import from ayon-deadline and have dependency to ayon-deadline addon.
This PR also will take effect only with changes in this PR ynput/ayon-deadline#67
Future steps
FARM_JOB_ENV_DATA_KEY
defined in ayon core instead of constant defined in ayon deadline.Testing notes: