-
Notifications
You must be signed in to change notification settings - Fork 36
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
Better handling of environments for farm jobs #876
Comments
I'm not entirely sure about that "soft dependency". I think currently, there's hardly any soft depedency currently? Preferably we just have a class DeadlineBaseSubmitter:
def get_submission_env(self, instance) -> dict:
env = instance.context.get("job_environments", {})
env.update(instance.get("job_environments", {}))
return env
def submit(self, instance, payload):
env = self.get_submission_env(instance)
payload["env"] = env # or however we populate the env vars at this stage
requests.post(deadline, payload) etc.
I'm still not sure how the "soft dependency" is really needed. It'd be good to write out the different use cases of env vars we actually want to set and how they differ in certain situations. |
Soft dependency isn't needed, quite opposite - we need to get rid of it. And I agree, these steps are definitely what needs to be done. Deadline submitter shoudln't be aware of any ftrack, kitsu and similar environment variables - ftrack, kitsu and similar shouldn't be aware of deadline. They need to be aware of farm job types so they can decide what variables are needed. The soft dependency I was mentioning is currently in the fact, that almost every submitter plugin in Deadline is adding addon specific environments - so if we add another addon that we need it's environments to be passed to Deadline, we need to modify all deadline submitter plugins. Also, it needs to be farm manager agnostic (there is also RoyalRender). Maybe @iLLiCiTiT has something to add here too :) I imagine something like |
Right now there are 2 types of farm jobs, render and publish. Render should not need ftrack or kitsu login (or does it?). At the same time we might need to add more job types in future (e.g. remote publish) that might have different requirements. From my point of view, the most important is that we're able to set them our of farm addon plugins. Addon has control over what is added per instance or globally on context. It was me who's idea was to be more granular, but if we would add all environments to all jobs it is probably not a big deal. But do we want to? Can there be a usecase where setting env in render or publish job would break the other one? @antirotor I might need help here, because I don't remember if there was a reason, or we were just thinking too much? |
Currently with ynput/ayon-deadline#32 implemented we have now de-duplicated the code and use a So one of the next steps would be to now redesign this to support defining what job we'd target. We may need to form something of a 'flow' where one could make job submissions dependent on each other or make it absolutely trivial to add a job, with submissions, and env vars specific to it. For example, say we have from ayon_core.pipeline import FarmJob
farm_jobs = {
"render": FarmJob(name="render", payload=render_payload),
"export": FarmJob(name="export", payload=export_payload, depends_on={"render",})
} Then we could just have a single We'll need to abstract it away somewhere. Once we have 'named' jobs then it might make it easy to also target env vars to the named jobs, etc. |
A lot of this is being resolved by ynput/ayon-deadline#49 - if not all. |
Is there an existing issue for this?
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:In ftrack addon:
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?
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
The text was updated successfully, but these errors were encountered: