Skip to content

Commit

Permalink
renamed the GET_JOB_LAUNCHER to BEFORE_JOB_LAUNCH.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhwen committed Dec 4, 2024
1 parent 05bdd01 commit e38ef1b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nvflare/apis/event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ class EventType(object):

AUTHORIZE_COMMAND_CHECK = "_authorize_command_check"
BEFORE_BUILD_COMPONENT = "_before_build_component"
GET_JOB_LAUNCHER = "_get_job_launcher"
BEFORE_JOB_LAUNCH = "_before_job_launch"
2 changes: 1 addition & 1 deletion nvflare/app_common/job_launcher/process_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def launch_job(self, job_meta: dict, fl_ctx: FLContext) -> JobHandleSpec:
return ProcessHandle(process)

def handle_event(self, event_type: str, fl_ctx: FLContext):
if event_type == EventType.GET_JOB_LAUNCHER:
if event_type == EventType.BEFORE_JOB_LAUNCH:
job_meta = fl_ctx.get_prop(FLContextKey.JOB_META)
job_image = extract_job_image(job_meta, fl_ctx.get_identity_name())
if not job_image:
Expand Down
2 changes: 1 addition & 1 deletion nvflare/app_opt/job_launcher/docker_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def launch_job(self, job_meta: dict, fl_ctx: FLContext) -> JobHandleSpec:
return None

def handle_event(self, event_type: str, fl_ctx: FLContext):
if event_type == EventType.GET_JOB_LAUNCHER:
if event_type == EventType.BEFORE_JOB_LAUNCH:
job_meta = fl_ctx.get_prop(FLContextKey.JOB_META)
job_image = extract_job_image(job_meta, fl_ctx.get_identity_name())
if job_image:
Expand Down
2 changes: 1 addition & 1 deletion nvflare/app_opt/job_launcher/k8s_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def launch_job(self, job_meta: dict, fl_ctx: FLContext) -> JobHandleSpec:
return None

def handle_event(self, event_type: str, fl_ctx: FLContext):
if event_type == EventType.GET_JOB_LAUNCHER:
if event_type == EventType.BEFORE_JOB_LAUNCH:
job_meta = fl_ctx.get_prop(FLContextKey.JOB_META)
job_image = extract_job_image(job_meta, fl_ctx.get_identity_name())
if job_image:
Expand Down
2 changes: 1 addition & 1 deletion nvflare/private/fed/client/client_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def start_app(
def _get_job_launcher(self, job_meta: dict, fl_ctx: FLContext) -> JobLauncherSpec:
engine = fl_ctx.get_engine()
fl_ctx.set_prop(FLContextKey.JOB_META, job_meta, private=True, sticky=False)
engine.fire_event(EventType.GET_JOB_LAUNCHER, fl_ctx)
engine.fire_event(EventType.BEFORE_JOB_LAUNCH, fl_ctx)

job_launcher = fl_ctx.get_prop(FLContextKey.JOB_LAUNCHER)
if not (job_launcher and isinstance(job_launcher, list)):
Expand Down
2 changes: 1 addition & 1 deletion nvflare/private/fed/utils/fed_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def get_job_launcher(job_meta: dict, fl_ctx: FLContext) -> JobLauncherSpec:
# Remove the potential not cleaned up JOB_LAUNCHER
job_launcher_ctx.remove_prop(FLContextKey.JOB_LAUNCHER)
job_launcher_ctx.set_prop(FLContextKey.JOB_META, job_meta, private=True, sticky=False)
engine.fire_event(EventType.GET_JOB_LAUNCHER, job_launcher_ctx)
engine.fire_event(EventType.BEFORE_JOB_LAUNCH, job_launcher_ctx)

job_launcher = job_launcher_ctx.get_prop(FLContextKey.JOB_LAUNCHER)
if not (job_launcher and isinstance(job_launcher, list)):
Expand Down

0 comments on commit e38ef1b

Please sign in to comment.