Skip to content

Commit

Permalink
support server side custom scripts (#2695)
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerroth authored Jul 12, 2024
1 parent dd248ca commit 7b1852c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions nvflare/job_config/fed_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ def _gen_tracked_id(self, id: str = "") -> str:
self._used_ids.append(id)
return id

def add_external_scripts(self, external_scripts: List):
"""Register external scripts to include them in custom directory.
Args:
external_scripts: List of external scripts that need to be deployed to the client/server.
"""
for _script in external_scripts:
self.app.add_ext_script(_script)


class FedJob:
def __init__(self, name="fed_job", min_clients=1, mandatory_clients=None, key_metric="accuracy") -> None:
Expand Down Expand Up @@ -303,15 +312,6 @@ def _create_client_app(self):
component = ConvertToFedEvent(events_to_convert=["analytix_log_stats"], fed_event_prefix="fed.")
self.app.add_component("event_to_fed", component)

def add_external_scripts(self, external_scripts: List):
"""Register external scripts to the client app to include them in custom directory.
Args:
external_scripts: List of external scripts that need to be deployed to the client. Defaults to None.
"""
for _script in external_scripts:
self.app.add_ext_script(_script)


class ControllerApp(FedApp):
"""Wrapper around `ServerAppConfig`.
Expand Down

0 comments on commit 7b1852c

Please sign in to comment.