Skip to content

Commit

Permalink
rename components to resources
Browse files Browse the repository at this point in the history
  • Loading branch information
yanchengnv committed Nov 3, 2024
1 parent 85c1a77 commit 0461235
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions nvflare/apis/fl_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions nvflare/apis/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions nvflare/private/fed/utils/fed_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
)

Expand Down

0 comments on commit 0461235

Please sign in to comment.