Skip to content

Add annotations to instances in launcher#399

Merged
MikeSpreitzer merged 1 commit intollm-d-incubation:mainfrom
MikeSpreitzer:add-instance-annotations
Apr 2, 2026
Merged

Add annotations to instances in launcher#399
MikeSpreitzer merged 1 commit intollm-d-incubation:mainfrom
MikeSpreitzer:add-instance-annotations

Conversation

@MikeSpreitzer
Copy link
Copy Markdown
Collaborator

@MikeSpreitzer MikeSpreitzer commented Apr 1, 2026

.. to carry data meaningful to clients but not launcher.

This PR also updates some type names to say "State" instead of "Status", to correspond with their actual scope.

Also reshaped InstanceState to include VllmConfig inline.

Resolves: #397

Copilot AI review requested due to automatic review settings April 1, 2026 22:17
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 adds a generic annotations map to the launcher instance configuration/state so clients can attach and later retrieve metadata (e.g., ISC name and inference port) without the launcher needing to interpret it, addressing issue #397.

Changes:

  • Extend the launcher’s VllmConfig schema (Python + Go) with annotations: map[string]string.
  • Populate annotations from the controller when creating vLLM instances (e.g., isc-name, inference-port).
  • Refactor the Go launcher client types from “status” to “state” responses.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pkg/controller/dual-pods/launcherclient.go Adds Annotations to VllmConfig and refactors response structs/method names for instance “state”.
pkg/controller/dual-pods/inference-server.go Adds controller-provided annotations to the launcher instance config; updates sync method return type.
inference_server/launcher/tests/test_launcher.py Updates test fixture to include annotations in VllmConfig.
inference_server/launcher/launcher.py Adds annotations field to the Python VllmConfig model.

Comment on lines +61 to +63
InstanceID string `json:"instance_id"`
Status string `json:"status"`
Spec VllmConfig `json:",inline"`
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

InstanceState won't unmarshal the launcher’s JSON response as intended. The tag json:",inline" is ignored by Go’s encoding/json, and because Spec is a named field the config will end up nested under "Spec" (and the top-level options/gpu_uuids/env_vars/annotations fields will not populate). The Python launcher returns a flat object ({"instance_id", "status", ...config...} via **config.model_dump(...)), so this struct should embed VllmConfig anonymously (or implement custom (un)marshal) to match the API schema.

Suggested change
InstanceID string `json:"instance_id"`
Status string `json:"status"`
Spec VllmConfig `json:",inline"`
InstanceID string `json:"instance_id"`
Status string `json:"status"`
VllmConfig

Copilot uses AI. Check for mistakes.
Comment thread inference_server/launcher/launcher.py Outdated
options: str
gpu_uuids: Optional[List[str]] = None
env_vars: Optional[Dict[str, str]] = None
annotations: Optional[Dict[str,str]] = None
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This type annotation will fail flake8 (E231: missing whitespace after ',') because it uses Dict[str,str]. Update it to Dict[str, str] (and keep spacing consistent with the existing env_vars: Optional[Dict[str, str]]).

Suggested change
annotations: Optional[Dict[str,str]] = None
annotations: Optional[Dict[str, str]] = None

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

Choose a reason for hiding this comment

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

fixed

@MikeSpreitzer MikeSpreitzer force-pushed the add-instance-annotations branch 2 times, most recently from 490ba2d to 3ca0b5e Compare April 1, 2026 22:28
@MikeSpreitzer
Copy link
Copy Markdown
Collaborator Author

/ok-to-test

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

🚀 E2E tests triggered by /ok-to-test

View the OpenShift E2E workflow run

@MikeSpreitzer MikeSpreitzer force-pushed the add-instance-annotations branch 2 times, most recently from f3b74d6 to c7c373e Compare April 2, 2026 01:22
@MikeSpreitzer
Copy link
Copy Markdown
Collaborator Author

/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

@rubambiza rubambiza left a comment

Choose a reason for hiding this comment

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

Leaving a general comment without explicit approval in case the PR may depend on PR 363 being merged first.


func (ctl *controller) configInferenceServer(isc *fmav1alpha1.InferenceServerConfig, gpuUUIDs []string) (*VllmConfig, string, error) {
options := isc.Spec.ModelServerConfig.Options + " --port " + strconv.Itoa(int(isc.Spec.ModelServerConfig.Port))
portS := strconv.Itoa(int(isc.Spec.ModelServerConfig.Port))
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.

I'd like to flag a potential conflict here. PR 363 has overhauled/replaced this method definition to include a check on whether the user explicitly specifies the port number. Might be worth discussing what the dependency will be, but I am okay with merging this one first.

Btw, I haven't finished reviewing PR 363, but I had noted that the port number became optional in the ModelServerConfig as we discussed on the call yesterday.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think that PR #363 should come after completion of milestone 3.

I think that the PR at hand makes sense with or without the changes in PR #363 .

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

Unsigned commits detected! Please sign your commits.

For instructions on how to set up GPG/SSH signing and verify your commits, please see GitHub Documentation.

@MikeSpreitzer
Copy link
Copy Markdown
Collaborator Author

The force-push to 4619b3a is a rebase onto main.

.. to carry data meaningful to clients but not launcher.

Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>
@MikeSpreitzer MikeSpreitzer force-pushed the add-instance-annotations branch from 4619b3a to 3af68cd Compare April 2, 2026 14:15
@MikeSpreitzer
Copy link
Copy Markdown
Collaborator Author

.. aand the force-push to 3af68cd is a rebase with GPG signatures.

@MikeSpreitzer
Copy link
Copy Markdown
Collaborator Author

/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

@MikeSpreitzer MikeSpreitzer merged commit 77f97d2 into llm-d-incubation:main Apr 2, 2026
25 checks passed
@MikeSpreitzer MikeSpreitzer deleted the add-instance-annotations branch April 2, 2026 17:26
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.

[Feature]: Add annotations to instance state within launcher

5 participants