[2.8] Warn on deploy prepare storage rewrites#4530
[2.8] Warn on deploy prepare storage rewrites#4530YuanTingHsieh wants to merge 6 commits intoNVIDIA:2.8from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves nvflare deploy prepare for containerized runtimes by relocating server-side job/snapshot storage into the mounted workspace (to align Docker with existing K8s behavior) and by surfacing warnings when prepare-time component rewrites would otherwise silently discard operator configuration.
Changes:
- Relocate Docker server snapshot/job storage paths into the mounted workspace during deploy prepare (matching K8s behavior).
- Share/extend the server storage relocation helper and add warnings for non-relocatable snapshot persistor shapes.
- Warn when deploy prepare replaces/removes existing resource manager/consumer and launcher components/config during runtime preparation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
nvflare/tool/deploy/deploy_commands.py |
Adds Docker server storage relocation, introduces warning helpers for discarded component config, and warns on unexpected snapshot persistor shapes. |
tests/unit_test/tool/deploy/deploy_commands_test.py |
Adds unit tests for Docker server storage relocation and for warning/silence behavior around snapshot persistor shape and component replacement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds two behavioral improvements to
Confidence Score: 5/5Safe to merge. The change adds operator-visible warnings and extends Docker server storage relocation; it does not alter any data paths or security boundaries. The warning predicates correctly distinguish builtin defaults from custom configuration, with no false-positive risk on the default provisioned kit (which uses GPUResourceConsumer). Storage relocation for Docker server is a straightforward call to the same helper already exercised by the K8s path. The (KeyError, TypeError) guard is a strict improvement over the previous bare except KeyError. All new paths are covered by focused unit tests. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[prepare_deployment] --> B{runtime?}
B -->|docker| C[_prepare_docker]
B -->|k8s| D[_prepare_k8s]
C --> E[_patch_resources]
E --> W[_warn_for_replaced_components]
W --> F[filter + rebuild components]
F --> H{role == SERVER?}
H -->|yes| I[_relocate_server_storage_to_workspace]
H -->|no| J[continue]
I --> K{snapshot_persistor present?}
K -->|yes, good shape| L[set root_dir + uri_root]
K -->|yes, bad shape| M[_warn: cannot relocate]
K -->|absent| N[silent]
D --> O[_patch_resources]
O --> W2[_warn_for_replaced_components]
W2 --> P[filter + rebuild components]
P --> Q{role == SERVER?}
Q -->|yes| I
Q -->|no| R[continue]
Reviews (5): Last reviewed commit: "Merge branch '2.8' into codex/deploy-pre..." | Re-trigger Greptile |
What changed
snapshot_persistorcannot be relocated because it does not exposesnapshot_persistor.args.storage.args.root_dir; absentsnapshot_persistorremains silent.Why
Containerized deploy prepare rewrites runtime components and, for K8s, relocates server storage to durable workspace storage. Before this change, Docker server prepare left default job/snapshot stores under container-local
/tmp/nvflare/..., and both component rewrites and malformed snapshot persistor layouts could silently drop operator intent.Validation
python3 -m py_compile nvflare/tool/deploy/deploy_commands.py tests/unit_test/tool/deploy/deploy_commands_test.py