nvflare.private.fed.client.client_engine_executor_spec module
- class ClientEngineExecutorSpec[source]
Bases:
ClientEngineSpec,EngineSpec,ABCThe ClientEngineExecutorSpec defines the ClientEngine APIs running in the child process.
- abstract abort_app(job_id: str, fl_ctx: FLContext)[source]
Abort the running FL App on the client.
- Parameters:
job_id – current_job_id
fl_ctx – FLContext
- abstract build_component(config_dict)[source]
Build a component from the config_dict.
- Parameters:
config_dict – config dict
- abstract fire_and_forget_aux_request(topic: str, request: Shareable, fl_ctx: FLContext, optional=False, secure=False) Shareable[source]
Send an async request to Server via the aux channel.
- Parameters:
topic – topic of the request.
request – request to be sent
fl_ctx – FL context
optional – whether the request is optional
secure – whether to send the message in P2P secure mode
Returns:
- abstract get_task_assignment(fl_ctx: FLContext, timeout=None) TaskAssignment[source]
- abstract multicast_aux_requests(topic: str, target_requests: Dict[str, Shareable], timeout: float, fl_ctx: FLContext, optional: bool = False, secure: bool = False) dict[source]
Send requests to specified targets (server or other clients) via the aux channel.
Implementation: simply calls the AuxRunner’s multicast_aux_requests method.
- Parameters:
topic – topic of the request
target_requests – requests of the targets. Different target can have different request.
timeout – amount of time to wait for responses. 0 means fire and forget.
fl_ctx – FL context
optional – whether this request is optional
secure – whether to send the aux request in P2P secure
Returns: a dict of replies (client name => reply Shareable)
- abstract register_aux_message_handler(topic: str, message_handle_func)[source]
Register aux message handling function with specified topics.
- Exception is raised when:
a handler is already registered for the topic; bad topic - must be a non-empty string bad message_handle_func - must be callable
Implementation Note: This method should simply call the ClientAuxRunner’s register_aux_message_handler method.
- Parameters:
topic – the topic to be handled by the func
message_handle_func – the func to handle the message. Must follow aux_message_handle_func_signature.
- abstract send_aux_request(targets: None | str | List[str], topic: str, request: Shareable, timeout: float, fl_ctx: FLContext, optional=False, secure: bool = False) dict[source]
Send a request to Server via the aux channel.
Implementation: simply calls the ClientAuxRunner’s send_aux_request method.
- Parameters:
targets – aux messages targets. None or empty list means the server.
topic – topic of the request
request – request to be sent
timeout – number of secs to wait for replies. 0 means fire-and-forget.
fl_ctx – FL context
optional – whether the request is optional
secure – should the request sent in the secure way
- Returns:
{ site_name: reply_shareable }
- Return type:
a dict of reply Shareable in the format of
- class TaskAssignment(name: str, task_id: str, data: Shareable)[source]
Bases:
objectInit TaskAssignment.
Keeps track of information about the assignment of a task, including the time that it was created after being fetched by the Client Run Manager.
- Parameters:
name – task name
task_id – task id
data – the Shareable data for the task assignment