nvflare.apis.job_scheduler_spec module

class DispatchInfo(app_name: str, resource_requirements: dict, token: Optional[str])[source]

Bases: object

Information needed for dispatch

class JobSchedulerSpec[source]

Bases: ABC

abstract schedule_job(job_candidates: List[Job], fl_ctx: FLContext)[source]

Try to schedule a Job.

Parameters
  • job_candidates – The candidate to choose from.

  • fl_ctx – FLContext.

Returns

A tuple of (job, sites_dispatch_info), if there is a Job that satisfy the criteria of the scheduler. sites_dispatch_info is a dict of {site name: DispatchInfo}. Otherwise, return (None, None).