nvflare.recipe.prod_env module

class ProdEnv(startup_kit_location: str, login_timeout: float = 5.0, username: str = 'admin@nvidia.com', study: str = 'default', extra: dict | None = None)[source]

Bases: ExecEnv

Production execution environment for submitting and monitoring NVFlare jobs.

This environment uses the startup kit of an NVFlare deployment to submit jobs via the Flare API.

Parameters:
  • startup_kit_location (str) – Path to the admin’s startup kit directory.

  • login_timeout (float) – Timeout (in seconds) for logging into the Flare API session. Must be > 0.

  • username (str) – Username to log in with.

  • study (str) – Study name to tag submitted jobs. Defaults to “default”.

  • extra – extra env info.

abort_job(job_id: str) None[source]

Abort a running job.

Parameters:

job_id – The job ID to abort.

deploy(job: FedJob) str[source]

Deploy a job using SessionManager.

get_job_result(job_id: str, timeout: float = 0.0) str | None[source]

Get the result workspace of a job.

Parameters:
  • job_id – The job ID to get results for.

  • timeout – The timeout for the job to complete. Defaults to 0.0 (no timeout).

Returns:

The result workspace path if job completed, None if still running or stopped early.

Return type:

Optional[str]

get_job_status(job_id: str) str | None[source]

Get the status of a job.

Parameters:

job_id – The job ID to check status for.

Returns:

The status of the job, or None if not supported.

Return type:

Optional[str]