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

add subjobs fix for servers for syncing #8676

Merged
1 commit merged into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/syft/src/syft/service/job/job_stash.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ def subjobs(self) -> list["Job"] | SyftError:
)
return api.services.job.get_subjobs(self.id)

def get_subjobs(self, context: AuthedServiceContext) -> list["Job"] | SyftError:
job_service = context.node.get_service("jobservice")
return job_service.get_subjobs(context, self.id)

@property
def owner(self) -> UserView | SyftError:
api = APIRegistry.api_for(
Expand Down Expand Up @@ -517,11 +521,11 @@ def get_sync_dependencies(self, context: AuthedServiceContext) -> list[UID]: #
if self.log_id:
dependencies.append(self.log_id)

subjobs = self.subjobs
subjobs = self.get_subjobs(context)
if isinstance(subjobs, SyftError):
return subjobs

subjob_ids = [subjob.id for subjob in self.subjobs]
subjob_ids = [subjob.id for subjob in subjobs]
dependencies.extend(subjob_ids)

if self.user_code_id is not None:
Expand Down