nvflare poc

nvflare poc manages a local proof-of-concept (POC) deployment: a provisioned server, clients, and admin startup kits on one machine, each running as its own process. POC mode exercises the same certificates, job submission, scheduling, and administration paths as production, which makes it the right place to validate a job before a real deployment. This page documents every subcommand and option, the workspace, JSON output, and common issues.

Typical Workflow

nvflare poc prepare -n 2          # provision a 2-client project
nvflare poc start                 # start server and clients, wait for readiness
nvflare job submit -j ./my_job    # the generated Project Admin kit is already active
nvflare job list
nvflare poc stop
nvflare poc clean

Subcommands

nvflare poc config

Shows or sets the POC workspace path.

nvflare poc config
nvflare poc config --pw /tmp/nvflare/poc
Option Description
-pw, --pw, --poc_workspace_dir, --poc-workspace-dir POC workspace location.
--schema Print the command schema.

Without options it prints the current workspace, the config file path, and any NVFLARE_POC_WORKSPACE environment override.

Workspace resolution

  1. NVFLARE_POC_WORKSPACE environment variable.
  2. poc.workspace in ~/.nvflare/config.json.
  3. Default /tmp/nvflare/poc.

The older nvflare config -pw <dir> still works but prints a deprecation warning pointing to nvflare poc config --pw.

nvflare poc prepare

Provisions a local project into the workspace.

nvflare poc prepare -n 2
nvflare poc prepare -c hospital-a hospital-b
nvflare poc prepare -i ./project.yml --force
nvflare poc prepare -d                      # Docker mode, default image
Option Default Description
-n, --number_of_clients 2 Number of clients (site-1, site-2, ...).
-c, --clients — Space-separated client names; overrides -n.
-he, --he off Enable homomorphic encryption in the generated project.
-i, --project_input — A project.yml to use; client count, names, and Docker image options are then ignored.
-d, --docker_image — Prepare Docker runtime kits with this server/client parent image (or the default image if no value is given).
-debug, --debug off Debug output.
--force off Overwrite an existing workspace without prompting.

Behavior:

  • If the workspace exists and stdin is not interactive, --force is required.
  • The project is named example_project; kits are created under <workspace>/example_project/prod_00/, with the server server, the clients, and the admin [email protected].
  • The workspace is written to ~/.nvflare/config.json, the generated admin/user kits are registered as CLI identities, and the default Project Admin kit becomes active, so nvflare job ... works immediately. Site kits are not registered.
  • If a generated identity collides with an existing registration outside the POC workspace, the existing one is kept while its path still exists; a registration pointing at a missing path is treated as stale and replaced.
  • In JSON mode, data.startup_kit.prior_active, active, and changed describe the active-kit change, so automation can restore the previous identity afterwards.
  • A best-effort loopback port check reports conflicts in data.port_preflight.conflicts; conflicts are warnings and do not make prepare fail.
  • In Docker mode the workspace data directory is mounted into job containers at /data/default/poc for the default study, and jobs must name their job image in launcher_spec.

nvflare poc add-user and add-site

Extend a prepared workspace without regenerating existing kits. Both reuse the POC root CA and provisioning state.

nvflare poc add-user lead [email protected] --org nvidia
nvflare config use [email protected]
nvflare poc add-site site-3 --org nvidia
nvflare poc start -p site-3
Command Arguments Notes
add-user {org_admin,lead,member} email [--org ORG] [--force] Adds an admin participant and registers its kit. You cannot add another project_admin.
add-site name [--org ORG] [--force] Adds a client kit to the current output folder (normally prod_00); it is not registered as a CLI identity.

--org defaults to nvidia. --force replaces an existing participant entry. These commands are local workspace operations and are not gated by the active startup kit.

nvflare poc start

nvflare poc start
nvflare poc start --timeout 60
nvflare poc start -p server -p site-1
nvflare poc start -ex site-2
nvflare poc start -p [email protected] --study cancer_research
Option Default Description
-p, --service server + clients Participant to start; repeat for several.
-ex, --exclude — Participant to skip; repeatable.
-gpu, --gpu — GPU IDs exported as CUDA_VISIBLE_DEVICES.
--study — Study for an admin console launch only; ignored for server and clients.
--no-wait off Return immediately with status: starting.
--timeout 30 Seconds to wait for the admin server and selected clients to be ready.
-debug off Debug output.

Admin consoles are not started by default; name one explicitly with -p. By default the command waits until the admin server accepts connections and selected clients have registered, then returns status: running. The JSON result contains status, server_url, server_address, admin_address, clients, ready_timeout, port_conflict, port_preflight, warnings, and ready. Use server_address and admin_address in automation; server_url is kept for compatibility. If port_conflict is true, check port_preflight.conflicts before submitting jobs, or you may connect to another POC system already using those ports. The default POC ports are 8002 (federated learning) and 8003 (admin).

Named studies require a workspace prepared from a custom project.yml with api_version: 4 and a studies: section; otherwise only default is valid.

nvflare poc stop

nvflare poc stop
nvflare poc stop -p site-1 -p site-2
nvflare poc stop -ex site-2
nvflare poc stop --no-wait
Option Description
-p, --service Server or client to stop; repeatable. Default: server and clients.
-ex, --exclude Participant to leave running; repeatable.
--no-wait Return with status: shutdown_initiated instead of waiting.
-debug Debug output.

A default stop, or a server-only selection, uses coordinated system shutdown; any other selection stops services locally. Both wait for the selected services to stop (status: stopped) unless --no-wait is given. Admin consoles are closed by typing bye in the console.

nvflare poc clean

nvflare poc clean
nvflare poc clean --force

Removes the workspace, but only if it is a valid POC directory. If the system is still running, the command fails with a hint to stop it first; --force stops it and then removes the workspace.

Recipes and the CLI POC

PocEnv in a recipe does not use the CLI POC workspace. It creates a separate <workspace>.recipe-<id> folder for each run and refuses to deploy while the CLI POC system is running. See Execution Environments.

Troubleshooting

Symptom Fix
prepare refuses to overwrite in CI Add --force.
start reports port_conflict: true Another process or POC is using port 8002/8003; stop it or prepare from a project.yml with different ports.
job commands connect as the wrong user poc prepare activated the POC admin; switch with nvflare config use <id> or pass --kit-id.
clean fails because the system is running nvflare poc stop, or nvflare poc clean --force.

See Also