Add annotations to instances in launcher#399
Add annotations to instances in launcher#399MikeSpreitzer merged 1 commit intollm-d-incubation:mainfrom
Conversation
There was a problem hiding this comment.
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
VllmConfigschema (Python + Go) withannotations: 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. |
| InstanceID string `json:"instance_id"` | ||
| Status string `json:"status"` | ||
| Spec VllmConfig `json:",inline"` |
There was a problem hiding this comment.
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.
| InstanceID string `json:"instance_id"` | |
| Status string `json:"status"` | |
| Spec VllmConfig `json:",inline"` | |
| InstanceID string `json:"instance_id"` | |
| Status string `json:"status"` | |
| VllmConfig |
| options: str | ||
| gpu_uuids: Optional[List[str]] = None | ||
| env_vars: Optional[Dict[str, str]] = None | ||
| annotations: Optional[Dict[str,str]] = None |
There was a problem hiding this comment.
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]]).
| annotations: Optional[Dict[str,str]] = None | |
| annotations: Optional[Dict[str, str]] = None |
490ba2d to
3ca0b5e
Compare
|
/ok-to-test |
|
🚀 E2E tests triggered by /ok-to-test |
f3b74d6 to
c7c373e
Compare
|
/ok-to-test |
|
🚀 E2E tests triggered by /ok-to-test |
rubambiza
left a comment
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
c7c373e to
4619b3a
Compare
|
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. |
|
The force-push to 4619b3a is a rebase onto |
.. to carry data meaningful to clients but not launcher. Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>
4619b3a to
3af68cd
Compare
|
.. aand the force-push to 3af68cd is a rebase with GPG signatures. |
|
/ok-to-test |
|
🚀 E2E tests triggered by /ok-to-test |
.. 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