nvflare.app_common.launchers.subprocess_launcher module

class SubprocessLauncher(script: str, launch_once: bool = True, clean_up_script: str | None = None)[source]

Bases: Launcher

Initializes the SubprocessLauncher.

Parameters:
  • script (str) – Script to be launched using subprocess.

  • clean_up_script (Optional[str]) – Optional clean up script to be run after the main script execution.

check_run_status(task_name: str, fl_ctx: FLContext) str[source]

Checks the run status of Launcher.

finalize(fl_ctx: FLContext) None[source]
initialize(fl_ctx: FLContext)[source]
launch_task(task_name: str, shareable: Shareable, fl_ctx: FLContext, abort_signal: Signal) bool[source]

Launches external system to handle a task.

Parameters:
  • task_name (str) – task name.

  • shareable (Shareable) – input shareable.

  • fl_ctx (FLContext) – fl context.

  • abort_signal (Signal) – signal to check during execution to determine whether this task is aborted.

Returns:

Whether launch success or not.

stop_task(task_name: str, fl_ctx: FLContext, abort_signal: Signal) None[source]

Stops external system and free up resources.

Parameters:
  • task_name (str) – task name.

  • fl_ctx (FLContext) – fl context.

log_subprocess_output(process, logger)[source]