nvflare.lighter.entity module¶
- class Entity(scope: str, name: str, props: dict, parent=None)[source]¶
Bases:
object
- get_prop_fb(key: str, fb_key=None, default=None)[source]¶
Get property value with fallback. If I have the property, then return it. If not, I return the fallback property of my parent. If I don’t have parent, return default.
- Parameters:
key – key of the property
fb_key – key of the fallback property.
default – value to return if no one has the property
Returns: property value
- class Participant(type: str, name: str, org: str, props: dict | None = None, project: Entity | None = None)[source]¶
Bases:
Entity
Class to represent a participant.
Each participant communicates to other participant. Therefore, each participant has its own name, type, organization it belongs to, rules and other information.
- Parameters:
type (str) – server, client, admin or other string that builders can handle
name (str) – system-wide unique name
org (str) – system-wide unique organization
props (dict) – properties
project – the project that the participant belongs to
- Raises:
ValueError – if name or org is not compliant with characters or format specification.
- class Project(name: str, description: str, participants=None, props: dict | None = None, serialized_root_cert=None, serialized_root_private_key=None)[source]¶
Bases:
Entity
A container class to hold information about this FL project.
This class only holds information. It does not drive the workflow.
- Parameters:
name (str) – the project name
description (str) – brief description on this name
participants – if provided, list of participants of the project
props – properties of the project
serialized_root_cert – if provided, the root cert to be used for the project
serialized_root_private_key – if provided, the root private key for signing certs of sites and admins
- Raises:
ValueError – when participant criteria is violated
- get_overseer()[source]¶
Get the overseer definition. Only one overseer is supported!
Returns: overseer participant