lablup / lablup/backend.ai

Switch installed-image reads to DB (legacy GQL, REST v1, CLI)

Open
#13,414 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

Replace the Valkey-backed reads of installation info with agent_images DB queries, preserving current behavior.

Scope:
- ImageRepository list_agents_with_image(s) and get_image_installed_agents backed by DB queries (legacy GQL installed / installed_agents fields, ImageNode.installed dataloader, REST v1 get-image-by-id).
- Manager CLI image list --installed: replace direct Valkey client calls (get_agent_counts_for_images / get_agents_for_images in cli/image_impl.py) with DB queries.
- Switch the ImageV2.installedAgents base condition from Valkey by_ids to a DB-backed installation condition.
- hide_agents behavior unchanged.

Success Criteria
- [ ] legacy GQL installed and installed_agents return the same results as before for the same state
- [ ] CLI image list --installed shows the same agents and counts as before
- [ ] dead agents are excludable via a join on agent status (no stale installed results from Valkey leftovers)
- [ ] pants test passes for affected packages

JIRA Issue: BA-7165

Contributor guide

Open the contributing guide

Research direction

Start with ImageRepository methods list_agents_with_image(s) and get_image_installed_agents, then trace the legacy GQL fields, ImageNode.installed dataloader, REST v1 get-image-by-id, and ImageV2.installedAgents. Review cli/image_impl.py for image list --installed and run pants test for the affected packages. Done means matching prior results, excluding dead agents, and preserving hide_agents behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, cli, database
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.