nvflare.private.fed.client.client_engine module

class ClientEngine(client, client_name, sender, args, rank, workers=5)[source]

Bases: ClientEngineInternalSpec

ClientEngine runs in the client parent process.

To init the ClientEngine.

Parameters
  • client – FL client object

  • client_name – client name

  • sender – sender object

  • args – command args

  • rank – local process rank

  • workers – number of workers

abort_app(job_id: str) str[source]

Aborts the app execution for the specified run.

Returns

A string message.

abort_task(job_id: str) str[source]

Abort the client current executing task.

Returns

A string message.

delete_run(job_id: str) str[source]

Deletes the specified run.

Parameters

job_id – job_id

Returns

A string message.

deploy_app(app_name: str, job_id: str, client_name: str, app_data) str[source]

Deploys the app to specified run.

Parameters
  • app_name – FL_app name

  • job_id – job that the app is to be deployed to

  • client_name – name of the client

  • app_data – zip data of the app

Returns

A string message.

do_validate(req: Message)[source]
fire_event(event_type: str, fl_ctx: FLContext)[source]
get_all_job_ids()[source]

Get all the client job_id.

Returns: list of all the job_id

get_client_name()[source]

Get the ClientEngine client_name.

Returns: the client_name

get_component(component_id: str) object[source]
get_current_run_info(job_id) ClientRunInfo[source]
get_engine_status()[source]
get_errors(job_id)[source]
new_context() FLContext[source]
remove_custom_path()[source]
reset_errors(job_id)[source]
restart() str[source]

Restarts the FL client.

Returns

A string message.

send_aux_command(shareable: Shareable, job_id)[source]
set_agent(admin_agent)[source]
shutdown() str[source]

Shuts down the FL client.

Returns

A string message.

start_app(job_id: str, allocated_resource: Optional[dict] = None, token: Optional[str] = None, resource_consumer=None, resource_manager=None) str[source]

Starts the app for the specified run.

Parameters
  • job_id – job_id

  • allocated_resource – allocated resource

  • token – token

  • resource_consumer – resource consumer

  • resource_manager – resource manager

Returns

A string message.