nvflare.job_config.fed_job_config module

class FedJobConfig(job_name, min_clients, mandatory_clients=None)[source]

Bases: object

FedJobConfig represents the job in the NVFlare.

FedJobConfig uses the job_name, min_clients and optional mandatory_clients to create the object. It also provides the method to add in the FedApp, the deployment map of the FedApp and participants, and the resource _spec requirements of the participants if needed.

Parameters:
  • job_name – the name of the NVFlare job

  • min_clients – the minimum number of clients for the job

  • mandatory_clients – mandatory clients to run the job (optional)

add_fed_app(app_name: str, fed_app: FedAppConfig)[source]
add_resource_spec(site_name: str, resource_spec: Dict)[source]
generate_job_config(job_root)[source]

generate the job config

Returns:

locate_imports(sf, dest_file)[source]

Locate all the import statements from the python script, including the imports across multiple lines, using the the line break continuing.

Parameters:
  • sf – source file

  • dest_file – copy to destination file

Returns:

yield all the imports within the source file

set_site_app(site_name: str, app_name: str)[source]

assign an app to a certain site.

Parameters:
  • site_name – The target site name.

  • app_name – The app name.

Returns:

simulator_run(workspace, clients=None, n_clients=None, threads=None, gpu=None)[source]