Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nvkevlu committed Jan 14, 2025
1 parent 8b89720 commit d758cdb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nvflare/apis/impl/job_def_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def get_client_data(self, jid: str, client_name: str, data_type: str, fl_ctx: FL
except StorageException:
return None

def list_components(self, jid: str, fl_ctx: FLContext):
def list_components(self, jid: str, fl_ctx: FLContext) -> List[str]:
store = self._get_job_store(fl_ctx)
self.log_debug(
fl_ctx, f"list_components called for {jid}: {store.list_components_of_object(self.job_uri(jid))}"
Expand Down
2 changes: 1 addition & 1 deletion nvflare/apis/job_def_manager_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_client_data(self, jid: str, client_name: str, data_type: str, fl_ctx: FL
pass

@abstractmethod
def list_components(self, jid: str, fl_ctx: FLContext):
def list_components(self, jid: str, fl_ctx: FLContext) -> List[str]:
"""Get list of all the components for the specified job.
Args:
Expand Down
2 changes: 2 additions & 0 deletions nvflare/fuel/hci/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class MetaKey(object):
DATA_TYPE = "data_type"
JOB_META = "job_meta"
JOB_DATA = "job_data"
JOB_COMPONENTS = "job_components"
WORKSPACE = "workspace"
JOB_DOWNLOAD_URL = "job_download_url"
APP_NAME = "app_name"
Expand Down Expand Up @@ -91,6 +92,7 @@ class MetaStatusValue(object):
JOB_NOT_RUNNING = "job_not_running"
CLIENTS_RUNNING = "clients_running"
NO_JOBS = "no_jobs"
NO_JOB_COMPONENTS = "no_job_compoents"
NO_REPLY = "no_reply"
NO_CLIENTS = "no_clients"

Expand Down
8 changes: 7 additions & 1 deletion nvflare/private/fed/server/job_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,14 @@ def list_job_components(self, conn: Connection, args: List[str]):
if filtered_data:
data_str = ", ".join(filtered_data)
conn.append_string(data_str)
conn.append_success(
"", meta=make_meta(MetaStatusValue.OK, extra={MetaKey.JOB_COMPONENTS: data_str})
)
else:
conn.append_string("No additional job components found.")
conn.append_error(
"No additional job components found.",
meta=make_meta(MetaStatusValue.NO_JOB_COMPONENTS, "No additional job components found."),
)
else:
conn.append_error(
f"job {job_id} does not exist", meta=make_meta(MetaStatusValue.INVALID_JOB_ID, job_id)
Expand Down

0 comments on commit d758cdb

Please sign in to comment.