nvflare.apis.workspace module¶
- class Workspace(root_dir: str, site_name: str = '', config_folder: str = 'config')[source]¶
Bases:
object
Define a workspace.
NOTE:
Example of client workspace folder structure: Workspace ROOT local authorization.json.default resources.json.default custom/ custom python code ... startup (optional) provisioned content fed_client.json run_1 app config (required) configurations custom (optional) custom python code other_folder (app defined) log.txt job_meta.json ...
- Parameters:
root_dir – root directory of the workspace
site_name – site name of the workspace
config_folder – where to find required config inside an app
- get_config_files_for_startup(is_server: bool, for_job: bool) list [source]¶
Get all config files to be used for startup of the process (SP, SJ, CP, CJ).
- We first get required config files:
the startup file (fed_server.json or fed_client.json) in “startup” folder
resource file (resources.json.default or resources.json) in “local” folder
- We then try to get resources files (usually generated by different builders of the Provision system):
resources files from the “startup” folder take precedence
resources files from the “local” folder are next
These extra resource config files must be json and follow the following patterns: - *__resources.json: these files are for both parent process and job processes - *__p_resources.json: these files are for parent process only - *__j_resources.json: these files are for job process only
- Parameters:
is_server – whether this is for server site or client site
for_job – whether this is for job process or parent process
Returns: a list of config file names