Update POC Docker mode to use deploy runtime#4517
Conversation
e261025 to
abfbba1
Compare
d2b4e70 to
8dc7495
Compare
Greptile SummaryThis PR replaces the legacy Confidence Score: 5/5Safe to merge; only P2 robustness suggestions remain. No P0 or P1 findings. The two P2 comments are minor robustness nits that do not affect correctness in normal operation. The logic change is well-tested with 71 passing unit tests and all new code paths are guarded with CLIExceptions. nvflare/tool/poc/poc_commands.py — specifically _prepare_poc_docker_deployments (participant key access) and _write_poc_docker_study_data (unconditional write). Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["nvflare poc prepare -d image"] --> B["local_provision()"]
B --> B1["add_poc_docker_runtime() writes poc_runtime to project_config"]
B --> B2["copy.deepcopy(project_config) provision_config"]
B2 --> B3["prepare_project / Provisioner.provision"]
B3 --> B4["Kits generated in prod_XX/"]
B4 --> C["prepare_poc_provision()"]
C --> C1["_prepare_poc_docker_deployments(workspace, project_config)"]
C1 --> C2["get_poc_docker_runtime_config() normalized docker_config"]
C2 --> C3["for each server/client participant"]
C3 --> D["_prepare_poc_docker_kit(kit_dir, docker_config, workspace)"]
D --> D1["_validate_runtime_config / _validate_kit / _prepare_docker"]
D --> D2["_write_poc_docker_study_data() local/study_data.yaml"]
D --> D3{"role == client?"}
D3 -->|Yes| D4["_patch_poc_docker_client_target() localhost to server alias"]
D3 -->|No| D5["skip patch"]
C1 --> C4["update_storage_locations()"]
subgraph Dynamic
E["_provision_poc_participant_only()"] --> E1["shutil.move kit to target_kit"]
E1 --> E2["get_docker_run_mode() == deploy?"]
E2 -->|Yes| D
end
Reviews (5): Last reviewed commit: "Merge branch 'main' into codex/poc-docke..." | Re-trigger Greptile |
8dc7495 to
143c5bb
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates nvflare poc prepare -d/--docker-image to provision POC workspaces using the same Docker runtime preparation path as nvflare deploy prepare, generating start_docker.sh + Docker job-launcher resources and persisting the Docker runtime config in the POC project config, while keeping legacy docker.sh -d support for older projects.
Changes:
- Introduces POC Docker runtime detection/mode selection (legacy vs deploy) and switches Docker-mode start commands to
start_docker.shfor deploy-mode workspaces. - Adds deploy-mode Docker kit preparation for POC (including client target patching) and pre-populates
study_data.yamlto mount$POC_WORKSPACE/dataas/data/default/poc. - Updates docs and adds unit tests for runtime detection, command selection, client target patching, and study-data generation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit_test/tool/poc/poc_output_test.py | Updates/extends coverage for Docker runtime detection in POC configs. |
| tests/unit_test/lighter/poc_commands_test.py | Adds unit tests for deploy-mode Docker command selection and kit/study-data preparation helpers. |
| nvflare/tool/poc/service_constants.py | Adds constants for Docker run mode (legacy vs deploy). |
| nvflare/tool/poc/poc_commands.py | Implements deploy-mode Docker runtime config, detection, kit preparation, and study-data generation for POC. |
| docs/user_guide/nvflare_cli/poc_command.rst | Documents new Docker POC behavior (deploy-mode prep + dataset mount path). |
| docs/user_guide/data_scientist_guide/job_recipe.rst | Clarifies meaning of docker_image for Docker POC and job launcher_spec requirements. |
| docs/design/nvflare_cli.md | Updates CLI design table entry for --docker_image semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4a12c2e to
335ed22
Compare
335ed22 to
82d0ceb
Compare
|
/build |
|
/build |
Summary
nvflare poc prepare -dprojects to record a POC Docker runtime config instead of injecting the oldStaticFileBuilderDocker image option.poc_runtime.runtime: dockeras supported POC Docker mode; oldStaticFileBuilder.args.docker_imageprojects no longer enable POC Docker start commands.nvflare deploy prepare, producingstart_docker.shandDockerJobLauncherresources.add_docker_builderhelper so POC no longer points at the old DockerBuilder/docker-compose path.study_data.yamlso jobs in the default study can use/data/default/poc, backed by$NVFLARE_POC_WORKSPACE/data.poc_runtime,parent, andjob_launchershapes with clearCLIExceptions, remove an unreachable runtime guard, and write POC data sources withrealpath.Validation
/Users/yuantingh/NVFlare/venv/bin/python -m isort nvflare/tool/poc/poc_commands.pywithisort==5.13.2/Users/yuantingh/NVFlare/venv/bin/python -m black nvflare/tool/poc/poc_commands.pywithblack==25.9.0/Users/yuantingh/NVFlare/venv/bin/python -m flake8 nvflare/tool/poc/poc_commands.py tests/unit_test/lighter/poc_commands_test.py tests/unit_test/tool/poc/poc_output_test.pywithflake8==7.1.1git diff --check/Users/yuantingh/NVFlare/venv/bin/python -m pytest tests/unit_test/lighter/poc_commands_test.py tests/unit_test/tool/poc/poc_output_test.py -q(71 passed)local/study_data.yamlmapsdefault.poc.sourceto$NVFLARE_POC_WORKSPACE/datawithmode: rw, with nodefault_job_mountsorNVFL_DOCKER_DATA_DIRleftovers.