-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow http and grpc server bind to specific address #4136
Conversation
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.
There is a CheckPortCollision()
function in main.cc which you will need to update as well. i.e. different endpoint can bind to the same port as long as they are listening to different address, so the collision should check both the address and port
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.
Also need to add tests for this feature.
src/main.cc
Outdated
if (std::get<1>(*curr_it) == std::get<1>(*comparing_it)) { | ||
if (std::get<1>(*curr_it) != std::get<1>(*comparing_it)) { | ||
continue; | ||
} |
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.
Move to line 640, the range check can be skipped as well if the addresses are different.
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.
I see. Thanks for the catch. Updated.
src/main.cc
Outdated
@@ -367,6 +373,8 @@ std::vector<Option> options_ | |||
"Allow the server to listen for GRPC requests."}, | |||
{OPTION_GRPC_PORT, "grpc-port", Option::ArgInt, | |||
"The port for the server to listen on for GRPC requests."}, | |||
{OPTION_GRPC_ADDR, "grpc-addr", Option::ArgStr, |
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.
nit: xxx-address
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.
Should I also make changes to all the parameters/arguments?
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.
Should I also make changes to all the parameters/arguments?
Personally I would make the same changes to the variables to keep things consistent. The original ask is because we don't use abbreviation for other cmdline options and the user is likely to assume the same for the new options.
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.
Got it, thanks for clarifying. Updated.
f431480
to
3aec851
Compare
src/http_server.cc
Outdated
return TRITONSERVER_ErrorNew( | ||
TRITONSERVER_ERROR_UNAVAILABLE, | ||
(std::string("Port '0.0.0.0:") + std::to_string(port_) + | ||
(std::string("Port '") + http_address_ + ":" + std::to_string(port_) + |
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.
Fix error message here. The port is just port_
. A socket is a combination of port and IP address.
2ed295f
to
efe746e
Compare
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.
Make sure you also have the corresponding change in CI since the test name is changed
fi | ||
run_server_nowait | ||
sleep 15 | ||
if [ "$SERVER_PID" == "0" ]; then |
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.
Should send ready / live request to make sure the server is running.
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.
Updated
@krishung5 you will need to update gitlab yaml for the change in naming for the L0_multiple_ports to avoid breaking the CI |
efe746e
to
d369037
Compare
No description provided.