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

Nov 6 rebase (sans vllm-project#6143) #468

Merged
merged 25 commits into from
Nov 6, 2024

Conversation

kzawora-intel
Copy link

This PR adds all commits before vllm-project#6143 without vllm-project#6143.

russellb and others added 24 commits November 5, 2024 07:50
Signed-off-by: Chenghao Yang <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Co-authored-by: Chenghao Yang <[email protected]>
Co-authored-by: youkaichao <[email protected]>
@@ -569,7 +569,8 @@
# This avoids race conditions with ray.
# see https://github.com/vllm-project/vllm/issues/8204
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("", args.port))
sock.bind((args.host or "", args.port))

Check warning

Code scanning / CodeQL

Binding a socket to all network interfaces Medium

'' binds a socket to all interfaces.

Copilot Autofix AI 2 months ago

To fix the problem, we need to bind the socket to a specific network interface instead of all interfaces. This can be achieved by modifying the sock.bind call to use a specific IP address. The best way to do this without changing existing functionality is to use the IP address provided in the args.host parameter. If args.host is not provided, we should raise an error or use a default secure IP address.

  1. Modify the sock.bind call on line 572 to use args.host directly.
  2. Ensure that args.host is not an empty string or 0.0.0.0. If it is, raise an error or use a default secure IP address.
Suggested changeset 1
vllm/entrypoints/openai/api_server.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/vllm/entrypoints/openai/api_server.py b/vllm/entrypoints/openai/api_server.py
--- a/vllm/entrypoints/openai/api_server.py
+++ b/vllm/entrypoints/openai/api_server.py
@@ -571,3 +571,5 @@
     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    sock.bind((args.host or "", args.port))
+    if not args.host or args.host in ["", "0.0.0.0"]:
+        raise ValueError("Invalid host address. Please provide a specific IP address.")
+    sock.bind((args.host, args.port))
     sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
EOF
@@ -571,3 +571,5 @@
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((args.host or "", args.port))
if not args.host or args.host in ["", "0.0.0.0"]:
raise ValueError("Invalid host address. Please provide a specific IP address.")
sock.bind((args.host, args.port))
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@kzawora-intel kzawora-intel merged commit 5eb7f3d into habana_main Nov 6, 2024
6 checks passed
@michalkuligowski michalkuligowski deleted the private/kzawora/nov_6_rebase branch November 6, 2024 13:09
@kzawora-intel kzawora-intel added the habana Issues or PRs submitted by Habana Labs label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
habana Issues or PRs submitted by Habana Labs
Projects
None yet
Development

Successfully merging this pull request may close these issues.