Skip to content

Commit

Permalink
fix: Broken ComputeContainer GQL (#3042) (#3071)
Browse files Browse the repository at this point in the history
Co-authored-by: Gyubong Lee <[email protected]>
Co-authored-by: Joongi Kim <[email protected]>
  • Loading branch information
3 people authored Nov 12, 2024
1 parent 213348a commit c502915
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/3042.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix regression of `ComputeContainer` GraphQL queries due to newly introduced relationship fields
11 changes: 8 additions & 3 deletions src/ai/backend/manager/models/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,14 @@ async def batch_load_detail(
.where(
(KernelRow.id.in_(container_ids)),
)
.options(selectinload(KernelRow.group_row))
.options(selectinload(KernelRow.user_row))
.options(selectinload(KernelRow.image_row))
.options(
noload("*"),
selectinload(
KernelRow.group_row,
KernelRow.user_row,
KernelRow.image_row,
),
)
)
if domain_name is not None:
query = query.where(KernelRow.domain_name == domain_name)
Expand Down

0 comments on commit c502915

Please sign in to comment.