Skip to content

Commit

Permalink
Keep project_name shorter than the limit (NVIDIA#3106)
Browse files Browse the repository at this point in the history
* Fix NVIDIA#3093

* Address comments
  • Loading branch information
IsaacYangSLA authored Dec 12, 2024
1 parent c3f4863 commit 20ffadb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nvflare/lighter/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ def prepare_project(project_dict, add_user_file_path=None, add_client_file_path=
if api_version not in [3]:
raise ValueError(f"API version expected 3 but found {api_version}")
project_name = project_dict.get(PropKey.NAME)
if len(project_name) > 63:
print(f"Project name {project_name} is longer than 63. Will truncate it to {project_name[:63]}.")
project_name = project_name[:63]
project_dict[PropKey.NAME] = project_name
project_description = project_dict.get(PropKey.DESCRIPTION, "")
project = Project(name=project_name, description=project_description, props=project_dict)
participant_defs = project_dict.get("participants")
Expand Down

0 comments on commit 20ffadb

Please sign in to comment.