-
Notifications
You must be signed in to change notification settings - Fork 228
Fix preflight check and ci #3917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Greptile Summary
Important Files Changed
Confidence score: 4/5
Sequence DiagramsequenceDiagram
participant User as "User"
participant PreflightTool as "Preflight Check Tool"
participant PackageChecker as "Package Checker"
participant CheckRule as "Check Rule"
participant ConfigReader as "Config Reader"
participant NetworkChecker as "Network Checker"
participant ProcessRunner as "Process Runner"
User->>PreflightTool: "Run preflight check -p package_path"
PreflightTool->>PackageChecker: "Create appropriate checker (Server/Client/Admin)"
PackageChecker->>PackageChecker: "should_be_checked()"
PackageChecker->>PackageChecker: "init_rules()"
PackageChecker->>ConfigReader: "Read config files (fed_*.json)"
ConfigReader-->>PackageChecker: "Return configuration"
PackageChecker->>CheckRule: "Create CheckServerAvailable rule"
PackageChecker->>CheckRule: "Execute check rules"
CheckRule->>ConfigReader: "get_communication_scheme()"
ConfigReader-->>CheckRule: "Return scheme (grpc/http/tcp)"
alt GRPC/AGRPC scheme
CheckRule->>NetworkChecker: "check_grpc_server_running()"
else HTTP/TCP scheme
CheckRule->>NetworkChecker: "check_socket_server_running()"
end
NetworkChecker-->>CheckRule: "Return connectivity status"
CheckRule-->>PackageChecker: "Return CheckResult"
PackageChecker->>ProcessRunner: "get_dry_run_command()"
PackageChecker->>ProcessRunner: "run dry run test"
ProcessRunner-->>PackageChecker: "Return dry run result"
PackageChecker-->>PreflightTool: "Return all check results"
PreflightTool-->>User: "Display preflight check results"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
tests/integration_test/preflight_check_test.py, line 80-90 (link)logic: Missing
http/httpshandling. Theclient_package_checker.pyskips GRPC checks for ALL non-GRPC schemes (including http), but this test expects GRPC checks for http. When using http scheme, this test will fail because:- Actual: only "Check dry run" (http is not grpc/agrpc)
- Expected: "Check GRPC server available" + "Check dry run"
6 files reviewed, 1 comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request updates the preflight check tool to dynamically adapt to different communication schemes (HTTP, TCP, GRPC) instead of being hardcoded to GRPC. The changes also remove deprecated overseer test functionality and update the preflight check tests to be scheme-aware.
Key changes:
- Added
get_communication_scheme()function to detect the communication scheme from package configuration files - Updated server and client package checkers to dynamically determine check names based on the actual scheme
- Refactored tests to parse preflight output programmatically and verify checks based on detected scheme
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
tests/integration_test/run_integration_tests.sh |
Removed overseer test function and its invocation from the integration test runner |
tests/integration_test/preflight_check_test.py |
Added scheme-aware helper functions to dynamically determine expected checks; replaced hardcoded output assertions with parsed verification logic |
tests/integration_test/data/projects/dummy.yml |
Removed dummy overseer agent configuration that is no longer needed |
nvflare/tool/package_checker/utils.py |
Added get_communication_scheme() function to read scheme from config files; refactored credential loading to only occur when needed |
nvflare/tool/package_checker/server_package_checker.py |
Updated to dynamically create check names based on communication scheme; renamed function from _get_grpc_host_and_port to _get_fl_host_and_port |
nvflare/tool/package_checker/client_package_checker.py |
Updated to conditionally add GRPC connectivity check only for GRPC-based schemes; added TODO for future TCP connectivity check |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (2)
-
nvflare/tool/package_checker/utils.py, line 26-27 (link)style: Unused imports:
Request,Session, andHTTPAdapterare no longer used after removing_create_http_sessionand_send_request. OnlyResponseis still needed. -
nvflare/tool/package_checker/server_package_checker.py, line 88 (link)style: Inconsistent scheme support:
CheckServerAvailableincheck_rule.pysupportstcpandstcpschemes, but this validation excludes them. Consider addingtcpandstcphere if they are valid for server package checking, or document why they are excluded.
7 files reviewed, 2 comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
nvflare/tool/package_checker/server_package_checker.py, line 88-89 (link)logic: Missing
tcpandstcpschemes in validation. These are valid builtin schemes (seestatic_file.py:66: builtin_schemes = ["grpc", "tcp", "http"]) and are supported inCheckServerAvailableincheck_rule.py:167. This will cause preflight check to fail for TCP-based FL deployments.
7 files reviewed, 1 comment
|
/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
nvflare/tool/package_checker/server_package_checker.py, line 88 (link)logic: Inconsistent scheme validation.
check_rule.py:167supports["http", "https", "tcp", "stcp"]for socket-based checks, andtcp/stcpare valid schemes in the codebase (seetcp_driver.py). Consider adding"tcp"and"stcp"here:
7 files reviewed, 1 comment
|
/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
nvflare/tool/package_checker/server_package_checker.py, line 88-89 (link)logic: Inconsistent scheme support:
CheckServerAvailableincheck_rule.py:167supports["tcp", "stcp"], but this check excludes them. Server preflight check will fail with RuntimeError for tcp/stcp schemes, while client preflight check would work.
7 files reviewed, 1 comment
|
/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
nvflare/tool/package_checker/check_rule.py, line 162 (link)style: redundant type casting -
portis already converted to int on line 155Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
7 files reviewed, 1 comment
Preflight check tool was hardcoded to test against GRPC communication scheme.
We have added more schemes and now our default is HTTP so we should change accordingly
Description
Types of changes
./runtest.sh.