lablup / lablup/backend.ai-webui

Migrate image environment selection components to the ImageV2 GQL API with project scope

Open
#8,472 0 comments 0 reactions 0 assignees View on GitHub
backend-change-required
Dominant language
TypeScript
Stars
133
Forks
81
Avg merge
1d 11h
Merged PRs (30d)
344

Description

## Summary

Image selection components still fetch environments through the legacy Graphene `images` query. Migrate them to the v2 (Strawberry) `ImageV2` API, and introduce **project scope** so the environment list reflects the images available to the currently selected project rather than a flat global list.

## Affected components

- `ImageEnvironmentSelectFormItems` — session launcher environment / version picker (`images(is_installed: $installed)`)
- `SessionLauncherPage`, `ResourceAllocationFormItems`, `useResourceLimitAndRemaining` — consume the selected `Image` object (`resource_limits`, `supported_accelerators`, `labels`)
- `DeploymentAddRevisionModal` — reuses `ImageEnvironmentFormInput`

## Scope

- Replace the legacy `images` query with the v2 image list query, scoped by project.
- Rework grouping / sorting / filtering to the `ImageV2` field shape (`identity`, `metadata`, `requirements`).
- Keep behavior parity: installed-only filtering (`showNonInstalledImages`), operational-image exclusion, own-customized-image-only visibility, ALIVE-only images, and full-list loading for grouping.

## Blocked by (backend, BA project)

The v2 API cannot currently reproduce the legacy behavior. These must land first:

- BA-7080 — non-admin scoped image list query (adminImagesV2 is superadmin-only; also needs the project/domain registry restriction)
- BA-7081 — expose agent install status on ImageV2 and allow filtering by it
- BA-7082 — support the legacy `load_filters` semantics (operational / customized-owner)
- BA-7083 — expose `registry`, `tag`, `version` on ImageV2 identity info
- BA-7084 — normalize `supportedAccelerators` to `["*"]` when unconstrained
- BA-7085 — default ImageV2 search to ALIVE status

## Notes

- `getImageFullName` can be rebuilt as `${identity.canonicalName}@${identity.architecture`}.
- `metadata.tags` / `metadata.labels` / `requirements.resourceLimits` map 1:1 to the legacy fields.
- `ImageV2.id` is a Relay GlobalID, not a raw UUID — check every consumer that assumes a UUID.
- v2 is a Connection with a default page size of 50; the grouping UI needs the full list, so pagination must be handled explicitly.

JIRA Issue: FR-3416

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ImageEnvironmentSelectFormItems and trace how SessionLauncherPage, ResourceAllocationFormItems, useResourceLimitAndRemaining, and DeploymentAddRevisionModal consume Image data. Review BA-7080 through BA-7085 first, then migrate the selection flow to the project-scoped ImageV2 connection with explicit pagination; done means legacy filtering, grouping, sorting, and consumer behavior remain equivalent.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.