Skip to content
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

Support http communication implement for DLRover Master and Agent. #1429

Merged

Conversation

BalaBalaYi
Copy link
Collaborator

@BalaBalaYi BalaBalaYi commented Jan 8, 2025

What changes were proposed in this pull request?

  1. Implement a http server based on tornado in master.
  2. Adapt the implementation of the HTTP framework, including both the server and client, without modifying the core business logic, while also maintaining support for gRPC.

Why are the changes needed?

#1366

Does this PR introduce any user-facing change?

User can specify which service to use for communication between the master and agent by using the parameter --service_type=(http/grpc). For details, please refer: dlrover/docs/deployment/argument.md.

How was this patch tested?

UT + training with grpc type service + training with http type service.

@BalaBalaYi BalaBalaYi added do not merge Do not merge for same cases. wip issue or pr with 'wip' will ignore expiration feature labels Jan 8, 2025
@BalaBalaYi BalaBalaYi added this to the v0.5.0 milestone Jan 8, 2025
@BalaBalaYi BalaBalaYi self-assigned this Jan 8, 2025
# Conflicts:
#	dlrover/python/common/constants.py
#	dlrover/python/tests/test_utils.py
#	scripts/ci_install.sh
# Conflicts:
#	dlrover/python/master/args.py
#	dlrover/python/tests/test_args.py
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 92.23433% with 57 lines in your changes missing coverage. Please review.

Project coverage is 81.53%. Comparing base (2f4c582) to head (e4a33a1).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
dlrover/python/master/servicer.py 89.17% 17 Missing ⚠️
dlrover/python/elastic_agent/master_client.py 92.36% 10 Missing ⚠️
dlrover/python/common/comm.py 76.31% 9 Missing ⚠️
dlrover/python/common/http_server.py 87.09% 8 Missing ⚠️
dlrover/python/tests/test_http_server.py 94.28% 4 Missing ⚠️
dlrover/python/util/common_util.py 92.72% 4 Missing ⚠️
dlrover/python/master/dist_master.py 60.00% 2 Missing ⚠️
dlrover/python/elastic_agent/tensorflow/hooks.py 0.00% 1 Missing ⚠️
dlrover/python/tests/test_common_util.py 96.29% 1 Missing ⚠️
dlrover/trainer/torch/elastic_run.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1429      +/-   ##
==========================================
+ Coverage   81.40%   81.53%   +0.12%     
==========================================
  Files         238      240       +2     
  Lines       23238    23592     +354     
==========================================
+ Hits        18917    19235     +318     
- Misses       4321     4357      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@workingloong
Copy link
Collaborator

It is very meaningful job. Can we remove the grpc in the following verison?

@BalaBalaYi
Copy link
Collaborator Author

It is very meaningful job. Can we remove the grpc in the following verison?

Maybe. We need more time and practice to verify the performance, reliability, flexibility, etc., of the HTTP approach.

@BalaBalaYi BalaBalaYi removed the wip issue or pr with 'wip' will ignore expiration label Jan 14, 2025
@BalaBalaYi BalaBalaYi removed the do not merge Do not merge for same cases. label Jan 20, 2025
Copy link
Collaborator

@majieyue majieyue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so far the code LGTM. but we need some follow up

  1. perf report comparing grpc with http
  2. security extensions in the future, e.g. basic authentication, crypt/decrypt etc. for now the message with auth is needed to prevent bot sending deprecated messages

Copy link
Collaborator

@samplise samplise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@BalaBalaYi
Copy link
Collaborator Author

Note: The current implementation only indicates that the 'HTTP mode' is basically functional, but it does not imply that it is suitable for large-scale use in a production environment. We will continue to iterate and enhance the relevant parts until the functionality is stable and the performance meets expectations.

@BalaBalaYi BalaBalaYi merged commit 1c4109d into intelligent-machine-learning:master Jan 24, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants