lablup / lablup/backend.ai

addModelRevision: accept image by reference (name/registry/architecture), not only by id

Open
#12,646 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

### Context

The Model Serving Add Revision flow (webui FR-3278) lets users enter an image name manually — the primary use case is hidden/customized (committed) images that are intentionally excluded from the image dropdown and must be typed to be used.

AddRevisionInput.image is ImageInput { id } — it accepts a registered image id only. So the webui currently resolves the manually entered reference to an id client-side via a separate image(reference:, architecture:) query before submitting the mutation (FR-3278). That is a two-step (query then mutation) workaround.

### Request

Allow addModelRevision (and ideally the sibling deploy mutations deployVfolderV2 / deployModelCardV2) to reference an image by reference (name / registry / architecture), not only by id — mirroring what the REST session-create endpoint already does (createIfNotExists with kernelName as the image string), reusing the existing ImageRefType { name, registry, architecture } input shape. Concretely, extend ImageInput (or AddRevisionInput.image) to accept an optional { reference, architecture } alongside id, resolved server-side via the same path as Query.image(reference:, architecture:).

### Benefits

- Consistency: the session launcher already accepts image strings resolved server-side; deployment would match.
- Atomicity: removes the client-side TOCTOU gap between the resolve query and the mutation.
- Simpler client: webui can drop the client-side resolve step (version-gated) once available.

### Notes

- The by-reference resolver already does NOT apply the customized/hidden load_filters visibility filter — it resolves any ALIVE image by exact reference, subject only to the domain allowed_docker_registries check — so hidden committed images resolve correctly. Mutation-side resolution should preserve that behavior.
- Webui side: once the manager supports this, gate with isManagerVersionCompatibleWith(...) and keep the client-side resolve as the fallback for older managers.
- Story point (2) is a placeholder for backend refinement.

Related: FR-3278 (webui client-side workaround).

JIRA Issue: BA-6774

Contributor guide

Open the contributing guide

Research direction

Trace the AddRevisionInput.image and ImageInput schema entry points, then compare Query.image(reference:, architecture:) with the REST session-create resolver and the deployVfolderV2/deployModelCardV2 mutations. Done means addModelRevision accepts an image reference with architecture, resolves it server-side like the existing query, and preserves hidden-image behavior; assess the sibling mutations for the same support.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.