nvflare.private.fed.client.client_executor module
- class ClientExecutor[source]
Bases:
ABC- abstract abort_task(job_id)[source]
Aborts the client executing task.
- Parameters:
job_id – the job_id
- abstract check_status(job_id) str[source]
Checks the status of the running client.
- Parameters:
job_id – the job_id
- Returns:
A client status message
- abstract get_errors(job_id)[source]
Get the error information.
- Returns:
A dict of error information.
- abstract get_run_info(job_id)[source]
Gets the run information.
- Parameters:
job_id – the job_id
- Returns:
A dict of run information.
- abstract reset_errors(job_id)[source]
Resets the error information.
- Parameters:
job_id – the job_id
- abstract start_app(client, job_id, job_meta, args, allocated_resource, token, resource_manager, fl_ctx: FLContext)[source]
Starts the client app.
- Parameters:
client – the FL client object
job_id – the job_id
args – admin command arguments for starting the FL client training
allocated_resource – allocated resources
token – token from resource manager
resource_manager – resource manager
fl_ctx – FLContext
- class JobExecutor(client, startup)[source]
Bases:
ClientExecutorRun the Client executor in a child process.
To init the ProcessExecutor.
- Parameters:
startup – startup folder
- check_status(job_id)[source]
Checks the status of the running client.
- Parameters:
job_id – the job_id
- Returns:
A client status message
- configure_job_log(job_id, config)[source]
Configure the job log.
- Parameters:
job_id – the job_id
config –
log config
- Returns:
configure_job_log command message
- get_errors(job_id)[source]
Get the error information.
- Parameters:
job_id – the job_id
- Returns:
A dict of error information.
- get_run_info(job_id)[source]
Gets the run information.
- Parameters:
job_id – the job_id
- Returns:
A dict of run information.
- send_to_job(job_id, channel: str, topic: str, msg: Message, timeout: float, optional=False) Message[source]
Send a message to CJ
- Parameters:
job_id – id of the job
channel – message channel
topic – message topic
msg – the message to be sent
timeout – how long to wait for reply
optional – whether the message is optional
Returns: reply from CJ
- start_app(client, job_id, job_meta, args, allocated_resource, token, resource_manager: ResourceManagerSpec, fl_ctx: FLContext)[source]
Starts the app.
- Parameters:
client – the FL client object
job_id – the job_id
job_meta – job metadata
args – admin command arguments for starting the worker process
allocated_resource – allocated resources
token – token from resource manager
resource_manager – resource manager
fl_ctx – FLContext