nvflare.app_opt.flower.controller module

class FlowerController(num_rounds=1, database: str = '', superlink_ready_timeout: float = 10.0, superlink_grace_period: float = 2.0, superlink_min_query_interval=10.0, monitor_interval: float = 0.5, configure_task_name='config', configure_task_timeout=10, start_task_name='start', start_task_timeout=10, job_status_check_interval: float = 2.0, max_client_op_interval: float = 90.0, progress_timeout: float = 3600.0, int_client_grpc_options=None, run_config: dict | None = None, allow_runtime_dependency_installation: bool = False, flower_app_path: str | None = None)[source]

Bases: TieController

Constructor of FlowerController

Parameters:
  • num_rounds – number of rounds. Not used in this version.

  • database – database name

  • superlink_ready_timeout – how long to wait for the superlink to become ready before starting server app

  • superlink_min_query_interval – minimal interval for querying superlink for status

  • monitor_interval – how often to check flower run status

  • configure_task_name – name of the config task

  • configure_task_timeout – max time allowed for config task to complete

  • start_task_name – name of the start task

  • start_task_timeout – max time allowed for start task to complete

  • job_status_check_interval – how often to check job status

  • max_client_op_interval – max time allowed for missing client requests

  • progress_timeout – max time allowed for missing overall progress

  • int_client_grpc_options – internal grpc client options

  • run_config – optional dict for flwr run –run-config arguments

  • allow_runtime_dependency_installation – whether to allow dynamic dependency installation (only flwr>=1.29)

  • flower_app_path – absolute path to pre-deployed Flower app on the server (clients receive via FAB)

get_applet(fl_ctx: FLContext)[source]

Called by the TieController to get the Applet to be used with the controller. Subclass of TieController must implement this method.

Parameters:

fl_ctx – FL context

Returns: an Applet object

get_client_config_params(fl_ctx: FLContext) dict[source]

Called by the TieController to get config parameters to be sent to FL clients. Subclass of TieController must implement this method.

Parameters:

fl_ctx – FL context

Returns: a dict of config params

get_connector(fl_ctx: FLContext)[source]

Called by the TieController to get the Connector to be used with the controller. Subclass of TieController must implement this method.

Parameters:

fl_ctx – FL context

Returns: a Connector object

get_connector_config_params(fl_ctx: FLContext) dict[source]

Called by the TieController to get config parameters for configuring the connector. Subclass of TieController must implement this method.

Parameters:

fl_ctx – FL context

Returns: a dict of config params