Warn on deploy prepare storage rewrites#4548
Conversation
There was a problem hiding this comment.
Pull request overview
Ports deploy-prepare warnings and storage relocation behavior to main to make containerized (Docker/K8s) prepared kits safer and more transparent—avoiding silent drops of operator-provided runtime components and ensuring server state is stored on the mounted workspace.
Changes:
- Relocate Docker server snapshot/job storage paths into the mounted workspace (aligning with existing K8s prepare behavior).
- Emit human-readable warnings when
deploy prepareremoves/replaces configured resource manager/consumer or launcher components. - Add unit tests covering Docker storage relocation and warning/no-warning scenarios (including unexpected snapshot persistor shapes).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
nvflare/tool/deploy/deploy_commands.py |
Adds warning logic for replaced/removed components and relocates server storage to the workspace during Docker prepare (plus warning on unrelocatable snapshot persistor shapes). |
tests/unit_test/tool/deploy/deploy_commands_test.py |
Adds tests for Docker server storage relocation and for warning behavior when existing component configs would be discarded. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR ports observability improvements from the 2.8 branch to main: it adds warnings when
Confidence Score: 5/5The change is additive — it adds warnings before existing filters run and extends Docker server behaviour to match the already-stable K8s path. No existing data paths are modified in a breaking way. All new code paths have corresponding tests. The 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\ndocker_launcher]
D --> F[_patch_resources\nk8s_launcher]
E --> G[_warn_for_replaced_components]
F --> G
G --> G1{resource_consumer\ncustom config?}
G1 -->|yes| G2[Warning: removes component]
G --> G3{resource_manager\ncustom config?}
G3 -->|yes| G4[Warning: replaces resource_manager]
G --> G5{launcher\ncustom config?}
G5 -->|yes| G6[Warning: replaces launcher]
E --> H{role == SERVER?}
H -->|yes| I[_relocate_server_storage_to_workspace]
F --> J{role == SERVER?}
J -->|yes| K[_relocate_server_storage_to_workspace]
I --> L{snapshot_persistor\nin resources?}
K --> L
L -->|yes| M[try set root_dir]
M -->|KeyError/TypeError| N[Warning: cannot relocate]
M -->|success| O[root_dir = workspace/snapshot-storage]
L -->|no| P[skip]
I --> Q[job_manager.uri_root = workspace/jobs-storage]
K --> Q
Q --> R[_write_resources]
Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile |
|
/build |
1 similar comment
|
/build |
…e-storage-warnings-main # Conflicts: # tests/unit_test/tool/deploy/deploy_commands_test.py
same as #4530
What changed
Why
Containerized deploy prepare rewrites runtime components and relocates server storage. Without these warnings and Docker storage relocation, operator customization can be silently dropped and server state can remain on container-local storage.