Skip to content

Begin to use annotations in VllmConfig#404

Merged
waltforme merged 2 commits intollm-d-incubation:mainfrom
waltforme:use-annotation
Apr 2, 2026
Merged

Begin to use annotations in VllmConfig#404
waltforme merged 2 commits intollm-d-incubation:mainfrom
waltforme:use-annotation

Conversation

@waltforme
Copy link
Copy Markdown
Collaborator

This PR uses the "inference-port" annotation to find the port cleanly.

Signed-off-by: Jun Duan <jun.duan.phd@outlook.com>
Signed-off-by: Jun Duan <jun.duan.phd@outlook.com>
Copilot AI review requested due to automatic review settings April 2, 2026 18:44
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 PR updates the dual-pods controller to rely on VllmConfig annotations (specifically inference-port) when determining an instance’s inference port, and centralizes the annotation keys as constants.

Changes:

  • Introduces constants for isc-name and inference-port annotation keys.
  • Switches instance port detection from parsing Options to reading VllmConfig.Annotations["inference-port"].
  • Improves logging context when an instance’s port cannot be determined.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/controller/dual-pods/launcherclient.go Adds shared constants for VllmConfig annotation keys.
pkg/controller/dual-pods/inference-server.go Uses the annotation-based port lookup for launcher instance selection and uses the new constants when populating VllmConfig.Annotations.

Comment on lines +731 to 734
port, err := strconv.ParseInt(value, 10, 32)
if err != nil {
return 0, fmt.Errorf("parse annotations[%s] value %q: %w", VllmConfigInferencePortAnnotationKey, value, err)
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

getVLLMInstancePort parses the annotation value as a signed 32-bit integer but does not validate that it’s a valid TCP port (e.g., 1–65535). Since this value is later used to avoid port conflicts and to form wake-up endpoints, consider rejecting non-positive or out-of-range ports (and possibly use ParseUint with an explicit upper bound) to prevent silent misbehavior when the annotation is malformed or user-specified port is invalid.

Suggested change
port, err := strconv.ParseInt(value, 10, 32)
if err != nil {
return 0, fmt.Errorf("parse annotations[%s] value %q: %w", VllmConfigInferencePortAnnotationKey, value, err)
}
port, err := strconv.ParseUint(value, 10, 16)
if err != nil {
return 0, fmt.Errorf("parse annotations[%s] value %q as TCP port: %w", VllmConfigInferencePortAnnotationKey, value, err)
}
if port == 0 {
return 0, fmt.Errorf("annotations[%s] value %q is not a valid TCP port", VllmConfigInferencePortAnnotationKey, value)
}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We have bigger problems if we do not trust the instance annotations. Problems for later.

Copy link
Copy Markdown
Collaborator

@MikeSpreitzer MikeSpreitzer Apr 2, 2026

Choose a reason for hiding this comment

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

We need to put access control on all the access to the launcher's control port.

@MikeSpreitzer
Copy link
Copy Markdown
Collaborator

/ok-to-test

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

🚀 E2E tests triggered by /ok-to-test

View the OpenShift E2E workflow run

Copy link
Copy Markdown
Collaborator

@MikeSpreitzer MikeSpreitzer left a comment

Choose a reason for hiding this comment

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

LGTM

@waltforme waltforme merged commit fe5deda into llm-d-incubation:main Apr 2, 2026
29 checks passed
@waltforme waltforme deleted the use-annotation branch April 2, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants