From 0461235efa9fe3aa69072a42b536059a59bb25bd Mon Sep 17 00:00:00 2001 From: Yan Cheng Date: Sun, 3 Nov 2024 10:30:02 -0500 Subject: [PATCH] rename components to resources --- nvflare/apis/fl_constant.py | 6 +++--- nvflare/apis/workspace.py | 16 ++++++++-------- nvflare/private/fed/utils/fed_utils.py | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/nvflare/apis/fl_constant.py b/nvflare/apis/fl_constant.py index f47928660a..2486c577b1 100644 --- a/nvflare/apis/fl_constant.py +++ b/nvflare/apis/fl_constant.py @@ -403,9 +403,9 @@ class WorkspaceConstants: ADMIN_STARTUP_CONFIG = "fed_admin.json" - COMPONENT_FILE_NAME_PATTERN = "*__components.json" # for bot parent and job processes - JOB_COMPONENT_FILE_NAME_PATTERN = "*__j_components.json" # for job process only - PARENT_COMPONENT_FILE_NAME_PATTERN = "*__p_components.json" # for parent process only + RESOURCE_FILE_NAME_PATTERN = "*__resources.json" # for bot parent and job processes + JOB_RESOURCE_FILE_NAME_PATTERN = "*__j_resources.json" # for job process only + PARENT_RESOURCE_FILE_NAME_PATTERN = "*__p_resources.json" # for parent process only class SiteType: diff --git a/nvflare/apis/workspace.py b/nvflare/apis/workspace.py index 9c5c731ed7..349a135260 100644 --- a/nvflare/apis/workspace.py +++ b/nvflare/apis/workspace.py @@ -191,10 +191,10 @@ def get_config_files_for_startup(self, is_server: bool, for_job: bool) -> list: - component files from the "startup" folder take precedence - component files from the "local" folder are next - These extra component files must be json and follow the following patterns: - - *__components.json: these files are for both parent process and job processes - - *__p_components.json: these files are for parent process only - - *__j_components.json: these files are for job process only + 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 Args: is_server: whether this is for server site or client site @@ -216,12 +216,12 @@ def get_config_files_for_startup(self, is_server: bool, for_job: bool) -> list: if os.path.exists(job_resources_file_path): config_files.append(job_resources_file_path) - # add other component config files - patterns = [WorkspaceConstants.COMPONENT_FILE_NAME_PATTERN] + # add other resource config files + patterns = [WorkspaceConstants.RESOURCE_FILE_NAME_PATTERN] if for_job: - patterns.append(WorkspaceConstants.JOB_COMPONENT_FILE_NAME_PATTERN) + patterns.append(WorkspaceConstants.JOB_RESOURCE_FILE_NAME_PATTERN) else: - patterns.append(WorkspaceConstants.PARENT_COMPONENT_FILE_NAME_PATTERN) + patterns.append(WorkspaceConstants.PARENT_RESOURCE_FILE_NAME_PATTERN) # add startup files first, then local files self._add_resource_files(self.get_startup_kit_dir(), config_files, patterns) diff --git a/nvflare/private/fed/utils/fed_utils.py b/nvflare/private/fed/utils/fed_utils.py index 8dc6e530de..60651700c9 100644 --- a/nvflare/private/fed/utils/fed_utils.py +++ b/nvflare/private/fed/utils/fed_utils.py @@ -131,12 +131,12 @@ def _check_secure_content(site_type: str) -> List[str]: if sig != LoadResult.OK: insecure_list.append(WorkspaceConstants.AUTHORIZATION_CONFIG) - # every component file in the startup must be signed and not tampered with! + # every resource file in the startup must be signed and not tampered with! bad_files = SecurityContentService.check_json_files( [ - WorkspaceConstants.COMPONENT_FILE_NAME_PATTERN, - WorkspaceConstants.PARENT_COMPONENT_FILE_NAME_PATTERN, - WorkspaceConstants.JOB_COMPONENT_FILE_NAME_PATTERN, + WorkspaceConstants.RESOURCE_FILE_NAME_PATTERN, + WorkspaceConstants.PARENT_RESOURCE_FILE_NAME_PATTERN, + WorkspaceConstants.JOB_RESOURCE_FILE_NAME_PATTERN, ] )