nvflare.app_opt.job_launcher.docker_launcher module¶
- class ClientDockerJobLauncher(mount_path: str = '/workspace', network: str = 'nvflare-network', timeout=None)[source]¶
Bases:
DockerJobLauncher
Init FLComponent.
The FLComponent is the base class of all FL Components. (executors, controllers, responders, filters, aggregators, and widgets are all FLComponents)
FLComponents have the capability to handle and fire events and contain various methods for logging.
- class DOCKER_STATE[source]¶
Bases:
object
- CREATED = 'created'¶
- DEAD = 'dead'¶
- EXITED = 'exited'¶
- PAUSED = 'paused'¶
- RESTARTING = 'restarting'¶
- RUNNING = 'running'¶
- class DockerJobHandle(container, timeout=None)[source]¶
Bases:
JobHandleSpec
- class DockerJobLauncher(mount_path: str = '/workspace', network: str = 'nvflare-network', timeout=None)[source]¶
Bases:
JobLauncherSpec
Init FLComponent.
The FLComponent is the base class of all FL Components. (executors, controllers, responders, filters, aggregators, and widgets are all FLComponents)
FLComponents have the capability to handle and fire events and contain various methods for logging.
- abstract get_command(job_meta, fl_ctx) -> (<class 'str'>, <class 'str'>)[source]¶
To generate the command to launcher the job in sub-process
- Parameters:
fl_ctx – FLContext
job_meta – job launcher data
- Returns:
(container name, launch command)
- handle_event(event_type: str, fl_ctx: FLContext)[source]¶
Handles events.
- Parameters:
event_type (str) – event type fired by workflow.
fl_ctx (FLContext) – FLContext information.
- launch_job(job_meta: dict, fl_ctx: FLContext) JobHandleSpec [source]¶
To launch a job run.
- Parameters:
job_meta – job metadata
fl_ctx – FLContext
Returns: boolean to indicates the job launch success or fail.
- class ServerDockerJobLauncher(mount_path: str = '/workspace', network: str = 'nvflare-network', timeout=None)[source]¶
Bases:
DockerJobLauncher
Init FLComponent.
The FLComponent is the base class of all FL Components. (executors, controllers, responders, filters, aggregators, and widgets are all FLComponents)
FLComponents have the capability to handle and fire events and contain various methods for logging.