[2.8] Add warnings for missing study data mappings#4528
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the diagnosability of “no study data mounts” behavior in NVFlare’s Docker and K8s job launchers by emitting warning-level logs when study_data.yaml is missing/empty or lacks an entry for the requested study (while preserving the existing skip-mount behavior).
Changes:
- Added optional logger support to the shared study-data loader/resolver and emitted warnings for missing/empty mappings and missing/empty study entries.
- Wired Docker/K8s launchers to pass their launcher logger into the shared helper so warnings appear in runtime logs.
- Updated design docs and added/updated unit tests to cover the new warning paths.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
nvflare/app_opt/job_launcher/study_data.py |
Adds warning diagnostics (gated by optional logger) for missing/empty study data mappings and missing/empty study entries. |
nvflare/app_opt/job_launcher/docker_launcher.py |
Passes the launcher logger into study-data helper calls so warnings surface in Docker runtime logs. |
nvflare/app_opt/job_launcher/k8s_launcher.py |
Passes the launcher logger into study-data helper calls so warnings surface in K8s runtime logs. |
tests/unit_test/app_opt/job_launcher/study_data_test.py |
Adds focused unit tests asserting warnings are logged when a logger is supplied. |
tests/unit_test/app_opt/job_launcher/docker_launcher_test.py |
Updates assertions to reflect logger propagation and verifies warning appears when study mapping is missing. |
docs/design/job_launcher_and_job_handle.md |
Clarifies that missing study entries skip mounts and now log warnings. |
docs/design/docker_job_launcher_design.md |
Clarifies that missing mappings/entries skip mounts and now log warnings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds warning-level diagnostics to the study-data mount path so operators see an explicit log message when
Confidence Score: 5/5Safe to merge — changes are additive, touch only the logging path, and preserve all existing skip-by-design behaviour. The change is purely additive: no control-flow alterations, no new failure modes, and no interface-breaking changes. The if study_data: guard correctly prevents double-logging and is documented via a docstring. All four new warning paths are covered by focused unit tests, and the Docker and K8s integration tests verify end-to-end warning propagation through caplog. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant L as DockerJobLauncher / K8sJobLauncher
participant SD as study_data.py
participant Log as self.logger
L->>SD: "load_study_data_file(path, logger=self.logger)"
alt file not found
SD->>Log: warning("file '%s' was not found…")
SD-->>L: "{}"
else file empty
SD->>Log: warning("file '%s' has no study entries…")
SD-->>L: "{}"
else file valid
SD-->>L: "{study: {dataset: {...}}}"
end
L->>SD: "resolve_study_dataset_mounts(study_data, study, path, logger=self.logger)"
alt study_data non-empty AND study missing
SD->>Log: warning("file '%s' has no entry for study '%s'…")
SD-->>L: []
else study present but datasets empty
SD->>Log: warning("entry for study '%s' has no datasets…")
SD-->>L: []
else study_data empty (already warned above)
SD-->>L: []
else datasets found
SD-->>L: [StudyDatasetMount, …]
end
Reviews (4): Last reviewed commit: "Merge branch '2.8' into codex/warn-missi..." | Re-trigger Greptile |
880fee2 to
2bf59bd
Compare
Signed-off-by: YuanTingHsieh <yuantingh@nvidia.com>
4d5f18d to
37c9527
Compare
|
/build |
|
Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance. |
What changed
study_data.yamlis missing, empty, missing the submitted study, or has an empty dataset entry.Why
The 2.8 branch documents missing study-data mappings as skip-by-design behavior, but the previous implementation gave operators no visible signal when a study job launched without expected data mounts. This keeps the existing contract while making incomplete mappings diagnosable.
Validation
git diff --checkpython3 -m compileall nvflare/app_opt/job_launcher/study_data.py nvflare/app_opt/job_launcher/docker_launcher.py nvflare/app_opt/job_launcher/k8s_launcher.py tests/unit_test/app_opt/job_launcher/study_data_test.py tests/unit_test/app_opt/job_launcher/docker_launcher_test.py tests/unit_test/app_opt/job_launcher/k8s_launcher_test.pyFull pytest was not run locally because this environment is missing test/runtime dependencies such as
pytest,yaml, andmsgpack.