Deployment Commands

This page covers the commands that take provisioned startup kits into a running deployment: nvflare deploy (Docker, Kubernetes, Slurm), nvflare preflight-check, and nvflare dashboard, plus the deprecated nvflare simulator and nvflare authz-preview. Create the startup kits first with provisioning.

nvflare deploy

nvflare deploy prepare turns an existing server or client startup kit into a runtime-specific copy. It does not create identities, certificates, or clusters, and admin kits are not supported (they run no parent process). The input kit is treated as read-only.

nvflare deploy prepare <startup-kit-dir> [--output <dir>] [--config <runtime.yaml>]
Option Default Description
<startup-kit-dir> / --kit required Server or client kit.
--output <kit>/prepared/<runtime> Output directory.
--config <kit>/config.yaml Runtime config; its runtime key is docker, k8s, or slurm.

Requirements shared by all runtimes:

  • In secure mode, jobs use per-job certificates issued by the server, so the server kit must contain job_ca.crt/job_ca.key (added by default by nvflare provision). Older server kits must be re-provisioned.
  • Kubernetes and Slurm internal links use mTLS with the participant certificate in both roles; certificates restricted to only clientAuth or only serverAuth (for example from NVFLARE 2.8 distributed provisioning) must be re-provisioned. Certificates without EKU are fine.
  • Docker and Kubernetes support only the TCP internal transport. A kit whose local/comm_config.json sets internal.scheme to shared-file is rejected with INVALID_KIT.

Docker

runtime: docker
parent:
  docker_image: registry.example.com/nvflare-site:2.8
  network: nvflare-network
  internal_connection_security: mtls
job_launcher:
  default_python_path: /usr/local/bin/python
  default_job_env:
    NCCL_P2P_DISABLE: "1"
  default_job_container_kwargs:
    shm_size: 8g
    ipc_mode: host
Key Default Description
parent.docker_image required Parent server/client image.
parent.network nvflare-network Docker network for parent and job containers.
parent.internal_connection_security mtls mtls or clear (insecure opt-out).
job_launcher.default_python_path /usr/local/bin/python Python in job containers.
job_launcher.default_job_env — Env vars for every job container.
job_launcher.default_job_container_kwargs — Docker SDK kwargs; launcher-owned keys (volumes, mounts, network, environment, command, name, detach, auto_remove, user, working_dir, image) are rejected.
nvflare deploy prepare ./site-1 --config docker.yaml --output ./site-1-docker
cd ./site-1-docker
./startup/start_docker.sh

The command writes startup/start_docker.sh, patches local/resources.json.default to use DockerJobLauncher and local/comm_config.json, and creates a local/study_runtime.yaml template. Set a site default job image under studies.<study>.container.image in that file.

Kubernetes

runtime: k8s
namespace: nvflare
parent:
  docker_image: registry.example.com/nvflare-site:2.8
  parent_port: 8102
  workspace_pvc: nvflws
  workspace_mount_path: /var/tmp/nvflare/workspace
job_launcher:
  config_file_path: null
  pending_timeout: 300
Key Default Description
namespace default Namespace for parent and job pods.
server_service_name — Optional Service name for the server.
parent.docker_image required Parent image.
parent.internal_connection_security mtls mtls or clear.
parent.image_pull_secrets — Pull secrets for the parent pod.
parent.parent_port 8102 Port job pods use to reach the parent.
parent.workspace_pvc nvflws PVC holding the workspace.
parent.workspace_mount_path /var/tmp/nvflare/workspace Mount path (also used by job pods).
parent.python_path /usr/local/bin/python3 Python for the parent command.
parent.resources, parent.pod_security_context — Rendered into values.yaml.
job_launcher.config_file_path — kubeconfig; null uses in-cluster config.
job_launcher.pending_timeout — Seconds a job pod may stay Pending.
job_launcher.default_python_path /usr/local/bin/python3 Python in job pods.
job_launcher.image_pull_secrets, job_launcher.job_pod_security_context — Applied to job pods.

The output contains helm_chart/, patched local/ files, and a local/study_runtime.yaml template (the old local/study_data.yaml is no longer read). Then either copy startup/ and local/ into the workspace PVC and run helm upgrade --install, or stage them as Kubernetes objects:

nvflare deploy k8s stage ./site-1-k8s --namespace nvflare
helm upgrade --install site-1 ./site-1-k8s/helm_chart --namespace nvflare
# later
helm uninstall site-1 --namespace nvflare
nvflare deploy k8s unstage ./site-1-k8s

stage creates a ConfigMap (nvflare-local-<site>) from local/ and a Secret (nvflare-startup-<site>) from startup/, patches helm_chart/values.yaml, and records the namespace and names before calling kubectl, so cleanup targets survive partial failures. k8 is accepted as an alias for k8s. Options: --namespace (must already exist), --local-configmap, --startup-secret, and --kubectl (or KUBECTL=oc for OpenShift). Restaging with a different namespace is rejected with Prepared kit is already staged with a different namespace.; unstage first. prepare refuses to overwrite a chart that still records staged resources. Because the Secret holds the site's identity, always run unstage after uninstalling the release.

Slurm

runtime: slurm
job_launcher:
  sandbox: apptainer
  image: /lustre/images/nvflare-prod.sif
  python_path: /usr/bin/python3
  parent_host: nvflare-site1.internal
  internal_connection_security: mtls
nvflare deploy prepare ./site-1 --config slurm.yaml --output /lustre/proj123/nvflare/site-1
/lustre/proj123/nvflare/site-1/startup/start_slurm.sh

The output directory is the live workspace and must be visible at the same absolute path on the parent and compute nodes.

nvflare preflight-check

Run on each site's machine before starting it:

nvflare preflight-check -p /path/to/workspace/example_project/prod_00/server1
nvflare preflight-check -p /path/to/workspace/example_project/prod_00/site-1

preflight and preflight_check are aliases. Exit codes: 0 all applicable checks passed, 1 at least one failed, 4 invalid package path or format.

Kit Checks
Server Endpoint credentials, FL port binding, admin port binding, snapshot storage writable, job storage writable, dry run.
Client Endpoint credentials, server available (the server must be running), dry run.
Admin Server available, dry run.

Failures are reported with messages such as Can't bind to address (<host>:<port>): ... (check DNS and port) or Can't connect to <scheme> server (<host>:<port>) (check that the server is up).

nvflare dashboard

The Dashboard is a web application where organizations register clients and users and download their startup kits.

python3 -m pip install "nvflare[dashboard]"
nvflare dashboard --start --local                       # no Docker
nvflare dashboard --start -i nvflare/nvflare:2.7.2      # Docker
nvflare dashboard --stop
Option Description
--start / --stop Start or stop.
--local Run without Docker (requires the dashboard extra locally).
-i, --image Container image; required for Docker starts and cloud launches.
-p, --port Port (default 443).
-f, --folder Folder for the database and cert/ (default: current directory).
--passphrase Encrypts the root CA private key; must be repeated on every restart.
-e, --env Extra env vars var=value.
--cred Set credentials as USER_EMAIL:PASSWORD.
--cloud Launch on azure or aws.
--vpc-id, --subnet-id AWS only; both must be given or both are ignored.

On first start the Dashboard asks for the project admin email and generates a random password. If cert/web.crt and cert/web.key exist in the folder it serves HTTPS, otherwise HTTP, listening on 0.0.0.0. To start a new project, delete db.sqlite in the folder. The Docker image must include the dashboard extra, for example built with docker build -f docker/Dockerfile.parent --build-arg NVFLARE_EXTRAS=K8S,dashboard -t nvflare-dashboard:latest ..

nvflare simulator (deprecated)

nvflare simulator -n 2 -t 2 /path/to/job

Runs an exported job folder in the simulator. It prints WARNING: 'nvflare simulator' is deprecated. Use 'python job.py' with SimEnv instead. Options: job_folder, -w/--workspace, -n/--n_clients, -c/--clients, -t/--threads, -gpu/--gpu, -m/--max_clients (default 100), and --simulation-plan. A non-zero simulator status becomes the process exit code.

nvflare authz-preview (deprecated)

nvflare authz-preview -p /path/to/policy.json previews an authorization policy. It is deprecated and will be removed; the underscore alias authz_preview prints an extra warning.

See Also