Skip to content

Add 2.8 release notes and NVFlare CLI tutorial#4643

Merged
chesterxgchen merged 2 commits into
NVIDIA:mainfrom
chesterxgchen:main-2.8-release-notes-cli-tutorial
May 19, 2026
Merged

Add 2.8 release notes and NVFlare CLI tutorial#4643
chesterxgchen merged 2 commits into
NVIDIA:mainfrom
chesterxgchen:main-2.8-release-notes-cli-tutorial

Conversation

@chesterxgchen
Copy link
Copy Markdown
Collaborator

What this does

Cherry-picks the two recent 2.8 PRs onto main:

Verification

  • python3 -m pytest tests/unit_test/tool/job/job_stats_test.py tests/unit_test/tool/job/job_abort_test.py tests/unit_test/examples/hello_pt_client_test.py -q: 18 passed
  • notebook no outputs/execution counts check
  • git diff --check upstream/main..HEAD
  • targeted black/isort/flake8
  • ./runtest.sh -s

chesterxgchen and others added 2 commits May 19, 2026 13:23
## Summary
- Add 2.8.0 release notes and wire them into the docs index pages.
- Highlight major 2.8.0 themes: CLI automation, distributed
provisioning, native Docker/Kubernetes job execution, multi-study
support, live log streaming, security hardening, reliability, and
examples.
- Keep the release notes high-level while linking to detailed docs.

## Testing
- git diff --cached --check
- python3 -m sphinx -b html docs /tmp/nvflare_docs_280_check -q -W
--keep-going (fails locally: missing sphinx_llm)

---------

Co-authored-by: Yuan-Ting Hsieh (謝沅廷) <yuantingh@nvidia.com>
## Summary
- Replace the old job CLI notebook with an end-to-end NVFlare CLI
tutorial covering config, system, study, and job workflows.
- Update hello-pt so the tutorial can export a runnable synthetic-data
job with log streaming enabled.
- Normalize job stats behavior when a job is no longer running and add
focused coverage.

## Validation
- pytest tests/unit_test/tool/job/job_stats_test.py
- jq empty examples/tutorials/nvflare_cli.ipynb
- verified source notebook has no outputs or execution counts
@chesterxgchen chesterxgchen force-pushed the main-2.8-release-notes-cli-tutorial branch from 0093882 to 589730f Compare May 19, 2026 20:23
@chesterxgchen chesterxgchen merged commit ba40e26 into NVIDIA:main May 19, 2026
16 checks passed
@chesterxgchen chesterxgchen deleted the main-2.8-release-notes-cli-tutorial branch May 19, 2026 20:27
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR cherry-picks two 2.8.0-branch changes onto main: the 2.8.0 release notes and a replacement of the deprecated Job CLI tutorial with a new NVFlare CLI tutorial, along with supporting code updates to the hello-pt example and job_cli.py.

  • Documentation: adds flare_280.rst release notes covering CLI expansion, distributed provisioning, Docker/Kubernetes launchers, multi-study support, log streaming, and security hardening; updates welcome.rst, whats_new.rst, previous.rst, and several example docs to reflect the 2.8.0 release.
  • hello-pt example: adds --synthetic_data, --train_size, --test_size, and --num_workers flags to client.py and job.py, adds a ValueError guard when the evaluation data loader is empty (matching the custom rule), and adds a corresponding unit test in hello_pt_client_test.py.
  • job_cli.py: adds JobNotRunning error handling in cmd_job_stats (previously unhandled), enriches the abort error with a detail field, and adds a matching test case in job_stats_test.py.

Confidence Score: 4/5

Safe to merge — all code changes are additive and well-covered by the 18 passing tests listed in the PR description.

The bulk of the PR is documentation and tutorial replacement, which carry no runtime risk. The three code changes — JobNotRunning handling in cmd_job_stats, synthetic-data support in hello-pt, and the empty-loader ValueError — are each covered by new tests and follow established patterns. One minor concern exists in hello_pt_client_test.py: sys.path.pop(0) could silently remove the wrong sys.path entry if any import during exec_module prepends its own path, potentially polluting the path for later tests.

tests/unit_test/examples/hello_pt_client_test.py — the sys.path.pop(0) cleanup could be made more robust (see inline comment).

Important Files Changed

Filename Overview
nvflare/tool/job/job_cli.py Adds JobNotRunning import and proper error handling in cmd_job_stats; also enriches the existing abort error with a detail field. Both changes are consistent with the surrounding error-handling pattern.
examples/hello-world/hello-pt/client.py Adds synthetic data support, parameterised num_workers/train_size/test_size flags, and a ValueError guard when the evaluation data loader produces zero samples — consistent with the custom rule.
examples/hello-world/hello-pt/job.py Propagates the new client flags through the recipe's train_args, adds --enable_log_streaming support, and threads all new arguments cleanly into the simulation entry point.
tests/unit_test/examples/hello_pt_client_test.py New test file verifying that evaluate() raises ValueError on an empty data loader; module loading is correctly isolated, but sys.path.pop(0) is fragile (see inline comment).
tests/unit_test/tool/job/job_stats_test.py Adds test_stats_job_not_running_exits_1 using the same mocking pattern as existing tests; correctly imports JobNotRunning and asserts exit code, error code, and message content.
examples/tutorials/nvflare_cli.ipynb New tutorial notebook replacing job_cli.ipynb; covers CLI commands for config, system status, study management, job submit/abort/stats/download, and provisioning — no outputs or execution counts, consistent with CI requirements.
docs/release_notes/flare_280.rst New 2.8.0 release notes file covering CLI expansion, distributed provisioning, Docker/Kubernetes launchers, multi-study support, log streaming, security hardening, and new examples.
docs/release_notes/previous.rst Adds flare_272 entry so 2.7.2 is properly listed under previous releases now that 2.8.0 is the current release.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[cmd_job_stats called] --> B{Call session.show_stats}
    B -->|Success| C[output_ok with stats JSON]
    B -->|JobNotFound| D[output_error JOB_NOT_FOUND]
    B -->|JobNotRunning| E[output_error JOB_NOT_RUNNING\ndetail: stats available only while running]
    B -->|AuthenticationError| F[re-raise]
    B -->|NoConnection| G[output_error CONNECTION_FAILED]

    H[cmd_job_abort called] --> I{Call session.abort_job}
    I -->|Success| J[output_ok]
    I -->|JobNotRunning| K[output_error JOB_NOT_RUNNING\ndetail: abort available only while running]
    I -->|AuthenticationError| L[re-raise]
Loading

Reviews (1): Last reviewed commit: "[2.8] Add NVFlare CLI tutorial (#4639)" | Re-trigger Greptile

Comment on lines +41 to +43
finally:
sys.path.pop(0)
if original_model_module is not None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 sys.path.pop(0) assumes example_dir is still at index 0 when the finally block runs. If any import triggered by exec_module prepends its own entry to sys.path, pop(0) silently removes that entry instead of example_dir, leaving the test's path addition permanently in sys.path for subsequent tests. Using sys.path.remove(example_dir) (or a try/except around it) removes the correct entry by value regardless of what happened to the list during execution.

Suggested change
finally:
sys.path.pop(0)
if original_model_module is not None:
finally:
try:
sys.path.remove(example_dir)
except ValueError:
pass
if original_model_module is not None:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants